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.

Themes

Discuss SilverStripe Themes.

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

[Resolved] Theme Not Applying


Go to End
Reply

9 Posts   2085 Views

Avatar
jfusco

25 January 2009 at 6:14pm (Last edited: 26 January 2009 7:57am), Community Member, 52 Posts

I downloaded the darkshades theme.
I extracted the compressed file.
I copied the darkshades folder, the darkshades_blog folder and the._darkshades_blog file into the themes folder.
I edited ..\mysite\_config.php as follows:

<?php
SSViewer::set_theme(”darkshades”);

global $project;
...


Added ?flush=1 to the end of the URL
I still have the default theme. Did I miss something?

I have actually flushed the cache both via SS and by deleting the cache of the browser and have used different browsers on different machines while I did other work on the site with the SSViewer statement in the config file.

Thanks,
Joe

Avatar
ajshort

25 January 2009 at 7:35pm Community Member, 244 Posts

Hey There,

There's another call to SSViewer::set_theme() lower in the default _config.php file which sets it to the blackcandy theme - did you remove this or comment it out? If you didn't it will be overriding your custom theme.

Avatar
jfusco

26 January 2009 at 4:08am Community Member, 52 Posts

I ended up with the tutorial install. There is no additional call that I can see. Here's the whole thing:

<?php
SSViewer::set_theme(”darkshades”);

global $project;
$project = 'mysite';

global $databaseConfig;
$databaseConfig = array(
   "type" => "MySQLDatabase",
   "server" => "p50mysql155.secureserver.net",
   "username" => "[hidden]",
   "password" => "[hidden]",
   "database" => "[hidden]",
);

// Sites running on the following servers will be
// run in development mode. See
// http://doc.silverstripe.com/doku.php?id=devmode
// for a description of what dev mode does.
Director::set_dev_servers(array(
   '',
));

?>


Any other ideas?

Avatar
jfusco

26 January 2009 at 7:57am Community Member, 52 Posts

Got it!
For some reason, the installer put the themes directory in the root folder of the installation. For themes to work, the themes folder apparently needs to be under the mysite directory. Once I moved it, the themes started working.

Avatar
Willr

26 January 2009 at 9:55pm Forum Moderator, 5511 Posts

The themes folder does need to be in the root. eg not in mysite. If you installed with the tutorial option if you changed from tutorial to wanting to use mysite + a theme then you need to add a line

SSViewer::set_theme('blackcandy');

To your _config.php file as if you install with tutorial it doesn't use a 'theme' structure. I fixed this for 2.3

Avatar
jfusco

27 January 2009 at 1:31am Community Member, 52 Posts

I used the GoDaddy.com one-click install and it installs 2.2.3 in tutorial mode. I did exactly as you said and the themes did not work until I copied the Themes folder under the mysite folder (I had moved the data from the tutorial folder and changed the appropriate line in _config.php to use mysite). Not sure why but for now I've switched back to default. I'm going to concentrate on getting my content inserted. Maybe by the time I'm done GD will have 2.3 available or I'll have figured out how to install it without using their installer.

Thanks for the help.

Avatar
keyser.soze

14 February 2009 at 10:41am Community Member, 2 Posts

I installed last version yesterday and had the same problem.

I tried your solution but it cause many themes don't work properly, when my attention was caught by the _config.php file permissions (644): my ftp client (filezilla) wasn't able to write new configuration and even change the file permissions so i had to delete it and re-upload with the new configuration line:

SSViewer::set_theme(”acidlemon”);

If you're using a ftp client take a look at the file permissions and turn back to the original directory schema.

Hope this help!

Avatar
jfusco

16 February 2009 at 9:59am Community Member, 52 Posts

You are correct. My _config.php has a permissions level of 644. What does it need to be?

Go to Top