Forum for discussing general topics related to Couch.
2 posts Page 1 of 1
Hi,
I have surrounded editable content with the required tags as instructed. It appears fine in the CMS editor as well. However, when I add some content in editable box and Save the page, tags are inserted in the saved page.
For example,
Code: Select all
<cms:editable name="main_content" type="richtext">
<ol>
   <li>&lt;p4 -mod class=&quot;medium-font blue-text&quot;&gt;Dean (Faculty Affairs) (February 2017-till date)&lt;/p4&gt;</li>
   <li>&lt;p4 -mod class=&quot;medium-font blue-text&quot;&gt;Professor-in-charge, IIT Bombay Research Park (October 2014-April 2017)&lt;/p4&gt;</li>
   <li>&lt;p4 -mod class=&quot;medium-font blue-text&quot;&gt;Head, Department of Electrical Engineering, IIT Bombay (January 2012-January 2015)&lt;/p4&gt;</li>
   <li>[&lt;p4 -mod class=&quot;regular-font&quot;&gt;Head of one of the largest departments in IIT with 65 faculty members and ~1300 students.&lt;/p4&gt;]</li>
   <li>&lt;p4 -mod class=&quot;medium-font blue-text&quot;&gt;Head, Computer Center (August 2008- July 2011)&lt;/p4&gt;</li>
   <li>New Position</li>
</ol>
</cms:editable>

Screenshot from 2018-04-10 16-24-55.png
HTML Page
Screenshot from 2018-04-10 16-24-55.png (42.06 KiB) Viewed 863 times

The content appears fine in CMS editor initially, but when I make any changes to the content, the output page contains tags as well and original fonts are also changed.
Please guide how to solve this issue.

Regards,
Ayush
Hi,

I see that your HTML contains <p4></p4> tags - these are not valid HTML tags and the '<', '>' characters are deemed as a security risk in unknown tags. Therefore, Couch 'sanitizes' these by converting them to displayable brackets.

That should explain what is happening.
As for the solution - I am not sure what those <p4></p4> tags stand for but no richtext editor will have an option of inputting them through standard buttons.

If you really need them, you'll have to create 'shortcodes' (http://docs.couchcms.com/miscellaneous/shortcodes.html) for them.
The user then, for example, input the following in the rich text editor -
Code: Select all
[p4]Dean (Faculty Affairs) (February 2017-till date)[/p4]
New Position

The shortcodes would then get expanded to the kind of markup you want on the frontend.

Hope this helps.
2 posts Page 1 of 1
cron