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.

Display only if there are entries...

January 09, 2008 6:57pm

Subscribe [2]
  • #1 / Jan 09, 2008 6:57pm

    asozzi

    262 posts

    This is more a question of aesthetics

    I’m trying to display a list (UL) of entries while on a category home page, but only if there are entries.
    Is there a way with less conditionals?
    See the “working but ugly” code:

    <div id="SecondaryContent">
        {exp:weblog:entries weblog="{embed:channel}" status="not home|Cat_Description"  sort="asc"}
        {if count<2}
            <div class="widget">             
                <h3>Also in this category</h3>
    <p>            <div class="borders"><br />
                    <ul><br />
        {/if}<br />
                        <li><a href="http://{title_permalink=">{title}</a></li><br />
        {if count=={total_results}}<br />
                    </ul><br />
                </div><br />
            </div><br />
        {/if}<br />
        {/exp:weblog:entries}    <br />
    </div><!-- End SecondaryContent -->

    Where the conditionals are all there so the DIV’s don’t get repeated for each entry.

  • #2 / Jan 27, 2008 6:19pm

    giovanni

    209 posts

    will this work?
    { .... show_empty=“no” style=“nested” ...

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

ExpressionEngine News!

#eecms, #events, #releases