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

    I have been looking at the if addon (http://rtfm.modx.com/display/ADDON/If) to see if it could help in the following scenario:

    I have a chunk for the 'left-sidebar' that contains a secondary menu on all pages. Rather than create another sidebar i would like to use just one but on my news page i would like to show the archives above the secondary menu. The archives will be unique to the news template only and i was wondering whether the if addon culd be used to say something like - "If using template #3 then display [[archives]] else [[don't display archives]].

    It sounds simple but i need some guidance if anyone can help.

    Thanks

    J [ed. note: 9thwave last edited this post 12 years, 8 months ago.]
      www.9thwave.co.uk
         WEB | DESIGN | PRINT
      • 33968
      • 863 Posts
      Something like this:
      [[If? &subject=`[[*template]]` &operator=`is` &operand=`3` &then=`[[$newsArchive]]`]]
      

      Actually you don't even need If, you can use an output filter:
      [[*template:is=`3`:then=`[[$newsArchive]]`]]
      
        • 36549
        • 572 Posts
        Now that is brilliant.

        I'm reading up on output and input filters now...didn't know they existed but they will come in very handy.

        Thanks for the quick response.
          www.9thwave.co.uk
             WEB | DESIGN | PRINT