Paragon
(Daniel Moniz)
October 15, 2011, 9:56pm
1
Hello,
This is my first post, so I’m not sure if this is the right place for it.
I have followed the instructions at http://www.yiiframework.com/doc/guide/1.1/en/topics.theming , but I am unable to get even the ‘classic’ theme loading. In my config file (application configuration), I have:
'name'=>'My Web Application',
'theme'=>'classic',
I have copied main.php layouts file into themes/classic/views/layouts/. When I change these things and load a page, the existing non-main.php layout loads. What else do I have to do? Any help here would be really appreciated.
Thanks,
Daniel Moniz
tri
(tri - Tommy Riboe)
October 15, 2011, 10:10pm
2
Welcome to the forum!
If you use Gii the generated code and don’t want to use the ‘column1’ layout, you will have to change the layout setting in the application base controller protected/components/Controller.php
public $layout='//layouts/column1';
/Tommy
Paragon
(Daniel Moniz)
October 16, 2011, 3:21am
3
Thanks Tommy! That worked nicely.
apotter
(Mymail)
October 28, 2011, 1:01pm
4
I’m having the same problem as Paragon.
The instructions for a custom theme don’t take effect.
jayant
(Codesutras)
November 1, 2011, 9:54am
5
Hi apotter,
First if you are using your custom theme then put in the themes folder along with default classic theme with a same directory structure.
Then put all css files in Css folder,images in images folder, and js in js folder. and html view in View/layout file.
Now to use this theme you need to configure the configuration file (main.php).
add this line in the configuration file
'theme'=>'theme_folder_name',
After that in a controller folder change the public variable $layout to your define layout name.
And it will work…
One more problem you will face here with a path of images and css file.So for this use
Yii::app()->theme->baseUrl
which will return you current theme’s path…
hope this info will help you a lot.