We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28436
    • 242 Posts
    Hello Guys,

    i want to fill a mulit-select templateVar with the pagtitles of nested documents down a certain ID.

    for example
    Folder (ulatimatParent ID=10)
    - doc 1
    - doc 2 
      
      |- Folder
        |- doc 3
        |- doc 4
      
      |- Folder 
        |- doc 5
        |- doc 6
          
          |- Folder
            |- doc 7
            |- doc 8
    - doc 9
    - doc 10


    From this tree i want the downline as elements in an multi select Templaevar.

    How to do it?

    Thanks for every hint.

    ciao, Stefan

      • 29181
      • 480 Posts
      I think the easiest way would be to use a snippet that integrates Wayfinder.
      Then use a template that creates a list, maybe like this:

      [+wf.title+]==[+wf.link+]||


      Then return the results to your TV, with something along the lines of
      @EVAL return $modx->runSnippet('getIDs',array('startId'=>'10'));


      in the "Input Option Values" of your TV.

      I’ve never done this, but I can’t really see why it wouldn’t work. An alternative maybe to use

      http://modxcms.com/getdocumentchildren.html

      in your snippet as opposed to wayfinder. Hope these ideas are of use to you.

      Taff
        Adrian Lawley: www.adrianlawley.com
        • 28436
        • 242 Posts
        Hello Taff,

        thank you for your hints and suggestions. I will try it and post my results here

        so long.
        Stefan
          • 28436
          • 242 Posts
          Servus taff,

          Thank you, i did it with a snippet and it work well, but the snippet looks ugly, so i wont post it here.

          machs gut, Stefan