Copied to clipboard

Flag this post as spam?

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


  • Paul Stoker 39 posts 72 karma points c-trib
    Mar 23, 2012 @ 16:38
    Paul Stoker
    0

    How to use Content Picker in Umbraco 5 - quick fix

    This was causing me such a headache today although I am hungover ;-S sooo I thought I'd share it.

    It's probably statement of the bleeding obvious for most but atleast newbies will find it.I found that the shortest way to pull in code from a content picker was the following:

    @Umbraco.GetDynamicContentById(DynamicModel.ContentPickerProperty).SomePropertyFromContentPage

     

    Hope this helps

  • LordToro 9 posts 29 karma points
    Apr 25, 2012 @ 10:59
    LordToro
    0

    Thanks, Paul Stoker. :)

    I was implemented this way:            

     if (CurrentPage. teaserBox  != "string$_(null)")
     {

     var teaserBoxStringId = CurrentPage.teaserBox as string;  

    Content teaserBoxNode = Hive.Content.GetById(teaserBoxStringId);

    // Do something with  teaserBoxNode ...

     }

    PS. "teaserBox" is a name of property by using content picker data type in CurrentPage.

    Cheer.

  • Patompol Taesuji 17 posts 39 karma points
    Apr 25, 2012 @ 11:12
    Patompol Taesuji
    0

    Hi LordToro,

    Great for example :)

    Can you expain about using media picker and get url in macro patial?

    Thanks a lot,

    PT

  • 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