Quote from: BobRay at Jul 08, 2013, 10:35 PMShawn's approach will be much faster. The problem with your original code is that the entire content of the page will be parsed twice, for no reason.
BTW, I would do it with a snippet snippet:
So would I Bob. I just wanted to keep it within what the original poster was doing.
Sottwell,
The dirty trick would be to create a chunk which is sent the id of the page and then spit out a return based on the number.
The chunk would be called cached, thereby only hitting the system with multiple filter tests when the cache does not have the current page.
The content of the chunk would be unchached....
I so love MODX. SO many ways to do something.
Sotwell probably had the best solution of all - create multiple templates and walk away. You can share the header and footer via a chunk...