We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37437
    • 147 Posts
    Building a site in Revolution with a two-column layout. The content in the left column will need to change depending on the site page being viewed. All of the content in the left column is currently set up via chunks. I would like to avoid having to create multiple templates in order to display the appropriate chunk content in the left column. My guess is that I can achieve this with Output Filters. Namely -- set up a filter that commands something like: If the current page ID is '1', display chunks '1' and '2'; If the current page ID is '2', display chunks '3' and '4', etc. etc.

    Is this the correct strategy, and if so, can anyone show me what the syntax might look like for a filter of this type?

    Thanks much.
    • This is really what Template Variables are for. Output filters cause all of the tags in the decisions to be parsed, regardless if they are used or not.
      • Your thinking is on the right track, but my issue with using output filters for this type of operation is that there's no equivalent to "elseif," so you can't easily write the equivalent of a PHP switch statement.

        A few thoughts:


        • Use a snippet in place of the chunks with an actual switch statement in it, possibly passing in the chunk names in the $scriptProperties
        • If all you're doing is checking against resource ID, write multiple output filters.
        • Use a TV and make it a manual part of the page setup process. Set your chunk names as TV values in a dropdown list, and choose the correct one on each page.

        Does that help at all?
          • 37437
          • 147 Posts
          Thanks for the advice gentlemen. Turns out that I was trying to reinvent the wheel. I followed opengeek's advice and just created a number of TVs without default content. I plugged the TVs into my main template and now, of course, I can simply add unique content as needed on any of the pages that are driven by the main template.

          I would actually also like to be in a position to code a snippet that accomplishes what I initially described, but unfortunately, I am just not sufficiently skilled with snippet coding to do this. Anyway, at least I was able to resolve the issue through a conventional TV implementation.