Umbraco 17 Beta Umbraco Flavoured Markup

I’ve already seen the same question in extending Umbraco 16 with Umbraco Flavoured Markup, however, I’m not up to speed with web components and the solution used in the threads. I also have a ‘isBlockVisible’ toggle in all my block settings which I used to display in Umbraco 13 to the user in the label using:

{{$index}}. {{title}} {{$settings.isBlockVisible ==‘0’ ? ‘[HIDDEN]’ : ‘’}}

My question is can you do this in UFM now in Umbraco 17 BETA directly in the label? If not will it be in the final release?

I’m currently using:

{umbValue: title | fallback : N/A}

but really need to display to the user that the block has been hidden in a simple straightforward solution.

Thanks

Without having your setup locally, it isn’t easy to test, but you could try something like this:

${ $index + 1 }. {=title} ${ $settings.isBlockVisible == "0" ? "[HIDDEN]" : "" }

That’s a mix of UFM ({ expression }) and UFMJS (${ expression })

{= property }: UFM, shorthand for {umbValue}

${ property }: UFMJS, javascript-like expressions such as math and booleans

Thank you so much Jacob, the settings expression works . The index I get not a number, NaN, but the main thing is being able to show to the user that the block has been hidden. ATB A

Oh yeah, my bad around $index. It is a feature targeting 16.4, which is out soon:

I using Umbraco 17 Beta, so hopefully by the RC1 or release it will be added? A

Yes, should be available in the first RC.

The index property works now in Umb 17.0.2 so my blocks have the following code to show the index, title or fallback as well as if in the settings the block is set to visible or not.

${ $index + 1 }. {umbValue: paragraphTitle| fallback: Paragraph} ${ $settings.isBlockVisible == “0” ? “[HIDDEN]” : “[VISIBLE]” }

Many thanks for helping me to find this solution. :smiley: