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.

backspace not working as I thought

October 16, 2012 3:44pm

Subscribe [3]
  • #1 / Oct 16, 2012 3:44pm

    clintonbeattie

    43 posts

    I have this piece of code…

    {if segment_3 == "maddybenny"}
       {exp:channel:entries channel="news" dynamic="off" category="6"}
       <div class="news-item">
                 <h2><a href="http://{path=news}/article/{url_title}">{title}</a></h2>
    <p>             <span class="news-date">{entry_date format="%d %F %Y"}</span> <br />
                     <span class="tagged"><br />
                         {categories backspace="2"}<br />
                             <a href="/news/category/{category_url_title}">{category_name}</a>,<br />
                         {/categories}<br />
                     </span><br />
                  <br />
                 {news_intro}<br />
                 <a href="http://{path=news}/article/{url_title}" class="read-more">Read More</a><br />
             </div><br />
             {/exp:channel:entries}<br />
      {/if}

    What I need is for the comma to be removed from the last item in categories that are output. I can’t seem to make this work. Maybe backspace is the wrong way of doing this?

    Any help most welcome.

  • #2 / Nov 24, 2012 3:06am

    Crnaovca

    627 posts

    http://ellislab.com/expressionengine/user-guide/modules/channel/categories.html#id5

    try to add style=“linear” also to categories tag. What do you get as result of that tag? maybe you have empty space so 2 characters removed is not helping?

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

ExpressionEngine News!

#eecms, #events, #releases