Forum for discussing general topics related to Couch.
8 posts Page 1 of 1
I need to remove the p tags that richtext adds in so found the excerpt method that works using the following line

Code: Select all
<cms:excerpt count='218' truncate_chars='1'><cms:show welcometext/></cms:excerpt>


but that removes all HTML but need to allow span as some words will be different colour to the rest so tried the following but all the HTML is being removed still and does not allow span to be used

Code: Select all
<cms:excerpt count='218' truncate_chars='1' allow='span'><cms:show welcometext/></cms:excerpt>
Please see the docs for <cms:excerpt> at https://docs.couchcms.com/tags-reference/excerpt.html
You'll find a note there about the relation between 'truncate_chars' and 'allow' param that would explain your observation.
Sorry I see the note now
Is there any way to add a class to a span tag within richtext code, I put a example below

Code: Select all
Welcome to <span class="welcometext">HOMEFRONT DRIVEWAYS & PATIOS LTD</span>, we are the driveway experts that care. We care about our reputation, we care about the <span class="welcometext">quality</span> of our work & most of all we care about what our customers think of us
You may try using the 'custom_styles' feature of CKEditor for that - https://docs.couchcms.com/tags-referenc ... tom_styles

Hope this helps.
Thank you, I did look at custom styles earlier but was not 100% if was the right way to do it, sorry should of tried it first before posting
Just quick update on this, I used custom styles in the richtext on the couchcms demo site I put together and it works perfect

Thank you KK, appreciate it
You are welcome :)
8 posts Page 1 of 1

Who is online

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

Users browsing this forum: Google [Bot] and 5 guests