Expose $contentTypeName in UFM expressions
#21804
albintoxic
started this conversation in
Features and ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Current behaviour
By default the block's content type name is rendered as the block label in a block list. UFM expressions currently expose property values like
$index, and$settings. There is no way to access the block's content type name dynamically in the block label template, meaning the only option is to hardcode it in each label template.Desired behaviour
Expose a reserved variable such as
$contentTypeNamein the UFM expression context, enabling patterns like:or as a parameter in UFM components:
Why
Hardcoding the type name is prone to manual complexity since if a content type is renamed, every block label template referencing it must be updated manually. The
$contentTypeNamevariable was also available in Umbraco 13 block label templates, thus this would restore parity with previous functionality.Achieving this today requires building a custom UFM component, which is a significant overhead for what should be a simple, common use case that I believe many could benefit from (or perhaps its just me 😄)
Beta Was this translation helpful? Give feedback.
All reactions