Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
I'm trying to put a Read more link after I show the excerptHTML that shows the first 75 characters of my blog entry. However, it always creates a closed <p> tag for the content and puts the <a> link on a new line. Is there anyway to put the link before the </p> tag? Right now I tried this:

Code: Select all
<cms:excerptHTML trail='&hellip;<a class="more-link" href="<cms:show k_page_link />"></a>' count='20'><cms:show blog_content /></cms:excerptHTML>


But obviously it just turns up a <cms> tag instead of the page link. Any suggestions?
I managed to get it to work. I was using the wrong quotes. Hope this helps whoever might run into this problem down the road.

Code: Select all
<cms:excerptHTML trail="&hellip;<a class='more-link' href='<cms:show k_page_link />'></a>" count='20'><cms:show blog_content /></cms:excerptHTML>
Thank you for sharing this.

The key point here is that if a parameter of a Couch tag contains another Couch tag (in your case the 'trail' parameter of 'excerprtHTML' tag contains another Couch tag - namely 'show'), the parameter needs to be enclosed with double-quotes.

The double-quotes is a signal to Couch that it needs to treat the parameter as executable code. A parameter enclosed with single-quotes, on the other hand, is treated by Couch as simple literal string and outputted as-is.

A detailed discussion about this can be found at http://www.couchcms.com/docs/concepts/s ... eters.html.
3 posts Page 1 of 1

Who is online

In total there are 16 users online :: 0 registered, 0 hidden and 16 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 16 guests