Forum for discussing general topics related to Couch.
2 posts Page 1 of 1
Hi All!

I'm trying to get my "exerptHTML" code to leave a trail ("...") at the end of the excerpt, but I can't seem to get this to work. The code I am currently using is below, which correctly excerpts the content, but attatches nothing at the end:

Code: Select all
<cms:excerptHTML count='400'><cms:show blog_content /></cms:excerptHTML>


The code below is the code given by the CouchCMS documentation. Even when I copy/paste that code directly, what gets printed is "read more..)" without a working link. I ahve tried many various combinations of both the code above and below, but I just cannot get the code to work properly.

Code: Select all
<cms:excerptHTML trail="&nbsp;(<a href=\"<cms:show k_page_link />\">read more..</a>)"><cms:show blog_content /></cms:excerptHTML>


The desired output is below, with the ellipses colored red.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse consequat magna nulla, quis interdum nunc maximus...
Hi leslobsters,

The cms:excerptHTML tag, by default, automatically appends three ellipses after the truncated contents. So the following should be sufficient to show the ellipses -
Code: Select all
<cms:excerptHTML count='400'><cms:show blog_content /></cms:excerptHTML>

If you wish to use anything other than the default '...', you can use the 'trail' parameter.
Code: Select all
<cms:excerptHTML count='400' trail='---'><cms:show blog_content /></cms:excerptHTML>

That said, the crux is that the ellipses (or whatever trail you have set) will be shown only if the contents are truncated.
In your code you have set the count to '400' words (a sizable amount) so the the ellipses will be shown only if the contents exceed 400 words and have to be truncated.

Perhaps the content you are experimenting is not more than 400 words in length and so you don't get to see the trail marker.

I suggest you try using a smaller count (e.g. '50') just for checking out things.
I'm sure it'll work.

Hope it works.
2 posts Page 1 of 1