Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jay 425 posts 652 karma points
    Dec 25, 2016 @ 15:52
    Jay
    0

    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

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Dec 29, 2016 @ 11:56
    Dave Woestenborghs
    0

    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

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Dec 29, 2016 @ 11:57
    Dave Woestenborghs
    0

    By the way..would be a nice feature request for Nested content.

    Dave

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies