We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • Quote from: mosbysrangers at Aug 23, 2013, 04:29 PM
    Hey here is what I did and it worked:

    [[*id:is=`28`:then=`[[Wayfinder? &startId=`27` &excludeDocs=`28,29,30,31,32,33,89,90,95,96,98`]]`]]

    [[*id:is=`29`:then=`[[Wayfinder? &startId=`27` &excludeDocs=`28,29,30,31,32,33,89,90,95,96,98,94,95,96,98,99,100`]]`]]

    STOP PLEASE!

    Ok what would happen if you did that is:
    1. Every single Wayfinder call in that chunk would be processed, regardless of whether the condition was met.
    2. The conditions would be evaluated.
    3. The output would be rendered for the condition(s) that are true.

    If you don't want to do what Susan suggested, you could do this:

    [[[[*id:is=`28`:then=`Wayfinder`:else=`-`]]? &startId=`27` &excludeDocs=`id,id,id....`]]
    


    THEN what would happen is:
    1. The condition, based on ID, would evaluate. If true, the string "Wayfinder" would be returned. If false, the string "-" would be returned.
    2. The resulting tag call (if true) would run the Wayfinder snippet.
    3. The resulting MODX comment tag (if false) would be skipped by the parser and cost nothing in processing.

    For more information on this method see this article by Jason Coward: http://modx.com/blog/2012/09/14/tags-as-the-result-or-how-conditionals-are-like-mosquitoes/
      [sepiariver.com] (https://sepiariver.com/)
      • 6629
      • 60 Posts
      Quote from: mosbysrangers at Aug 23, 2013, 04:29 PM
      Hey here is what I did and it worked:
      [[*id:is=`28`:then=`[[Wayfinder? &startId=`27` &excludeDocs=`28,29,30,31,32,33,89,90,95,96,98`]]`]]
      [[*id:is=`29`:then=`[[Wayfinder? &startId=`27` &excludeDocs=`28,29,30,31,32,33,89,90,95,96,98,94,95,96,98,99,100`]]`]]

      Welcome to usability hell =)

      A more logical and user friendly way to link products and specs can be achieved through a multi-select listbox-tv.

      First, create a listbox-tv and assign it to your product-template:
      Name: specList
      Type: Listbox (multi-select)
      Input Option Values: @SELECT `pagetitle`,`id` FROM `[[+PREFIX]]site_content` WHERE `parent` = ID_of_your_spec_container
      Output Type: Delimiter
      Delimiter: ,
      


      In your product-template insert the following Wayfinder-call:
      [[Wayfinder? &startId=`ID_of_your_spec_container` &includeDocs=`[[*specList]]`]]
      


      Et voilà - multi-selectable related docs for your products =)
        • 44877
        • 21 Posts
        Ok, I get what you guys are saying. I'll def try this today instead of what I have. Thank you.