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.

Shortening Titles For Display

September 14, 2011 9:33pm

Subscribe [3]
  • #1 / Sep 14, 2011 9:33pm

    Dazeone

    6 posts

    Is there a built in (or easy) method of shortening the length of a title when it is displayed in a template (ie. if the title becomes too long and wants to text wrap). Perhaps even add a “...” to titles that are too long to display properly?

    ie.

    {exp:channel:entries channel="articles" limit="15" dynamic="no" orderby="date" } 
       <div class="sidebar-item">
          <h5>{title}</h5><p>      <!-- to a maximum of say 50 characters --><br />
          <i>{categories}{category_name}{/categories}</i></p>
    
    <p>      <a href="/{channel_name}/view/{url_title}">View Ad</a><br />
       </div><br />
    {/exp:channel:entries}

  • #2 / Sep 15, 2011 10:17am

    Sean C. Smith

    3818 posts

    There are two really great plugins for this - Trunchtml and my new go to plugin because it will also strip all html, but allow you to keep certain tags if you so wish Hacksaw

  • #3 / Sep 16, 2011 7:06pm

    John St-Amand

    865 posts

    Snippet is a good one that i have used for this too.

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

ExpressionEngine News!

#eecms, #events, #releases