We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24629
    • 370 Posts
    hi all,

    Iwant to make a TV (selectbox) that gets populated based on another TV namely 'language'.
    so when the user creates a new page and selects the proper template the selectbox only has the right entries based on the language.

    My TV 'language' is an @INHERIT and is set by the toplevel folders EN NL and DE.
    For my selectbox i now have a @SELECT
    @SELECT `pagetitle` AS `name`,`id` FROM `[[+PREFIX]]site_content` WHERE `parent` = 120 AND `deleted` = 0

    Now how can i make the parent ID variable based on the allready present TV language?

    tnx
      • 13218
      • 134 Posts
      hi,

      i think in this case you should use @EVAL for your selectbox instead of @SELECT. This way you could use a snippet to populate the selectbox. From within that snippet i think you should have access to the resource and its language TV.

      Call it like so:
      @EVAL return $modx->runSnippet('populateSelectbox');
        @itWilllBeOK