Copied to clipboard

Flag this post as spam?

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


  • Mikael Axel Kleinwort 140 posts 484 karma points c-trib
    Apr 22, 2021 @ 20:09
    Mikael Axel Kleinwort
    0

    How to display Key (Guid) of element in block's editor settings - Editor Appearance - Label field

    I am on Umbraco 8.

    I want to display the unique Key (Guid) of each element of a blocklist in the label field of the blocklist element.

    My blocklist element's data type has a property with alias itemName. So having this AngularJS expression in the "Label" field in "editor appearance":

    {{itemName}} 
    

    displays the item name in the blocklist element list just fine.

    The data type also has an inherited Key property. But when I change the expression to

    {{itemName}}, Guid: {Key}
    

    nothing is displayed for Key. Same when I use key.

    Is there a way to display this inherited property through an AngularJS expression in the backoffice?

    Background: I have a blocklist, and I want to be able to address specific blocklist elements from code in a view file. I thought it is a good idea to use the unique Key value of the blocklist elements for this. If there is a better way for this, I am grateful for hints.

  • Mikael Axel Kleinwort 140 posts 484 karma points c-trib
    Apr 23, 2021 @ 05:38
    Mikael Axel Kleinwort
    0

    I have reconsidered my approach to the problem. It seems like a "code smell" to me when I have to use an element's Guid in this way.

    I now approach the issue differently, without the need for displaying the Guid.

Please Sign in or register to post replies

Write your reply to:

Draft