Copied to clipboard

Flag this post as spam?

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


  • Dominic Kelly 114 posts 133 karma points
    Jan 12, 2012 @ 23:06
    Dominic Kelly
    0

    ContentPicker?

    Im trying to populate a link in my template from a Content Picker DataType using Razor.

    <a id="slide_1" href="#">Our Operations</a>

    So just the href (#) and the anchor (Our Operations).

    How do I go about doing this from an embedded Macro in a template?

  • Gareth Evans 138 posts 329 karma points c-trib
    Jan 12, 2012 @ 23:13
    Gareth Evans
    2

    Would something like this work for you?

    @{

    var node = @Library.NodeById(Model.aliasForContentPickerType);

    <a href="@node.Url">@node.Name</a>

    }

  • Dominic Kelly 114 posts 133 karma points
    Jan 12, 2012 @ 23:32
    Dominic Kelly
    0

    Yup, perfect!! The documentation seems to be a bit thin on the ground for this stuff - where should I be looking?

  • Gareth Evans 138 posts 329 karma points c-trib
    Jan 12, 2012 @ 23:42
    Gareth Evans
    2

    The razor umbraco.tv videos, the razor dynamicnode cheatsheet or the blog posts on the umbraco blog

    You can also get a lot from the cultiv razor examples site

    Gareth

  • Dominic Kelly 114 posts 133 karma points
    Jan 12, 2012 @ 23:45
    Dominic Kelly
    0

    Ok cool thanks. Nothing formal then.

  • Gareth Evans 138 posts 329 karma points c-trib
    Jan 13, 2012 @ 00:03
    Gareth Evans
    0

    Nope, also please mark this thread as resolved/answered, thanks! :)

  • Dominic Kelly 114 posts 133 karma points
    Jan 17, 2012 @ 18:46
    Dominic Kelly
    0

    I would if I knew how!

  • Tom Fulton 2030 posts 4996 karma points c-trib
    Jan 17, 2012 @ 18:54
    Tom Fulton
    0

    Just click the green checkmark at the top of the post you'd like to mark as the answer :)

  • 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