Hello,
I am wanting to use Ditto to display the first 3 paragraphs of news items on a site I am building but am not sure how to limit it to paragraphs only.
I see in the documentation it talks about truncating - the code below shows truncating to 400 characters - but this cuts words off mid sentence.
Is there a way to limit the [+summary+] to the first 3 paragraphs? Either that, or to stop the words from being cut off during the summary and and add ’...’ at the end of the last word?
My Ditto Call is as follows:
[[Ditto? &startID=`49` &parents=`49` &truncLen=`400` &tpl=`intranet-news` &tplFirst=`intranet-news-first` &paginate=`1` &extenders=`summary,dateFilter` &paginateAlwaysShowLinks=`1` &orderBy=`createdon DESC` &tagData=`summary`]]
My template is as follows:
<div class="news">
<h2><a href="[~[+id+]~]" title="[+longtitle+]">[+title+]</a></h2>
<p>[*newsDate*]</p>
[+summary+]
<a href="[~[+id+]~]" title="Read the whole story" class="more">More...</a></p>
</p>
</div>
Also I have created a TV called newsDate which is the date of the news release (not the date created):
a. is it possible to sort the news items by the newsDate TV? and;
b. how do I display it in the ditto summary - at the moment no date is included because I guess it is a TV from another page?
Thanks so much in advance - I really, really appreciate it.