We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38047
    • 32 Posts
    Revolution 2.2.1pl

    Could anyone help me out with this to save me searching endlessly for the syntax please?

    This is my specifications table chunk i want to output containing my tv's

    <table class="specs">
      <tr><th>Stock Number</th><td>[[*stockno]]</td></tr>
      <tr><th>Make</th><td>[[*make]]</td></tr>
      <tr><th>Model</th><td>[[*model]]</td></tr>
      <tr><th>Body</th><td>[[*body]]</td></tr>
      <tr><th>Engine Size</th><td>[[*enginesize]]</td></tr>
      <tr><th>Transmission</th><td>[[*transmission]]</td></tr>
      <tr><th>Seats</th><td>[[*seats]]</td></tr>
      <tr><th>Drive</th><td>[[*drive]]</td></tr>
      <tr><th>Year</th><td>[[*year]]</td></tr>
      <tr><th>Kms</th><td>[[*kms]]</td></tr>  
      <tr><th>Car License</th><td>[[*carlicense]]</td></tr>
      <tr><th>Price</th><td>[[*price]]</td></tr>
    </table>
    


    I only want the table rows to be displayed if the TV is not empty. I would have used PHx in Evolution but I'm stumped now and cannot find any examples of how to go about it, any ideas?

    Thanks in advance.

    Phil
      • 33968
      • 863 Posts
      This should do it:
      [[*stockno:!empty=`<tr><th>Stock Number</th><td>[[*stockno]]</td></tr>`]]
      

      More on output filters here:
      http://rtfm.modx.com/display/revolution20/Input+and+Output+Filters+(Output+Modifiers)
        • 38047
        • 32 Posts
        Marvellous Lucas, That looks like it should work, I'll let you know, thanks
          • 38047
          • 32 Posts
          Thank you Lucas that worked great, cheers smiley))