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