Jump to:

1369 Posts in 487 Topics by 520 members

Themes

SilverStripe Forums » Themes » Problem with installing a new theme

Discuss SilverStripe Themes.

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

Page: 1 2
Go to End
Author Topic: 6149 Views
  • Varberg
    Avatar
    Community Member
    15 Posts

    Problem with installing a new theme Link to this post

    I'm fairly new to SS and am trying a few things to see how they work.

    I've downloaded and installed a new theme, Artica, and have a few problems/questions.

    In the C:\wamp\www\silverstripe\themes folder I have the following sub-folders

    artica
    artica_blog
    artica_ecommerce
    artica_forum

    I have amended the _config.php file to

    SSViewer::set_theme('artica');

    I flushed the database and the templates.

    The Home page on the site works fine

    The blog sections seems to work perfectly

    The ecommerce section uses the new theme except for the product details which are still in the blackcandy theme.
    The check out page does not have anything but the header and text; no cart or forms

    The diary module does not work at all, I just get

    [Warning] file_get_contents() [function.file-get-contents]: Filename cannot be empty
    GET /silverstripe/my-diary-2/

    Line 277 in C:\wamp\www\silverstripe\sapphire\core\SSViewer.php
    Source

    268    /**
    269     * Used by <% include Identifier %> statements to get the full
    270     * unparsed content of a template file.
    271     *
    272     * @uses getTemplateFile()
    273     * @param string $identifier A template name without '.ss' extension or path.
    274     * @return string content of template
    275     */
    276    public static function getTemplateContent($identifier) {
    277       return file_get_contents(SSViewer::getTemplateFile($identifier));
    278    }
    279    
    280    /**
    281     * @ignore
    282     */
    283    static private $flushed = false;

    Question: Have I installed the theme properly, ie: all the folders in the right place?
    Is there any specific sequence for installation of a theme? ie Install modules before themes or themes before modules?

  • Willr
    Avatar
    Forum Moderator
    5489 Posts

    Re: Problem with installing a new theme Link to this post

    You have got the correct idea, some themes do not fully style all the modules though, I'm not sure if artica is meant to have a custom ecommerce style (it could just be defaulting to the default in that case) as for error - I guess it should check for a file before running file_get_contents().

    You could try edit that file (file name and location in that error) to something like

    return (SSViewer::getTemplateFile($identifier)) ? file_get_contents(SSViewer::getTemplateFile($identifier)) : "";

    Though this error has come up alot recently in the forums, I haven't noticed it in 2.3.1 but it could be the module templates are not defaulting back to plain styles if the theme does not include ALL the files.. hmm

  • Varberg
    Avatar
    Community Member
    15 Posts

    Re: Problem with installing a new theme Link to this post

    Thanks, it worked by editing the file as you suggested.

  • stx333
    Avatar
    Community Member
    14 Posts

    Re: Problem with installing a new theme Link to this post

    Willr,

    Just downloaded and installed 2.3.6. The exactly same problem occured after adding a new theme (wine) to the themes dir and changing the _config.php file.

    Your fix solved the problem however. Shouldn't this be reported to the Dev Team?

    Thanks,
    Stas

  • Willr
    Avatar
    Forum Moderator
    5489 Posts

    Re: Problem with installing a new theme Link to this post

    Well I am on the dev team . This has been fixed as part of 2.4 AFAIK. Sean did some work on this 11 months ago.

    Are you using 2.3 or 2.4?

  • stx333
    Avatar
    Community Member
    14 Posts

    Re: Problem with installing a new theme Link to this post

    I'm using 2.3.6, so I guess I'll just wait for a stable release of 2.4.

    By the way - will the upgrade to 2.4 be very annoying from 2.3.6 or 2.3.1 (got another site on 2.3.1)?

    Thanks,
    Stas

  • Willr
    Avatar
    Forum Moderator
    5489 Posts

    Re: Problem with installing a new theme Link to this post

    As with any upgrade it depends on how complex your application is that you have built on top of silverstripe. If its a simple site then it will be fairly easy. I just upgraded a site this morning and just needed to rebuild the database and change a couple methods.

    We have been trying to pad out the notes on http://doc.silverstripe.org/doku.php?id=upgrading:2.4.0 to make it easy.

    If you're running modules then it is likely you will have to upgrade those to the daily builds.

  • stx333
    Avatar
    Community Member
    14 Posts

    Re: Problem with installing a new theme Link to this post

    Ok, got it.

    Thanks Willr, I guess I should wait till it is all stable including the couple of modules I'm using (blog, image-gallery).

    Thanks for pointing me to the doc as well - surely this is useful.

    6149 Views
Page: 1 2
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.