Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Customising the CMS

How do I insert HTML in Silverstripe?


Reply

5 Posts   2504 Views

Avatar
salbelle

29 March 2010 at 3:17pm Community Member, 6 Posts

Hi there,

Silverstripe doesn't seem to be able to read and HTML I insert! Is there any way for me to do this or do I kiss HTML goodbye?

Cheers,
S.

Avatar
Juanitou

30 March 2010 at 3:27am Community Member, 323 Posts

Hi!

Strange question. There’s a big HTML button in the HTML-enabled fields of the CMS, and template files are HTML.

Avatar
salbelle

30 March 2010 at 10:57am Community Member, 6 Posts

Hi,

Yep I've been trying to use this button in the CMS. Any code I insert into the HTML, Silverstripe won't read and therefore it is not published :/

Avatar
Willr

30 March 2010 at 4:20pm Forum Moderator, 5511 Posts

It depends what HTML you're trying to insert. It only accepts by default a small subset of elements (divs,links, images, headers etc). You can however customize it to allow what ever you need / want.

http://doc.silverstripe.org/doku.php?id=htmleditorconfig#customizing_allowed_html

Avatar
brisrocket

31 July 2013 at 4:11pm Community Member, 2 Posts

Hi Willr, the link you've suggested a while back is now broken and I can't get this to work. The html I am trying to insert is a SurveyMonkey embed code. I'll try to insert a de-identified copy of the code here:
<div id="surveyMonkeyInfo"><div><script src="https://www.surveymonkey.com/jsEmbed.aspx?sm=xxxxxxxxxxx"> </script></div>Create your free online surveys with <a href="https://www.surveymonkey.com/">SurveyMonkey</a> , the world's leading questionnaire tool.</div>