Copied to clipboard

Flag this post as spam?

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


  • Nicky Christensen 76 posts 166 karma points
    Jan 11, 2012 @ 14:24
    Nicky Christensen
    0

    Get DictionaryItem, How?

    How do i get an item from the dictionary?

    I've tried this, passing a parameter in the macro:

    @{

      var image = @Model.AncestorOrSelf().Media("siteLogo");

      var link = "@Model.Parameter.LogoLink";

    }


    <a href="@link" title="Home">

      <img alt='@image.Name' src='@image.UmbracoFile' />

    </a>

    This doesnt work, i've also tried this, but then i get an error:

    var link = "@Model.Dictionary.DictionaryItemAlias("LogoLink");

  • Sebastiaan Janssen 4899 posts 14655 karma points MVP admin hq
    Jan 11, 2012 @ 14:27
    Sebastiaan Janssen
    1

    Try: 

    @umbraco.library.GetDictionaryItem("LogoLink")
  • Nicky Christensen 76 posts 166 karma points
    Jan 11, 2012 @ 14:28
    Nicky Christensen
    0

    Great, that does the trick! :) 

  • 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