23483 Posts in 18976 Topics by 2878 members
|Go to End|
4 November 2009 at 7:48am
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.
4 November 2009 at 1:18pm
Currently one of the ways to do that would be to do something like http://doc.silverstripe.org/doku.php?id=recipes:customising-content-in-your-templates. 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.
5 November 2009 at 10:46am
OK, that worked, thanks. Appreciate the prompt response too
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="https://www.surveymonkey.com/jsEmbed.aspx?sm=xxxxxxxxxxxxxx"> </script></div>Create your free online surveys with <a href="https://www.surveymonkey.com/">SurveyMonkey</a> , the world's leading questionnaire tool.</div>
This is SurveyMonkey's latest embed functionality. Hopefully Silverstripe can support this.
|Go to Top|