We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9207 ☆ A M B ☆
    • 2,475 Posts
    I’ve been looking through the documentation here:
    http://svn.modxcms.com/docs/display/revolution/Custom+Manager+Pages

    I’m having trouble following the Lexicon entries... I’m familiar with the concept, but I can’t seem to make my menu show my Lexicon entries for my new menu item and the new component that it launches. I created a new Lexicon topic for my component (a default topic), and I’ve added 2 entries for my component for the default topic in English, but I don’t see my custom menu item using those entries.

    Any pointers?
      • 28215
      • 4,149 Posts
      Are I’m assuming you’re meaning the modMenu item?

      So in that, you’ll need to have a ’default’ topic in your component, and your component will need a Namespace. Once you’ve got that, make the ’text’ and ’description’ values of the modMenu object be the lexicon keys that you want to use. Take a look at the Quip snippet for how it’s done.
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 9207 ☆ A M B ☆
        • 2,475 Posts
        Link to Quip?

        Something weird is going on (and it’s probably something I did). I GOT this working now, but I don’t know how.

        I’m looking at some of the existing menu items... e.g. Site --> Clear Cache. If I examine the Actions and menu stuff under System --> Actions, I see that the text is "refresh_site" and the description is "refresh_site_desc". But I can’t find the corresponding keys in the Lexicon. They must be somewhere in the core namespace...

        I added lexicon keys when I tried (and failed), but this morning, I couldn’t find them (see Search stuff below). Now I re-added them and my menu works. I think it may have something to do with the fact that I added a category somehow... when I added the lexicon entries AGAIN, I saw a category for "default" and one for "10" -- I have no idea what "10" is... it does not appear in the search bar when I want to browse entries for my namespace.

        PS: the label on the search "Clear Filter" is confusing... I kept thinking "Where is the SEARCH button? I don’t have any results to clear yet!" This might be a browser issue because the search results for the first search don’t display until I’ve clicked the "Clear Filter" button (OS 10.4.11 Safari 4.0.3). Also, it’d be very helpful to have a search capacity that allowed you to search across ALL categories.
          • 3749
          • 24,544 Posts
          They are in the core namespace, default topic.

          They show up for me in Lexicon Management when I type the keys in the filter box at the upper right and click on the grid.
            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
            Actually, the core namespace, ’topmenu’ topic.
              shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
              • 3749
              • 24,544 Posts
              When I found it in the Lexicon grid using the filter, I left the topic at default and, when they were found, the topic in the dropdown was still "default" although they’re both shown when you select the topmenu topic.

              I suppose the filter searches the whole namespace and can’t set the topic dropdown because the results might be in different topics?

                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
                • 9207 ☆ A M B ☆
                • 2,475 Posts
                I wanted to give this thread a bump, because now that I’ve worked through this again for Custom Manager Pages, I’m not sure I’ve implemented this correctly and I wanted to ensure that the docs reflected the correct way to translate menu items.
                  • 28215
                  • 4,149 Posts
                  Quote from: Everett at Apr 29, 2010, 01:36 AM

                  I wanted to give this thread a bump, because now that I’ve worked through this again for Custom Manager Pages, I’m not sure I’ve implemented this correctly and I wanted to ensure that the docs reflected the correct way to translate menu items.

                  Sort of - a couple things:

                  1. Any lexicon topics you specify in the Action’s Language Topics field will automatically be loaded for that Action.
                  2. The Lexicon Entry you specify for the Text or Description for the Menu object *must* be in the "default" Topic for your Namespace. (In other words, you should always have a "default" topic for your CMPs if you wish them to be translatable.)
                    shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                    • 9207 ☆ A M B ☆
                    • 2,475 Posts
                    Ok, let’s say that I *do* have a default topic with a key for "My Menu Title" defined for English as "This is my English Title" -- shouldn’t the CMP menu title get resolved to be "This is my English Title" when I log into the manager? I’m not seeing that behavior.

                    Here’s my narrow-minded and limited understanding of this... I’m imagining that there is somewhere behind the scenes a translate() function. The key you pass to it would be looked up in the active language, e.g.


                    print translate('My Menu Title');
                    // ... somewhere else...
                    $_lang['My Menu Title'] = 'This is my English Title';


                    And we’d see ’This is my English Title’. If the key was not defined, the function just returned the key: garbage in, garbage out. I’m assuming that the Lexicon is setup similarly, but I could be totally mistaken.

                    Can you clarify how this works and explain why my menus aren’t being translated?

                    Looks like another tutorial page is in the works...
                      • 9207 ☆ A M B ☆
                      • 2,475 Posts
                      AHA. It was cached. I cleared the cache, and POOF: there it was. Ok, tutorial page, here we come.