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,

    i’m trying to make a TV thats will list all pages of a parent.
    i want the parent to be a variable. so how would i do this

    if ($LNG==’NL’) @SELECT `pagetitle` AS `name`,`id` FROM `[[+PREFIX]]site_content` WHERE `parent` = 2 AND `deleted` = 0
    else if ($LNG==’EN’) @SELECT `pagetitle` AS `name`,`id` FROM `[[+PREFIX]]site_content` WHERE `parent` = 53 AND `deleted` = 0
    any idea how to do this?

    tnx
    Ralph
      • 4172
      • 5,888 Posts
      you can create a snippet which returns what your need and use it like that:
      @EVAL return $modx->runSnippet('yoursnippet',array('param1'=>'value1','param2'=>'value2'));
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!