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 142 posts 334 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 142 posts 334 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 142 posts 334 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 4998 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 :)

Please Sign in or register to post replies

Write your reply to:

Draft