We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2214
    • 33 Posts
    My client has a portfolio listing, where they want to show all projects (children) in a category (to display certain metadata that I am going to grab from TVs), but only link to select projects that have a gallery within them.

    I am trying to do it like so:
    [!Ditto? &startId=`38` &tpl=`dittoPortfolio` &orderBy=`pagetitle ASC` &phx=`1`!]


    and the contents of dittoPortfolio:
     <tr>
            <td>[+phx :if=`[+portfolioActive+]` :is=`0` :then=`<a href="[~[+id+]~]">[+description+]</a>` :else=`[+description+]`+]</td>
            <td>[+phx :if=`[+portfolioActive+]` :is=`0` :then=`<a class="view_project" href="[~[+id+]~]">View Project</a>` :else=` `+]</td>
            <td>[+portfolioLocation+]</td>
            <td>[+portfolioDate+]</td>
            <td>[+portfolioProgress+]</td>
    </tr>
    
    


    I am not getting any results for the PHx parse.

    edit: I was not understanding how the PHx parser in Ditto worked. The correct syntax is:
     <tr>
            <td>[+portfolioActive:is=`0`:then=`<a href="[+~id~+]">[+description+]</a>`:else=`[+description+]`+]</td>
            <td>[+portfolioActive:is=`0`:then=`<a class="view_project" href="[+~id~+]">View Project</a>`:else=` `+]</td>
            <td>[+portfolioLocation+]</td>
            <td>[+portfolioDate+]</td>
            <td>[+portfolioProgress+]</td>
    </tr>
    

      • 1122
      • 209 Posts
      Yes, but also correct your links to this:
      <a href="[~[+id+]~]">
      
        • 2214
        • 33 Posts
        Yes, thanks for noticing that.