Jump to:

23378 Posts in 18298 Topics by 2867 members

General Questions

SilverStripe Forums » General Questions » CMS picking up wrong theme...

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 904 Views
  • ssnickname
    Avatar
    Community Member
    2 Posts

    CMS picking up wrong theme... Link to this post

    Hello everyone! I'm currently in the process of setting up several test pages in Silverstripe and seem to have encountered a problem where the CMS itself is picking up a style that's intended for a particular page on my site. My _config.php is as follows (I think this is pretty well the default):

    global $project;
    $project = 'mysite';

    global $databaseConfig;
    $databaseConfig = array(
       "type" => "MySQLDatabase",
       "server" => "xxx.xxx.xxx.xxx",
       "username" => "xxxxxxxxx",
       "password" => "xxxxxxxxx",
       "database" => "xxxxxxxxx",
    );

    // 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(
       'localhost',
       '127.0.0.1',
    ));

    // This line set's the current theme. More themes can be
    // downloaded from http://www.silverstripe.com/themes/
    SSViewer::set_theme('blackcandy');

    When I just had a blackcandy subfolder in the themes folder then everything worked well. However, I created a page called (rather unimaginatively) test and created a subfolder called blackcandy_test in the themes folder so that I could specialise the theme specifically for the test page.

    Unfortunately, when I logged out of Silverstripe and went back to its login page, the CMS itself seemed to be using the blackcandy_test theme rather than the original blackcandy. If I delete the blackcandy_test subfolder then the CMS reverts to the blackcandy theme. I've tried clearing my browser cache and the Silverstripe cache so I don't think it's caching confusion.

    Have I misunderstood how theme specialisation works or have I just made a silly mistake somewhere? Any help would be greatly appreciated! Thanks!

  • Willr
    Avatar
    Forum Moderator
    5490 Posts

    Re: CMS picking up wrong theme... Link to this post

    Did you perhaps include something in the 'editor.css' or 'typography.css' file inside your blackcandy_test/ that could be effecting the styling?.

    The CMS loads the editor.css file from your theme so you can add custom class's to tinymce and style the headings, typography etc. With Blackcandy it loads typography inside editor.css (via @import) so in this case if you have something like h1 { font-size: 300%;} in typography or editor css files it will apply it to the whole CMS interface. This is why you should namespace your class's and styles in typography.css with '.typography' as that class is wrapped round the tinymce box and will not apply elsewhere in the cms

  • ssnickname
    Avatar
    Community Member
    2 Posts

    Re: CMS picking up wrong theme... Link to this post

    Thanks for your reply willr and sorry for not getting back to you sooner. I came to the office after your reply to find it locked up and to find myself another victim of the recession. Apparently our now business has a new owner and the doors have opened again so I should be getting back to Silverstripe in the next couple of weeks. Thanks again for your help and I'll let you know how I get on.

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