We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5811
    • 1,717 Posts
    I understand that conditional operators(if,else,is,then ...) don’t exist with output filters.

    So what are the advices to implement a template like below, with the output filter ?
    [+as.noResults:is=`1`:then=`
      <div class="[+as.noResultClass+]">
        [+as.noResultText+]
      </div>
    `:else=`
    <p class="ajaxSearch_resultsInfo">[+as.resultInfoText+]</p>
      [+as.listGrpResults+]
    `+]
    [+as.showCmt:is=`1`:then=`
    [+as.comment+]
    `+] 


    Is there somewhere for Revo an equivalent of the Phx parser class used with Ditto or Jot ?

      • 17499 ☆ A M B ☆
      • 872 Posts
      They do exist but are not (yet?) referenced in the documentation.

      You can find them in core/model/modx/filters/modoutputfilter.class.php
        • 5811
        • 1,717 Posts
        Thanks. I haven’t still take the reflex to search into the class of the core/model/modx.

        These conditional operators are not referenced in the documentation.

        So with Revo, my previous template becomes:
        [[+as.noResults:is=`1`:then=`
          <div class="[[+as.noResultClass]]">
            [[+as.noResultText]]
          </div>
        `:else=`
        <p class="ajaxSearch_resultsInfo">[[+as.resultInfoText]]</p>
          [[+as.listGrpResults]]
        `]]
        [[+as.showCmt:is=`1`:then=`
        [[+as.comment]]
        `]]
        is it correct ?
          • 17499 ☆ A M B ☆
          • 872 Posts
          Seems good to me.