Nested Content datatype - Name Template fallback value
Hi Lee,
Was wondering if there's a way that we can do fallback value in the "Name Template" section.
I know we can pull back a value based on alias. Eg {{title}} which will pull the title through to show the user when there's value and if it's empty it will show "Item 1"
Is there a way to have {{title}} and then a fallback value if that's empty to a particular text like "Module Promo"?
Nested Content datatype - Name Template fallback value
Hi Lee,
Was wondering if there's a way that we can do fallback value in the "Name Template" section.
I know we can pull back a value based on alias. Eg {{title}} which will pull the title through to show the user when there's value and if it's empty it will show "Item 1"
Is there a way to have {{title}} and then a fallback value if that's empty to a particular text like "Module Promo"?
Appreciate any help
Thanks
Hi JLon,
It runs the name template as a javascript function in the getName function: https://github.com/umco/umbraco-nested-content/blob/develop/src/Our.Umbraco.NestedContent/Web/UI/App_Plugins/NestedContent/Js/nestedcontent.controllers.js#L217
So maybe it's possible to have some js in your name template like this : {{propertyName!=''?propertyName:'Fall back text'}}
But that it's just in theory. Haven't tried that before.
Dave
By the way..would be a nice feature request for Nested content.
Dave
is working on a reply...