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.

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   1649 Views

Avatar
bebabeba

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 page.ss template but I want create an homepage complitly different. so I create homepage.ss 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..

Avatar
Liam

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 homepage.ss 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.

Avatar
Willr

Forum Moderator, 5523 Posts

25 October 2008 at 12:53pm

HomePage.ss 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

Avatar
bebabeba

Community Member, 193 Posts

27 October 2008 at 9:06pm

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

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

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);
width:1024px;
height: 249px;

}

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