I'm trying to output certain meta description depending on resource ID and parent ID using ModX Revo.
The problem is that Modx filters only can operate
only one special tag (or id, or parent id, or something else), for ex.
[[*id:is=`331`:then=`<meta name="description" content="[[*description]] — Page [[+page]]" />`:else=`<meta name="description" content="[[*description]]" />`]]
In this case tag is
ID. In my situation I need to add to this condition one more statement, it must work like:
- if [[*id]] is 331 then...
- else if [[*parent]] is 321 then..
- else...
How can I do this without creating templates or chunks?
I tried some variants:
This just doesn't work
[[*id:is=`331`:then=`<meta name="description" content="[[*description]] — Page [[+page]]" />`:else=`[[*parent:is=`321`:then=`<meta name="description" content="[[*description]] - News Page" />`:else=`<meta name="description" content="[[*description]]" />`]]]]
OR
This on the 331st resource outputs two descriptions
[[*id:is=`331`:then=`<meta name="description" content="[[*description]] — Page [[+page]]" />`:else=``]]
[[*parent:is=`321`:then=`<meta name="description" content="[[*description]] - News Page" />`:else=`<meta name="description" content="[[*description]]" />`]]