We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32038
    • 26 Posts
    I have the following code that I want to place into one chunk

    [+phx:if=`[*wc-location*]`:is=`Top`:then=`{{wildcards-4-across}}`+]
    


    AND

    [+phx:if=`[*wc-location*]`:is=`Bottom`:then=`{{wildcards-4-across}}`+]
    


    where the only difference between the two is the value being compared to - Top v Bottom.

    I would like to have one chunk that I can call with my location to compare against instead of two chunks specific to location. Is this possible or am I headed down the wrong path and should re-route so to speak. I’m sure it’s something simple I’m missing, just not sure what I’m looking for.

    Thanks,

    Craig
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      http://wiki.modxcms.com/index.php/PHx#or

      Previous OR next statement

      [+phx:if=`[*id*]`:is=`2`:or:is=`3`:then=`{ {Chunk} }`:else=`{ {OtherChunk} }`+]
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 32038
        • 26 Posts
        Not exactly what I’m looking for.

        looking at using it like this...

        {{myChunk}} <!-- location is Top -->
        .
        .
        . Some more template stuff
        .
        .
        {{myChunk}} <!-- location is Bottom -->
        


        Top/Bottom are values in a TV where this chunck is expected to be for this page. {{myChunk}} will need to be aware where on the page it is located (Top or Bottom) to determine if it should output the {{wildcards-4-across}} chunk within the phx call.