We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 43267
    • 5 Posts
    hey folks,

    currently developing a snippet that uses javascript and therefore i need all lexicon entries of a specific topic for different languages (e.g. french if i am on the french site).

    i already figured out how to access the lexicon and how to fetch a number of entries:

    $modx->lexicon->load('my_namespace:my_topic');
    var_dump($modx->lexicon->fetch());
    


    The problem is, that the fetch method throws back not only the entries of the specific lexicon but the entries of all my different topics. how can i access just the topics that are in "my_topic"?

    i little (or bigger) hint would be nice.

    cheers,
    alex
      • 43267
      • 5 Posts
      Propably not the nicest solution:

      a new array that contains all of the required lexicon keys. then i iterate this array with foreach and use $modx->lexicon($key_of_new_array) to fill a second array for my javascript.