Hi there:
I am just getting started with modx (beyond the basics of applying my custom templates to [*content*]. I am trying to display a left-nav menu for all pages in my site except blogs articles. I want blog articles to use ditto to display the most recent in place of a left-nav.
I am more of an HTML/CSS person, not a PHP person, so if you could please tell me:
a) if this is the right way to go about it and;
b) why this doesn’t work.
ok:
I created a template variable called
leftnav which contains the following:
[+phx:if=`[[UltimateParent? &top=`2`]]`:is=`2`:then=`[[Ditto? &startID=`2` &summarize=`2` &total=`20` &commentschunk=`Comments` &tpl=`nl_sidebar` &showarch=`0` &truncLen=`100` &truncSplit=`0`]]`:else=` [!Wayfinder?startId=`[*id*]` &outerClass=`leftnav`!]`+]
And it works, sort of. If I am on my blog page (id=2) I get the ditto block displaying my blog posts (still the default ones from the install). If I’m on any of my content pages (not id=2 and not ultimateparent=2) I get my wayfinder menu. However, when I’m on my blog subpages (child pages of id=2) I don’t get anything. I’m assuming I’m using ultimateparent incorrectly, but I’m not sure why.
Any help would be most welcome.