Hello,
EDIT: this was solved with a snippet for Wayfinder and phx for Ditto....
I am using MODx Evo (1.04) for an intranet site and am having trouble with PHx (2.14) syntax when 3 elements are involved.
The structure is hierachical so I need to use Wayfinder for the majority of the menus.
This site has 3 types of content that I need to include in menus etc:
- standard page
- pdf page ( represented by a TV called [+pdf+] )
- link page ( represented by a TV called [+link+] )
Its one or the other - if a pdf is included, a link cannot be - and vice versa.
I think what I am trying to say is
1 if [+pdf+] isnot empty, then [+pdf+] ...or...
2 if [+link+] isnot empty, then link [+link+] ...or...
3a if pdf is empty and if link is empty, then [+wf.link+]
vs
1 if [+pdf+] isnot empty, then [+pdf+] ...or...
2 if [+link+] isnot empty, then link [+link+] ...else...
3b standard page link (eg [+wf.link+])...
Demo 1 -
This:
<li><a href="
[+phx:if=`[+pdf+]`:isnot=``:then=`[+pdf+]`:else=``+]
[+phx:if=`[+link+]`:isnot=``:then=`[+link+]`:else=``+]
[+phx:if=`[+pdf+]`:is=``:and:if=`[+link+]`:is=``:then=`[+wf.link+]`+]
">[+wf.linktext+]</a></li>
Returns
pdf's and links but not standard pages (they return blank - href="" )
Demo 2 -
This:
<li><a href="
[+phx:if=`[+pdf+]`:isnot=``:or:if=`[+link+]`:isnot=``:then=`[+pdf+][+link+]`:else=`[+wf.link+]`+]
">[+wf.linktext+]</a></li>
Returns
pdf's and links but not standard pages (they return blank - href="" )
Demo 3 -
This:
<li><a href="
[+phx:if=`[+pdf+]`:isnot=``:then=`[+pdf+]`:else=``+]
[+phx:if=`[+link+]`:isnot=``:then=`[+link+]`:else=`[+wf.link+]`+]
">[+wf.linktext+]</a></li>
Returns
pdf's and links but not standard pages (they return blank - href="" )
Demo 4 -
This:
<li><a href="
[+phx:if=`[+pdf+]`:isnot=``:then=`[+pdf+]`:else=`
[+phx:if=`[+link+]`:isnot=``:then=`[+link+]`:else=`[+wf.link+]`+]
`+]
">[+wf.linktext+]</a></li>
Returns
pdf's and links but not standard pages (they return blank - href="" )
Aye aye aye...
I am going round in circles and just wondering if someone could talk some logic into me.
Any ideas?
Thanks in advance.