21293 Posts in 5733 Topics by 2602 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 720 Views |
-
$layout and theme

9 July 2010 at 4:08am Last edited: 9 July 2010 4:16am
Hi!
I have two wuertions:1. Is it possible use two different theme form my Silverstripe site? I thougth to include some parameter to include one theme or an other if is satisfy a particular condition in my Page.php..
2. Is possible to defini an other variable like $layout?I read documentation and I read that throw this variable I can build different tempalte.. So If I want build different banner for example I need a $header variable..I can define thi variable like $layout. how cani I creat this?what are the part of code that I can modify?
Thanks!!
-
Re: $layout and theme

9 July 2010 at 10:23am
1. Yes
http://silverstripe.org/themes-2/show/285264#post2852642. Yes
You can create a new method but that's quite a complicated way of going about it, you will probably get most of what you need using an include just like Footer e.g. <% include Header %> and have a Header.ss in the theme's "Includes" directory. Another option is to add a field to your page class if you just wanted to add a page-dependent banner. All depends on exactly what you want to achieve. -
Re: $layout and theme

14 July 2010 at 8:46pm
For second point I try to explain what I want to do.
I need to create a folder 'NewLayout' at the same lavel of Layout folder in my theme. Than I need to create new php page with a relative layout in NewLayout folder. Then I need a variable to use this template. How can I do this? -
Re: $layout and theme

15 July 2010 at 1:39pm
Hmm, sounds like overkill for displaying a banner. You will probably get more mileage by adding a page banner image like in the recipe for image upload or by creating a new page type and creating a layout template for it.
If you are dead set on creating a new sub-template then you need to use renderWith() in your function "Header"
| 720 Views | ||
|
Page:
1
|
Go to Top |

