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.

Customising the CMS /

Double content issue


Reply


4 Posts   972 Views

Avatar
servalman

Community Member, 211 Posts

6 October 2009 at 6:02am

Edited: 06/10/2009 6:03am

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

Avatar
Carbon Crayon

Community Member, 598 Posts

6 October 2009 at 7:36am

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

Avatar
servalman

Community Member, 211 Posts

6 October 2009 at 8:06pm

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

Avatar
dalesaurus

Community Member, 283 Posts

8 October 2009 at 4:45pm

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?