Quote from: hotdiggity at May 08, 2010, 05:42 AM
phx should do the trick, so, if you have it installed, in your Ditto template chunk try putting something like this:
[+phx:if=`[+optionTV+]`:is=`announcement`:then=`{{announceChunkTpl}}`:if=`[+optionTV+]`:is=`blog`:then=`{{blogChunkTpl}}`:if=`[+optionTV+]`:is=`news`:then=`{{newsChunkTpl}}`+]
I have installed PHx 2.1.3 and running Modx evo 1.0.3
My structure is as following:
[_]Frontpage
[_]Blog (id=35)
-post1
-post2
-post3
On my frontpage i have a ditto snippet call:
[!Ditto? &parents=`35` &paginate=`1` &tpl=`blogTpl` &dateSource=`pub_date` &orderBy=`pub_date DESC` &display=`5` &language=`danish` &dateFormat=`%d/%m/%Y` !]
My TV for choosing post type is called: "postType" and is a DropDown list menu with these input values:
Nyhed==Nyhed||Annoncering==Annoncering||Artikel==Artikel
so the PHx call needs to be something like this right:
[+phx:if=`[+postType+]`:is=`Annoncering`:then=`{{blogNyhed}}`:if=`[+postType+]`:is=`Nyhed`:then=`{{blogNyhed}}`:if=`[+postType+]`:is=`Artikel`:then=`{{blogArtikel}}`+]
(Annoncering and Nyhed uses same tpl)
but where do i place PHx call exactly? in "blogTpl" chunk and then make these two ditto tpl chunks {{blogNyhed}} {{blogArtikel}} - that dosent seem to work for me =)