I’d like to know if this is possible also...
Nesting If calls will slow down your site, and is generally not a good practice. Better is to use a custom snippet, as Lucas suggested.
shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect |
github |
splittingred.com
I'm always wondering why people so eagerly avoid to have more than one template. Concerning performance, isn't it much better than using so many modifiers?
Also, if you have to add a new resource, you would just have to assign the suiting template instead of going into the code and fiddling around with the id values for the modifiers...
Yep I know what your saying but I suppose it can avoid confusion for some non IT savvy clients when they are adding content when there is only 1 template involved. Good to know how to use output modifiers anyway sure. If anyone knows a good snippet to handle else if conditional for IDs as above please let me know. Thanks
you can put this into a dropdown-TV 'pagetype' as input-options:
newslisting||bloglisting||contact||textContent
and put this into your template:
[[!include?&file=`assets/templates/inc/[[*pagetype]].php]]`]]
then you can switch from page to page.