Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » impossible change new page type theme

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

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

Page: 1
Go to End
Author Topic: 1204 Views
  • bebabeba
    Avatar
    Community Member
    192 Posts

    impossible change new page type theme Link to this post

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

  • Liam
    Avatar
    Community Member
    470 Posts

    Re: impossible change new page type theme Link to this post

    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.

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: impossible change new page type theme Link to this post

    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

  • bebabeba
    Avatar
    Community Member
    192 Posts

    Re: impossible change new page type theme Link to this post

    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.

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