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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

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

Will this work in new page type?


Go to End


1084 Views

Avatar
Loopy

Community Member, 20 Posts

2 February 2012 at 1:25am

1 create new page type called HomePage.php in mysite/code

2 Make content below line 11 "class Page_Controller extends ContentController" the same as Page.php

3 Create file called HomePage.ss in themes/mytheme/templates

4 Make this HomePage.ss file an exact copy of Page.ss

5 Create file called customContent.ss in themes/mytheme/templates/includes

6 Put all page content that should appear between <body> </body> tags into this file (excluding <body> </body> tags

7 Edit HomePage.ss by adding

<div id="customcontent">
<% include customcontent %>
</div>

at line 39 immediately after

<div id="Layout">
$Layout
</div>

and just before

<div class="clear"><!-- --></div>
</div>

I have several questions:

1 Will this work and display the html content from themes/mytheme/templates/includes/customcontent.ss without wysiwyg editor changing tags

2 Does adding content this way create potential security issues

3 Will this have an impact on the way search engine spiders see my site and have a negative impact on seo

WHY do I want to do this I hear you cry. Basically the only way to use <script> tags in silverstripe is to find a way to bypass wysiwig editor.

thanks in advance