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.

Using conditionals on the entry number

February 18, 2011 1:42am

Subscribe [1]
  • #1 / Feb 18, 2011 1:42am

    rorourke

    113 posts

    I have a table. Like so:

    
    
    

    It’s just handling some logos they want to post. As can be seen here: http://cwretail.com/about/clients/ Works fine, as long as they only have 5 or so. As the code is setup now they will all, always, be on the same line.

    I only want 5 entries per row, but I’m not sure how I might set this up because if I put the <tr>‘s inside the channel tag, to perform logic against them, every logo will be on it’s own line. Seems like I’m just brain farting, but I could really use any ideas.

  • #2 / Feb 18, 2011 2:14am

    Cheif

    626 posts

    Add a limit

    {exp:channel:entries channel="logos" orderby="random" limit="5"}

    re:read - bad post :(


    Use Matrix -http://pixelandtonic.com/matrix you’ll then be able to handle the count
    OR MAYBE

    {if count == 6}
     !<-- start a new row -->
    {/if}

    OR use CSS

  • #3 / Feb 18, 2011 3:39am

    rorourke

    113 posts

    Thanks Cheif,

    I’m aware of using count, but the problem remains that I want the <tr> to wrap the first 5 entries, then close, then start a new wrap from 6 -11. So I guess my question is, given my code, how might I creatively employ a conditional on count to achieve my ends.

    Not sure how one would use CSS for this. Other than floating all the logos and clearing after the desired count, but this doesn’t really give it the tabular feel the design will eventually call for. Want to keep it in the table.

    Thanks!

  • #4 / Feb 18, 2011 3:54am

    Ingmar

    29245 posts

    ... the problem remains that I want the <tr> to wrap the first 5 entries, then close, then start a new wrap from 6 -11.

    So?

    ...
    <tr>
    {exp:channel:entries}
       ...
       {if count == "5"}
    </tr><tr>
       {/if}
    {/exp:channel:entries}
    </tr>
    ...

    Moving to the CSC.

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

ExpressionEngine News!

#eecms, #events, #releases