We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16815
    • 49 Posts
    This is just a small performance question.

    I have a bunch of TV’s in one of my template, but not every TV has to be filled. So in my template I have used the IF snippet to show the TV if it has a value, or else show nothing.

    [[!If?
    &subject=`[[+tv]]`
    &operator=`!=`
    &then=`<Output something here>`
    &else=``
    ]]

    And this works great. But then I noticed you can do the same with the :notempty output filter.

    [[+tv:notempty=`
    <Output something here>
    `]]

    So my question is, which one is the most efficient?
      • 4172
      • 5,888 Posts
      couldn’t notice any performance-differences yet.
      Maybe the snippet is more robust than the output-filter, when you have large output and/or a lot of nested conditions, but I’m not sure.

      [Edit]
      Made a short test.
      The snippet is more robust with large output.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!