Hi all,
I have been using PHx mainly because of the if-then-else feature which definitely helps when you need more flexible templates, and you don’t want to keep adding small snippets all the time.
Here is the catch, when PHx parser is enable the constructs
{{[*myVariable*].myChunk}} is not evaluated correctly.
The above syntax can be very useful if you want to include a different Chunk (or snippet) depending on the value of a variable. Why this is not working when PHx is enabled?
The problem, in my opinion, is located in the ParseValues function of the PHx parser ...
chunks and snippets are executed *before* PHx/TV parsing.
By reverting the order of parsing from Chunks -> Snippets -> PHx modifiers&TVs to PHx modifiers&TVs ->Chunks -> Snippets, the above syntax is correctly parsed by PHx, and you get all the extra advantages of this light weight parser (if-then-else, strings modifiers, etc)
I hope this can be of any interest to anyone using PHx. I haven’t done an in-depth testing, but it seems to work fine.
Cheers. Natalino
I see this is a pretty old topic, but.... I’m having the same problem (I think) and don’t quite understand the solution explained here.
I have a call along the lines of {{[*whichPerson*]_box}} which I was hoping would return a chunk such as {{Anna_box}}, but since installing PHx this isn’t the case.
According to the above post the solution would be "reverting the order of parsing", which I don’t quite understand. How would this be done?