Bjornmamman / Our.Umbraco.SimpleTreeMenu

3 stars 6 forks source link

Any idea why the empty-check for RTEs doesn't work in name templates? #58

Closed hfloyd closed 3 months ago

hfloyd commented 3 months ago

I have an RTE on the "Menu Item" Element used for the menu. When I create a name template using that along the lines of: {{!! MyRte ? '[Has RT]' : '[No RT]' }} it ALWAYS displays [Has RT].

I tried several different variations without success.

madsoulswe commented 3 months ago

Hi! Sorry for all late responses. Have been super busy!

Not sure actually the template uses native umbraco angularfilters. But it might be the new json-format that Umbraco stores richtext in.

It's something like this:

{
    "markup": "<p>......",
    "blocks" : ....,
}
hfloyd commented 3 months ago

Hi Dennis, No problem at all, I know this is a labor of love, and appreciate your response.

I didn't realize the RTE data structure had changed, but with the new inline blocks, it makes sense... Let me do some testing with that info you provided...

hfloyd commented 3 months ago

@madsoulswe you were correct - This works properly:

{{!! MyRte["markup"] ? '[Has RT]' : '[No RT]' }}

Thanks again!