Copied to clipboard

Flag this post as spam?

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


  • Damien Holley 181 posts 542 karma points
    Oct 06, 2020 @ 06:27
    Damien Holley
    0

    Get dropdown selection in nested content template (AngularJS)

    Hi does anyone know of a way to get the string value of a dropdown selection in the template area of nested content? I will be using this to identify the nested content entries.

    here's what I have, the if statement works fine, but I keep getting [id] if I use region.

    {{region == "" ? "All" : getById(region)}}
    

    I wish to use this in the below highlighted area:

    enter image description here

  • Marc Goodson 2157 posts 14435 karma points MVP 9x c-trib
    Oct 06, 2020 @ 07:28
    Marc Goodson
    100

    Hi Damien

    There is a way to show the Node Name in the nested content title for a content picker instead of the id, using a special custom Angular filter that is in the core.

    {{ pickerAlias | ncNodeName }}
    

    But if you have a 'dropdown' then that is different - But you could implement your own custom AngularJS filter and add it to the Umbraco backoffice using a package.manifest file, and adding it to the umbraco.filters modules - to perform the lookup of the name...

    ... have a look at the implementation for the ncNodeName filter:

    https://github.com/umbraco/Umbraco-CMS/blob/ba73ad57927f461fd3f6d1160078a0003522ec30/src/Umbraco.Web.UI.Client/src/common/filters/nestedcontent.filter.js

    that would give you an idea of what's involved, and where to start!

    regards

    marc

  • Damien Holley 181 posts 542 karma points
    Oct 17, 2020 @ 23:00
    Damien Holley
    0

    Thanks Marc, not exactly what I was looking for and it means Umbraco doesn't use the SOLID principles, as the responsibility is external which worries me.

    I may have to go with your advice on this one as I can see no oither way around it.

    Cheers!

  • 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