Copied to clipboard

Flag this post as spam?

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


  • Greg 25 posts 103 karma points
    May 05, 2017 @ 14:16
    Greg
    0

    umbraco 7.6 and macro parameters

    I'm just starting a new project in Umbraco 7.6.

    Working with my macro, I'm querying a parameter:

    @Model.MacroParameters["Link"]
    

    Which is a content picker. Pre 7.6 it would return the node id, now it's returning umb://document/7d988c66eb6b40dd84013ab120a042df.

    Not sure what I'm suppose to do with this.

    Any help anyone, couldn't find any documentation with this.

  • Alex Skrypnyk 6150 posts 24110 karma points MVP 8x admin c-trib
    May 05, 2017 @ 14:18
    Alex Skrypnyk
    0

    Hi Greg,

    Since 7.6 Umbraco changed stored in content pickers data from ids to uids, look here please:

    https://our.umbraco.org/documentation/getting-started/setup/upgrading/760-breaking-changes#property-editors-storing-udi-instead-of-id-u4-9310

  • Greg 25 posts 103 karma points
    May 05, 2017 @ 14:19
    Greg
    0

    Awesome, so how to I get the content from a Uid instead of The node ID?

  • Alex Skrypnyk 6150 posts 24110 karma points MVP 8x admin c-trib
    May 05, 2017 @ 14:21
    Alex Skrypnyk
    0

    Try to use IPublishedContent object directly from GetPropertyValue, like:

    .GetPropertyValue<IPublishedContent>
    
  • Greg 25 posts 103 karma points
    May 05, 2017 @ 14:25
    Greg
    0
    Model.Content.GetPropertyValue<IPublishedContent>("umb://document/7d988c66eb6b40dd84013ab120a042df")
    

    ? cuz that's returning null for me :/

Please Sign in or register to post replies

Write your reply to:

Draft