#1 2013-09-05 10:25:19

salgua
Member
From: Italy
Registered: 2013-04-11
Posts: 60

truncate ion:content

Hi,

often we have a page view for the article list and another page view to display the content of a single article.
In the article list view we have to truncate the content of the article, to display only an intro text.
There are a couple of way to do it:

1. using <ion:content paragraph="1" /> we can display only the first paragraph, but the problem is that I cannot know how long is the first paragraph
2. using <ion:content words="30" /> in this case we have more control about the content length (first 30 words)

the problem using the second approach is that it doesn't close the HTML tags (P, DIV, SPAN etc.) and this can be very dangerous. Maybe should be a good idea introduce a special tag to use in the content field. It should be something like <intro></intro> and I can put the intro text in this. Taking the Joomla approach, they use

<hr id="system-readmore" />

to indicate to Joomla where is the end of intro text. I think that this should be a simple but very useful feature to add to ionize. What do you think?

Last edited by salgua (2013-09-05 10:26:47)

Offline

What's Ionize ?

Ionize is an Open Source Content Management System created by webdesigners for webdesigners.

Created and maintained by Partikule and Toopixel, Ionize wants to be the easiest and most powerful CMS.

Can I help ?

Because talent is nothing without involvement, we are looking for motivated coders and webdesigners to join the project team.

Resources

Website : ionizecms.com
Documentation : doc.ionizecms.com

Development : Ionize on GitHub
Translations : Ionize Translations