Sunday, January 16, 2011

MODx 2 Adding ... to intro text summary

If you plan to add "..." to a intro text or content which is more than some # of characters,
you may use if condition within the chunk.

Example below will add ... to intro text:
[[+introtext:if=`[[+introtext:len]]`:gt=`200`:then=`[[+introtext:limit=`200`]] ...`:else=`[[+introtext]]`]]

2 comments:

shaun said...

All of this can be done easier with:

[[+introtext:ellipsis=`200`]]

James said...

right!
i forgot about that! thanks shaun :D