ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

If no comments - how to prevent comment mark-up from writing to document???

August 29, 2007 4:36pm

Subscribe [2]
  • #1 / Aug 29, 2007 4:36pm

    hothousegraphix

    851 posts

    I’m curious how other achieve deal with this situation.

    If no comments exists, how, if the comment tag does not support the {if:else} conditional, can I prevent the mark-up intended for when comments exist from writing to my page?

    {exp:comment:entries sort="asc"}
        {if no_results}
            No comments yet, be the first to write one!
        {/if}
        //The div below writes to my document even if no_results exist 
        //leaving me with incomplete information and causing validation errors
        <div class="comment {switch="even|odd"}">
            {url_as_author} wrote on {comment_date format="%F %d<sup>%S</sup>, %Y @ %G:%i"}
            {comment}
        </div>
    {/exp:comment:entries}
  • #2 / Aug 29, 2007 4:37pm

    Lisa Wess

    20502 posts

    How about using {if count > 0?

  • #3 / Aug 29, 2007 5:08pm

    hothousegraphix

    851 posts

    thanks!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases