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.

Template Questions

Template With Code Input Section


Reply

2 Posts   442 Views

Avatar
goodness

9 August 2013 at 7:16am Community Member, 38 Posts

Hello All,

I am running SilverStripe 3.0.5 and I am trying to create a new template that will allow me to insert code with the HTML Source Editor view within the CMS.

I am trying to insert a php calculator inside a page that is based on the Page template.

Whenever I type code into the HTML Editor it simply strips it out.

Perhaps I need to create a new Tab for this template that will allow code and then have it rendered in the proper position on the page.

Is there a way to create an area that will accept code and then show it in the content area of the page?

This should be simple but so far I can't find the answer.

Thanks in advance for any help/advice that anyone is willing to give me.

Avatar
Willr

11 August 2013 at 5:57pm Forum Moderator, 5511 Posts

Checkout short codes for embedding code functionality onto a page:

http://doc.silverstripe.org/framework/en/topics/shortcodes
http://www.ssbits.com/tutorials/2010/2-4-using-short-codes-to-embed-a-youtube-video/