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

    I am not sure if with getresources you can do conditional arguments.

    I have a page with a list of its children as links. When you click on a link it opens the child page. PERFECT

    Now I want that child to have the same list as its parent so that people can jump to another item without going back to the parent.

    Currently I have
    [[!getResources? &parents=`[[*id]]`  &tpl=`myRowTpl`]]


    The logic would be something like
    [[!getResources? &parents=`( if ( [[*id]] != 99 )  { [[*id]] = 99 }  )`  &tpl=`myRowTpl`]]


    Is it possible to do something like that? My guess is there is an easier way...so tell me, tell me...


    and thanks in advance [ed. note: xxxmicrobexxx last edited this post 14 years, 4 months ago.]
      • 22019
      • 390 Posts
      Your talking about a navigation system rather than a resource listing - use Wayfinder.

      Or, if you must use getResources, you can put the conditional output on id. Something like (untested):

      [[*id:is=`99`:then=`[[!getResources? &parents=`99`  &tpl=`myRowTpl`]]`:else=`[[!getResources? &parents=`[[*id]]`  &tpl=`myRowTpl`]]`]]
        Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86