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

control page.ss


Go to End


4 Posts   1575 Views

Avatar
rube

Community Member, 8 Posts

23 July 2008 at 10:19am

Edited: 23/07/2008 10:36am

hi
I have an urgent request!! I wanted to know how to control the page.ss, What I need to know is:
When I enter the homepage, I have this structure:
(image content.jpg)

-<body>
                -<div id="wrap">
                         +<div id="header">
                          
                               - <div id="content-wrap">
                                        - <div id="content">
                                                  +<div id="sidebar">
                                                  +<div id="main">

</div>
</div>

But when I click on another menu link that has a new structure
(image content2.jpg)

-<body>
                -<div id="wrap">
                         +<div id="header">
                          
                               - <div id="content-wrap">
                                        - <div id="content">
                                                  +<div id="sidebar">
                                                  +<div id="main">
                                                    +<div id="navSec"> 

</div>
</div>

I already created the new div=”navSec” so that other links besides the homepage have this structure. What I can´t figure out is how to have this control. Thanks for your help!!

Rube

Avatar
Willr

Forum Moderator, 5523 Posts

23 July 2008 at 5:46pm

Has the homepage got a custom Page type or is it just a standard page? If it has its own page type eg HomePage.php you can create a HomePage.ss file which has the custom code in it. Or if you could add this in your Page.ss

(homepage must have the url 'home'

<% if InSection(home) %>
// code only for home page
<% end_if %>

Avatar
rube

Community Member, 8 Posts

26 July 2008 at 10:25am

Edited: 26/07/2008 10:34am

First thank you,

I was checking the tutorial, and I saw that says:Each page type is represented by two php classes This is in:
tutorial/code.

I have to copy the code and stick in a new HomePage.ss in the folder:

themes\(my_theme)\template\templates\Layout ?

and to continue making

db/build?flush=1

But I do not have the following image:

homepage.jpg

I fail to obtain a HomePage.ss

Thanks again, and I'm sorry for my spelling, I am a Latino boy.

Rube.

Avatar
rube

Community Member, 8 Posts

26 July 2008 at 10:29am

image:
homepage.jpg