Jump to:

23481 Posts in 18965 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Inserting HTML block into page content

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

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

Page: 1
Go to End
Author Topic: 1464 Views
  • Sadu
    Avatar
    Community Member
    5 Posts

    Inserting HTML block into page content Link to this post

    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.

    Cheers,

    Harvey.

  • Willr
    Avatar
    Forum Moderator
    5503 Posts

    Re: Inserting HTML block into page content Link to this post

    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.

  • Sadu
    Avatar
    Community Member
    5 Posts

    Re: Inserting HTML block into page content Link to this post

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

  • brisrocket
    Avatar
    Community Member
    2 Posts

    Re: Inserting HTML block into page content Link to this post

    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.

    1464 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.