Jump to:

22992 Posts in 11842 Topics by 2828 members

General Questions

SilverStripe Forums » General Questions » Will this work in new page type?

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: 311 Views
  • Loopy
    Avatar
    Community Member
    20 Posts

    Will this work in new page type? Link to this post

    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

    311 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.