We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24629
    • 370 Posts
    Hi i’m trying to make a custom filter. But making a snippet and prefixing it with phx:MySnippet doesn’t work anymore.
    So, i was trying to make a filter that will check if the description is empty or not. if not empty write the proper div around it

    [[description:intro]]

    and in the snippet ’phx:intro’

    <?php
    if(strlen($output)>0){
       $newValue = "<div class='intro'>". $output ."</div";
    }else{
       $newValue = '';
    }
    return $newValue


    how can i do this now?

    Tnx
      • 31902
      • 342 Posts
      Hoping I understand you correctly, what I would try is to first download the If snippet. Then call it with something like:

      [[!If? &subject=`[[*yourTVorDescriptionOrWhatever]]` &operator=`empty` &then=`` &else=`<div id="whateverDIVname">[[*yourTVorWhatever]]</div>`]]


      Hope it helps.