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.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Inserting HTML block into page content

Go to End

4 Posts   1945 Views


Community Member, 5 Posts

4 November 2009 at 7:48am

Hi All,

I would like to insert a HTML snippet / content from a template file into a page - but without having it mangled by the WYSIWYG.

In this case it's a block of HTML for signing up to a newsletter provided by a 3rd party. It makes sense to keep this code in a template, away from prying hands.

Is there a way to place a marker in the content editor which will get str_replaced with the actual HTML content later on at display time?

I could mangle a solution together but I'm half expecting this functionality to exist somewhere so thought I would ask.




Forum Moderator, 5523 Posts

4 November 2009 at 1:18pm

Currently one of the ways to do that would be to do something like In the upcoming 2.4 release, it has a neat little tokenized system for inserting snippets into the content area which is a bit nicer then a str_replace.


Community Member, 5 Posts

5 November 2009 at 10:46am

OK, that worked, thanks. Appreciate the prompt response too :)


Community Member, 2 Posts

31 July 2013 at 4:25pm

Really old post (I know) but the link is dead and the question is not answered anywhere else. I'm trying to embed html using the insert html function, like this:
<div id="surveyMonkeyInfo"><div><script src=""> </script></div>Create your free online surveys with <a href="">SurveyMonkey</a> , the world's leading questionnaire tool.</div>

This is SurveyMonkey's latest embed functionality. Hopefully Silverstripe can support this.