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.

How to add code to pattern - Solved

May 28, 2008 12:43pm

Subscribe [3]
  • #1 / May 28, 2008 12:43pm

    rumsey

    12 posts

    I’m using a pattern to display a page of titles, links and thumbnails (an aggregator page if you will) and this pattern uses 3 columns per row, which one entry per column.  Between each row, I’d like to insert some additional spacing using CSS.

    My code is as follows

    {exp:weblog:entries weblog="supplemental" orderby="date" sort="desc" limit="15" dynamic="off" disable="pagination|categories|member_data|trackbacks"}
    
    <div class="{switch="column first|column|column last"}">
    
    <h3><a href="http://{supplemental_location}">{supplemental_icon}</a><a href="http://{supplemental_location}">{title}</a></h3>
    
    <p><div class="blurb">                </p>
    
    <p>{date_heading}<br />
    {entry_date format=' %Y-%m-%d '}:<br />
    {/date_heading}</p>
    
    <p>{if supplemental_desc}<br />
    {exp:word_limit_plus if_exceeds="30" stop_after="28"}<br />
    {supplemental_desc}<br />
    {/exp:word_limit_plus}<br />
    {/if}<br />
    <a href="http://{supplemental_location}">Read more.</a></p>
    
    <p></div></p>
    
    <p></div></p>
    
    <p>{/exp:weblog:entries}

    What I’d like to have is version which adds some additional CSS after the 3rd, the 6th, the 9th, the 12th…entries, basically the third entry in each row.  Is there a way to ask EE to insert this code after certain entries?

    Much thanks.

  • #2 / May 28, 2008 1:00pm

    ImpGabe

    171 posts

    Can you just add the extended style to the column last class? For instance just add the extra padding/margin/background-image, etc…

  • #3 / May 28, 2008 1:09pm

    rumsey

    12 posts

    Unfortunately, I’m using system wide CSS libraries and had to stick to a strict format.  This format includes a pattern which repeats every third entry.  😊

  • #4 / May 28, 2008 1:21pm

    rumsey

    12 posts

    Solved!  Sort of…

    I’m using the switch tag to insert divs at the beginning of each row, then closing the divs at the end of each row.  It’s not the best work-a-round, but it works none the less.

  • #5 / Jul 05, 2009 4:39pm

    xotox

    109 posts

    rumsey,
    what you have write on column first|column|column last
    to make it works

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

ExpressionEngine News!

#eecms, #events, #releases