We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28042 ☆ A M B ☆
    • 24,524 Posts
    Is it possible to have system settings variables in Lexicon file entries? For example, something like {settings_version}
      Studying MODX in the desert - http://sottwell.com
      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
      Join the Slack Community - http://modx.org
      • 3749
      • 24,544 Posts
      I usually replace them with str_replace() in my code, but I don't see why not. They should be parsed when the page is rendered.
        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
        Mark Hamstra Reply #3, 12 years ago
        It's possible to pass a property to a lexicon tag:
        [[%lexicon_entry? &placeholder=`foo`]]

        which is then available as [[+placholder]] in the lexicon value. Similar constructs exists for other ways of getting a lexicon key, like in the manager javascript:
        _('lexicon_entry', {placeholder: 'foo'});

        and php:
        $modx->lexicon('lexicon_entry', array('placeholder' => 'foo'));


        Depending on how you're using it, you could pass a system setting via a property. By default they're not available.

        That said, if you're using the [[%tag]] approach in a template, the lexicon could contain setting tags [[++site_name]] which will then be parsed in the next parse cycle, so then it does work.
          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.
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          No good; I'm trying to add the Revo version to the topmenu.inc.php file in the 'Dashboard' field so that when you hover over the X in the upper left the version is in the hovered title.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org