I have been offline for quite a few weeks, first busy with other things and then in hospital (but am OK now), so have rather dropped the ball on developing my employer's new website using CMS for the first time.
I have today been picking up where I left off from with sorting out our news display. We have a separate news index page (for which I have created a custom summarytemplate) that displays the news item title, its post date and a summary of the first 600 characters (which I may increase) from the content. This is the summarytemplate:
Code: Select all
<!-- Start News Display Template -->
{foreach from=$items item=entry}
<h2>{$entry->titlelink}</h2>
<span class="news_index_content_date">{$entry->formatpostdate}</span>
{$entry->content|truncate:600}
{/foreach}
<!-- End News Display Template -->
Code: Select all
{$entry->content|truncate:600}
Whilst I know I could manually copy and paste the text I want to use into the Summary field in the editor for the news story, ideally, I don't want to have to do that every time as (a) it takes longer and (b) this task will be carried out by an end user for whom it would be more difficult.
So, is there a way of stripping out an image and any HTML tags (such as ) from the
Code: Select all
{$entry->content|truncate:600}
As ever, thanks in advance for anyone who can help with this.