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.

Removing last pipe in a pipe-separated list

September 25, 2007 12:41pm

Subscribe [2]
  • #1 / Sep 25, 2007 12:41pm

    jtnt

    137 posts

    So, I’ve got a listing page that lists things in a pipe-separated list. However, I can’t figure out a way to not have the last pipe show up.

    Here’s how it’s listing now:

    2007
    Q1 | Q2 | Q3 | Q4 |

    2006
    Q1 | Q2 | Q3 | Q4 |

    Here’s how I want it to list:

    2007
    Q1 | Q2 | Q3 | Q4

    2006
    Q1 | Q2 | Q3 | Q4

    Notice the lack of the pipe after “Q4”.


    Here’s the code:

    {exp:weblog:category_archive weblog="lp_docs" show_empty="no" style="linear" show="{embed:cats}" dynamic="off"}
    
    {categories}
    <h2>{category_name}</h2>
    
    <p>{exp:weblog:entries weblog="lp_docs" category="{category_id}" style="linear" orderby="entry_date" sort="desc" dynamic="off"}</p>
    
    <p>{date_heading display="yearly"}</p>
    
    <h3>{entry_date format="%Y"}</h3>
    
    <p><br />
    {/date_heading}</p>
    
    <p><a href="http://{lpe_file_1}">{title}</a> | <br />
        <br />
    {date_footer display="yearly"}    </p>
    
    <p>{/date_footer}</p>
    
    <p>{/exp:weblog:entries}</p>
    
    <p>{/categories}</p>
    
    <p>{/exp:weblog:category_archive}

  • #2 / Sep 25, 2007 12:53pm

    silenz

    1651 posts

    Have you already tried the backspace=”“-parameter in {categories}{/categories}?

  • #3 / Sep 25, 2007 1:29pm

    jtnt

    137 posts

    This won’t work for me, since the thing I would want to “backspace” is actually inside a weblog:entries tag.

  • #4 / Sep 25, 2007 5:02pm

    silenz

    1651 posts

    How about:

    <a href="http://{lpe_file_1}">{title}</a>
    {if count != absolute_count} |{/if}
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases