We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 51112
    • 2 Posts
    erix_liechtenstein Reply #1, 11 years ago
    Hello everyone

    This is my first post and I am very new to Modx, so apologies in advance if my question is a bit silly


    My question is - what is the best way to organise text messages on a site? I.e. I have a lot of system messages - i.e. error / popup text

    Currently I have text embedded in html chunks which I include in Resources

    What I am looking for is a single file where I can define each text item as a variable - and then link these into my chunks / resources

    What is the best way of doing that?



    Thank you in advance and apologies for noobness of the question

    This question has been answered by BobRay. See the first response.

    • discuss.answer
      • 3749
      • 24,544 Posts
      I don't think it's silly. We were all new to MODX at some point. smiley

      I'm not completely clear on what you want, but Template Variables (TVs) might be what you want. They hold resource-specific values and they can have default and/or inherited values.

      Another possibility is language strings. They sound more like what you want. They can be in a lexicon file with keys and values. They can also be in the database if you add them in Lexicon Management. They can be displayed with language tags, or in code with $modx->lexicon('key');

      If they're stored in one or more lexicon files, you have to add a snippet at the top of your pages to load them with $modx->lexicon->load().
        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
        • 51112
        • 2 Posts
        Quote from: BobRay at Sep 19, 2015, 12:20 PM
        I don't think it's silly. We were all new to MODX at some point. smiley

        I'm not completely clear on what you want, but Template Variables (TVs) might be what you want. They hold resource-specific values and they can have default and/or inherited values.

        Another possibility is language strings. They sound more like what you want. They can be in a lexicon file with keys and values. They can also be in the database if you add them in Lexicon Management. They can be displayed with language tags, or in code with $modx->lexicon('key');

        If they're stored in one or more lexicon files, you have to add a snippet at the top of your pages to load them with $modx->lexicon->load().

        thank you!! I think lexicon files are exactly what I need
          • 3749
          • 24,544 Posts
          I'm glad I could help. Thanks for reporting back. smiley
            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