We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3749
    • 24,544 Posts
    I’m having trouble with lexicon keys in a CMP.

    I have cheatsheet_desc in the Description field of the Menu item.

    I created a lexicon file:
    core/components/cheatsheet/lexicion/en/default.inc.php

    and another at
    assets/components/cheatsheet/lexicion/en/default.inc.php


    With this content:
    <?php
    $_lang['cheatsheet_desc'] = 'MODx Cheat Sheet';


    I know the namespace path is correct because the CMP executes fine, but the description shows as cheatsheet_desc in the menu.

    Do I have to explicitly load the lexicon file somewhere or is there something else I’ve missed?

      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
      • 28215
      • 4,149 Posts
      Quote from: BobRay at Mar 11, 2010, 09:45 PM

      I have cheatsheet_desc in the Description field of the Menu item.
      I created a lexicon file:
      core/components/cheatsheet/lexicion/en/default.inc.php

      and another at
      assets/components/cheatsheet/lexicion/en/default.inc.php

      You only need the core one. Note, however, it’s spelled ’lexicon’, not ’lexicion’.


      With this content:
      <?php
      $_lang['cheatsheet_desc'] = 'MODx Cheat Sheet';

      I know the namespace path is correct because the CMP executes fine, but the description shows as cheatsheet_desc in the menu.
      Do I have to explicitly load the lexicon file somewhere or is there something else I’ve missed?

      Did you import into the DB? The files are only there for reference - you’ll need to actually import it into a Topic. And for top menus, you’ll need to make sure any Entries you reference in the Menu are in the ’default’ Topic for your Namespace. Once you’ve imported, clear the cache.
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 3749
        • 24,544 Posts
        Doh!. I was misreading this from the docs: "MODx will automatically load your Namespace’s "default" Lexicon Topic, should it exist."

        I’ll put a note in the docs for others.
          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