Copied to clipboard

Flag this post as spam?

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


  • Luke Hook 45 posts 175 karma points c-trib
    Sep 26, 2018 @ 16:17
    Luke Hook
    0

    Nested Content Image Name as Template Label

    Hi there,

    I'm using nested content to create a component with an image and would like to know if it's possible to display the image name as the template label for that Doc Type.

    If I use {{image}} I get the Umbraco media reference url. ie. umb://media/197d7b7f087c44d8aac778f6e1900c0b but is there an easy way to supply the image name?

    Thanks, Luke

  • Marc Goodson 2141 posts 14344 karma points MVP 8x c-trib
    Sep 26, 2018 @ 18:17
    Marc Goodson
    1

    Hi Luke

    I know if it's a content picker you can use

    {{pickerAlias | ncNodeName}}

    to show the name of the picked item

    ... and in the original Nested Content there was a PR to add ncMediaName

    https://github.com/umco/umbraco-nested-content/pull/129

    {{pickerAlias | ncMediaName}}

    but I don't think this ever got added, so suspect it's not an option in the version of Nested Content that is in the Umbraco core :-(

    regards

    Marc

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Sep 26, 2018 @ 19:22
    Dave Woestenborghs
    1

    Recently a PR has been merged in with some extra capabilities for the name template of nested content. This is part of 7.12

    https://github.com/umbraco/Umbraco-CMS/pull/2457

    These changes have been documented : https://our.umbraco.com/documentation/Getting-Started/Backoffice/Property-Editors/Built-in-Property-Editors/Nested-Content

    Dave

  • Daniel Gillett 72 posts 149 karma points
    Mar 10, 2020 @ 12:20
    Daniel Gillett
    0

    Hello,

    Does anyone know if this works in V8? I've tried every alias and none of them display the image name, picked with the media picker.

    I checked the v8 documentation wich says I could be able to get the image name using the picker alias, but it only gives me:

    umb://media/197d7b7f087c44d8aac778f6e1900c0b

    I'm using the image picker in a nested content with no text string to draw a title from. So I have to use either item1, item2 etc. or the umb://media

    I'm using v8.5 but also had this issue with 8.4 as well.

    Many thanks! Daniel

  • Luke Hook 45 posts 175 karma points c-trib
    Mar 10, 2020 @ 12:31
    Luke Hook
    4

    Hi Daniel. Try this, it works for me currently in 8.4.

    {{ tileImage | ncNodeName }}

    Where ‘tileImage’ is the alias of your image property

  • Daniel Gillett 72 posts 149 karma points
    Mar 10, 2020 @ 12:56
    Daniel Gillett
    1

    Luke!

    You're the one! I can't believe I was reading it wrong! I thought that | pipe was an an optional OR statement OMG so I only used one or the other! Wow!

    ...feeling a bit stupid at the moment!

    Thank you so much!

    {{ portfolioImage | ncNodeName }}

    Best, Daniel

  • Luke Hook 45 posts 175 karma points c-trib
    Mar 10, 2020 @ 12:58
    Luke Hook
    0

    Hi Daniel,

    No worries man. I had the same head scratching madness. There’s some really powerful values that can be used in these fields but it’s hard to find well documented info.

    Glad I could help 😊

  • Daniel Gillett 72 posts 149 karma points
    Mar 10, 2020 @ 13:06
    Daniel Gillett
    0

    All the best, Luke!

    I hope I can return the help one day.

    😊

Please Sign in or register to post replies

Write your reply to:

Draft