Jump to:

5554 Posts in 1742 Topics by 1227 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Double content issue

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

Page: 1
Go to End
Author Topic: 943 Views
  • servalman
    Avatar
    Community Member
    211 Posts

    Double content issue Link to this post

    Hi

    I tried to use this procedure (http://silverstripe.org/customising-the-cms/show/251211#post251211) to add a nex content Editor for asecond column. I did not realyy succed but when I tried to get back to the original Page.php and Page.ss files (even by replacing them with fresh ones ) it did not work and now the pages are all repeating the content twice.

    I did flush=all

    Any Idea why ?

    Thanks

    Thomas

  • Aram
    Avatar
    Community Member
    598 Posts

    Re: Double content issue Link to this post

    Hi Servalman

    This must be because you have $Content twice in your templates.

    Check both the theme/Page.ss and theme/Layout/Page.ss as well as any includes you may be using in theme/Includes.

    Then add ?flush=1 to the end of the URL, make sure you rememebr the '?' at the front or it wont work.

    Hope that helps

    Aram

  • servalman
    Avatar
    Community Member
    211 Posts

    Re: Double content issue Link to this post

    Thank you Aram I did not flush properly I guess

    One other question :

    The Page.ss is set like this :

    ///////////////////////////////////////////
    <div class="typography">
       <% if Menu(2) %>
          <% include SideBar %>
          <div id="Content">
       <% end_if %>
             
       <% if Level(2) %>
           <% include BreadCrumbs %>
       <% end_if %>
       
          <h2>$Title</h2>
       
          $Content
          $Form
          $PageComments
       <% if Menu(2) %>
          </div>
       <% end_if %>
    </div>
    ////////////////////////////////////

    I find it strange that </div> tag closing the <div id="Content"> tag is under the <% if Menu(2) %> same thing with the <% end_if %> tag who is after the <div id="Content"> at the begining is it normal ? shlould it not be like this :

    ///////////////////////////////////////
    <div class="typography">

       <% if Menu(2) %>
          <% include SideBar %>
    <% end_if %>

          <div id="Content">
             
       <% if Level(2) %>
           <% include BreadCrumbs %>
       <% end_if %>
       
          <h2>$Title</h2>
       
          $Content
          $Form
          $PageComments
    </div>
       <% if Menu(2) %>
          
       <% end_if %>
    </div>
    //////////////////////////////////////////////////////

    Thank you

  • dalesaurus
    Avatar
    Community Member
    283 Posts

    Re: Double content issue Link to this post

    SS templates are the Wild Wild West, you can arrange them however you like. I prefer to keep my divs in my includes, but whatever sucks the poison out keeps you alive, right?

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