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 5058 posts 15520 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! :) 

Please Sign in or register to post replies

Write your reply to:

Draft