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.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

impossible change new page type theme

Go to End

4 Posts   1474 Views


Community Member, 193 Posts

24 October 2008 at 11:13pm

Hi!I have a problem with silverstripe in the rcreation of a new theme form my page.
all my site pagefollow template but I want create an homepage complitly different. so I create in theme/template/layout and in the css i use
#homepage #container{..}
#homepage #header {..}
#homepage #content {..}
nothing is change, what is wrong?please help me..


Community Member, 470 Posts

25 October 2008 at 7:13am

Without seeing your code, can't say for sure, however a few things to note.

Make sure you put ?flush=1 at the end of your homepage URL to update the template.

Just because you made doesn't mean there is a CSS ID for it. If you want to use the code like that, make sure you do something like <body id="homepage"> in your template. Have you done that?

How you could make this dynamic is by using the variable $URLSegement in the id of the body. This outputs the page url for each page, so you could do this for any page you wanted.

Post more of your code or explain more if this doesn't fix it.


Forum Moderator, 5523 Posts

25 October 2008 at 12:53pm will only apply for the 'HomePage' page type. Is your page actually a 'HomePage' type? Templates can't exist without a PHP class (apart from includes) to match them


Community Member, 193 Posts

27 October 2008 at 9:06pm

I create HomePage.php as estension of Page .php
In I put:

<body id="$URLSegment">
<div id="Header"></div>

In theme/css/layout.css I put:

(for Page.php)
#Header {
background-image: url(../images/old_image.jpg);
height: 289px;
width: 1000px;
(for HomePage.php)
#homepage-2 #Header{
background-image: url(../images/new_image.jpg);
height: 249px;


I want change HomePage in width, height and image compared with
The result is taht ne_image appear in the container.Seems impossible modify header.