Copied to clipboard

Flag this post as spam?

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


  • deepika 4 posts 24 karma points
    Aug 07, 2014 @ 08:25
    deepika
    0

    How can we change the text globally for multiple site with single instance.

    I have 5 sites in a single database of umbraco.

    Like

    site1

    site2

    site 3 all are in umbraco database.

    Now i want  to change text globally. Instead of adding the same text for each site1, then site2 etc.,

    how can i do this.

    please help.

    Thanks,

    deepika.

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Aug 07, 2014 @ 08:49
    Dennis Aaen
    0

    Hi deepika and welcome to our,

    When you are working with multiple site, and say text, did you mean e.g labels or so. If then you should take a look at the dictionary items function. With this you can add a key, and then translate the labels globally, 

    For instance you have a back to list link where you would like the translate the anchor text in to the different languages that you have set up on your Umbraco installation. The solution here would be create a dictionary item. The dictionary item key is unique, and the key is the name of the dictionary item

    http://24days.in/umbraco/2013/the-dictionary-secrets/

    If you have access to Umbraco TV, you can see some videos how to create dictionary items and using dictionary items.

    http://umbraco.tv/videos/implementor/multi-lingual/creating-a-multi-lingual-site/creating-dictionary-items/

    http://umbraco.tv/videos/implementor/multi-lingual/creating-a-multi-lingual-site/using-dictionary-items/

    If you are using razor, and an older Umbraco version here is how to access the dictionary items in Razor http://our.umbraco.org/documentation/reference/templating/macros/razor/using-dictionary-items

    If you are using Umbraco 7 you need to access the doctionary items this way.

    @Umbraco.GetDictionaryValue("MyItemKey")

    http://our.umbraco.org/documentation/reference/Querying/UmbracoHelper/#GetDictionaryValue%28stringkey%29

    If you want to use dictionary in XSLT http://our.umbraco.org/documentation/Reference/Api/UmbracoLibrary/#GetDictionaryItem%28SystemString%29

    Or if you want to use dictionary items  directly into the templates, and you are using webforms you can use this.

    <umbraco:item field="#MyItemKey" runat="server"/>

    If you are using MVC, instead of Webforms, you can use this:

    @Umbraco.GetDictionaryValue("MyItemKey")

    I know this is a lot of information, but I hope this helps and if you have any further questions to this don't hesitate to ask again.

    /Dennis

  • deepika 4 posts 24 karma points
    Aug 07, 2014 @ 09:15
    deepika
    0

    Thanks for your reply.

    Yes i mean the label here.

    Suppose after adding all the sites. Now i want to change the content(which will be same) for that label for all those sites. site 1,site 2, site 3,site 4,site 5.

    How can I change it at once?

    So i don't have to do it 5 times for each site.

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Aug 07, 2014 @ 09:48
    Dennis Aaen
    0

    Hi deepika.

    All the places where you need to add langauge specific text. you need to add dictionary items. So you need to go though your templates, Razor files, or XSLT files if you have some of them, and add the dictionary functionality, after that you need to create the dictionary items, in the settings section in the dictionary items folder.

    See Jans artcile here: http://24days.in/umbraco/2013/the-dictionary-secrets/

    So there will be some work to create and place the code in templates and scripting files, either it's XSLT files or Razor files.

    Hope this helps, or if I have misunderstood your question if so could you please try to explain it more detailed.

    /Dennis

     

  • deepika 4 posts 24 karma points
    Aug 07, 2014 @ 10:08
    deepika
    0

    Hi,

    Here on my requirement the sites are not related to langauge specific text. It is not a multi lingual sites

    It will be just a normal text content which will be common for all site.

    Some labels are common and some will be for a specific site.

  • John C Scott 473 posts 1183 karma points
    Aug 14, 2014 @ 11:46
    John C Scott
    0

    If you have content which is common to all of your sites maybe it would make sense to store this in one place and use this content then on each of your sites.

    So you have maybe a structure like:

    root
    +site1
    +site2
    +site3
    +common-content

    If you're using XSLT then you could get to this a number of ways. One approach might be as follows.

    So if your common content had text properties called "someHeading" or "someOtherText" you might display it like this:

    <xsl:variable name="commonContent" select="umbraco.library:GetXmlNodeByXPath('//common-content')"></xsl:variable>
    <h2><xsl:value-of select="$commonContent/someHeading"/></h2>
    <p><xsl:value-of select="$commonContent/someText"/></p>

    So here I am assigning the common content node to the variable 

     

Please Sign in or register to post replies

Write your reply to:

Draft