We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 45900
    • 53 Posts
    I have made the website in 2 languages and using Babel to manage those 2 languages. The site has English language as the default. The site can display both languages except the Thai language that is from the text field from template variable.

    I can see that when I want to show the value from template variable, it has the id related to. For example I have this
    <p>[[getResourceField? &id=`2` &processTV=`1` &field=`AboutDITP`]]</p>


    The id = 2 refers to the resource id of English page but the id of my Thai page where I have Thai content is '134'.

    I'm pretty sure there should be some clever way to deal with this.


    Thank you.
      • 3749
      • 24,544 Posts
      You could create a Context Setting for each Context that contains the ID of the appropriate page (assuming that you have a separate context for each language).

      <p>[[getResourceField? &id=`[[++ContextSettingName]]` &processTV=`1` &field=`AboutDITP`]]</p>


      Personally, I think I would put the content in a chunk, rather than a TV, and just put the name of the chunk in the Context Setting. It would be much faster and simpler.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 18373 ☆ A M B ☆
        • 3,141 Posts
        Doesn't getResourceField require you to define &isTV=`1` as well when working with TVs?
          Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

          Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.