Copied to clipboard

Flag this post as spam?

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


  • Dmitrij Jazel 86 posts 179 karma points
    Dec 13, 2012 @ 08:55
    Dmitrij Jazel
    0

    Culture specific image?

    Hello Umbraco guys :-)

    Question here, let's say I have a english flag in Footer (a png image) and if I am on Danish website - I would like to see Danish flag instead (also png image).

    Is there any way I could set this up somehow in Umbraco and manage it quite easy (simmilar to Dictionary items) or in aniway avoid xslt/razor macros. Or as I said before, something simmilar to dictionary?

    Thanks alot for help! :-)

    //Dmitrij

  • Comment author was deleted

    Dec 13, 2012 @ 09:08

    Well you could use a dictonary item to store the image path :) 

  • Dmitrij Jazel 86 posts 179 karma points
    Dec 13, 2012 @ 09:51
    Dmitrij Jazel
    0

    Hej Tim,

    hmm.. that is good idea ;-)

    But let's say you have a 3-5 lines of HTML content that includes a picture and you wanted to make that culture specific...

    is there a possibility in a template  to make a quick check like:

    <!-- if english version -->

    use this markup... (my image is here)

    <!-- end if -->

    <!-- if danish version -->

    use this markup... (my image is here)

    <!-- end if -->

    That can be done in XSLT for example, but is there a way to do something like this dirrectly in the template?

    //Dmitrij

  • Comment author was deleted

    Dec 13, 2012 @ 09:55

    yeah dictionary items :)

    No need to do a culture specific check in templates that's what the dictionary items are form

    Say you are using razor you can just do

    <img src="@Dictionary.myKey" /> 

    and store the path to the image in the dictionary

  • Dmitrij Jazel 86 posts 179 karma points
    Dec 13, 2012 @ 10:00
    Dmitrij Jazel
    0

    So if I correctly understand you actually are able to store html codeblocks in dictionary items?

    Because that is what I meant in previous post - I want to avoid macros (for this specific situation I have here on website) for now...

  • Paul Wright (suedeapple) 277 posts 704 karma points
    Dec 20, 2012 @ 00:40
    Paul Wright (suedeapple)
    0

    If your storing actual HTML in the dictionary, you probably want to ouput it as:

    @Html.Raw(Dictionary.myKey)
Please Sign in or register to post replies

Write your reply to:

Draft