Hey guys,
My PHx skills have been really improving lately, I’ve started to see some really powerful uses for it.
I’ve been organising my templates in a certain way and I’ve found it useful to merge what would be three similar templates into one.
This is the (somewhat complex) PHx call I’ve made, but I reckon there must be a simpler version that I just haven’t figured out yet?
{{template.header}}
[+phx:if=`[*content*]`:ne=``:then=`
<h1>[*longtitle*]</h1>
[*content:is=`Store`:then=`
[*introtext*]
Store Main Page
`:else=`
Store Tags Landing Page
`*]
`:else=`
Product Page
`+]
{{template.footer}}
Anybody got any ideas?
I also wanted to add a fourth template to this for the Checkout Page, but I don’t really want to add another PHx call within this and then the logic of it becomes very complex...
MODX Ambassador for Thailand. Managing Director at
Monogon, a web design and development studio based in Bangkok, Thailand. -
Follow me on Twitter.