We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18463
    • 121 Posts
    Martijn van Turnhout Reply #1, 16 years, 4 months ago
    Hi,

    I got a couple of question about the usage of PHX with Ditto.

    I’m building a website for a construction company right now. This company has about four different services and a few regular pages like Contact and Jobs. Each service contains different finished projects. I show these projects on each service page with a Ditto call.

    However, on the right side of the page, I want to show just 1 project. The last finished project. If the visitor is on a service page containing different projects, the last finished project will be a project of that service. But if the visitor is on a regular page, like Contact or Jobs, I’d like to show the last finished project of all 4 services on that page, ordered by "createdon DESC".

    Now, my approach is this:

    [+phx:if=`[*parent*]`:is=`2`:or:is=`3`:or:is=`4`:or:is=`5`:then=`[!Ditto? &parents=`[[UltimateParent?]]` &display=`1` &id="ditto_cta_project" &tpl=`cta_project_details`!]`:else=`[!Ditto? &parents=`2,3,4,5` &display=`1` &id="ditto_cta_project" &tpl=`cta_project_details`!]`+]

    Am I right in using this kind of PHX setup?

    Thanks in advance for all your help!