Hey all – just a quick (and most likely) a very simple answer to this one, but is there an easy way to code conditional statements within templates/chunks to include or exclude other chunks based on a document information such as ID?
I have kludged this temporarily by using a TV, but ideally it should be a condition within the template code as opposed to an option for every page as it is created. The code itself is a chunk with a Wayfinder call displaying all immediate child documents of the current document, except I do not want it to be included on the root document (ID#1...so, "IF NOT(ID==1)") as this would just duplicate the “main menu” entries. This should by it’s nature be simple? I would normally use the search facility or RTFM, but answers don’t appear to be forthcoming when searching for “if” ;-)
you can have a radio-option-TV for example with input-option-values:
show submenu=={{submenu}}||hide submenu=={{nothing}}
and default-value:
so you have only to check the ’hide submenu’ option, where you don_t want to show this chunk.
Alternativ you can install phx-plugin and use it like that:
[*id:is=`1`:then=`{{submenu}}`*]