Jump to:

1367 Posts in 487 Topics by 521 members

Themes

SilverStripe Forums » Themes » Installing theme

Discuss SilverStripe Themes.

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

Page: 1
Go to End
Author Topic: 2405 Views
  • The Error Guy
    Avatar
    Community Member
    4 Posts

    Installing theme Link to this post

    I seem to be having a problem with instaling new themes on my site. after downloading and extracting the theme files into the themes folder in the silverstripe install directory and changeing the config.php line SSViewer::set_theme('COD') I get the following error when i try to view the site

    [Warning] file_get_contents() [function.file-get-contents]: Filename cannot be empty
    GET /SilverStripe/
    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;
    Trace
    •file_get_contents()
    Line 277 of SSViewer.php
    •SSViewer::getTemplateContent(BreadCrumbs)
    Line 2 of SSViewer.php(396) : runtime-created function
    •__lambda_func(Array)

    •preg_replace_callback(/<% include +([A-Za-z0-9_]+) +%>/,lambda_289,<!-- template C:/wamp/www/SilverStripe/themes/COD/templates/Layout/Page.ss --> <div class="postheader"><h1>$Title</h1></div> <div class="postcontent typography"> <% if Level(2) %> <% include BreadCrumbs %> <% end_if %> $Content $Form $PageComments </div> <!-- end template C:/wamp/www/SilverStripe/themes/COD/templates/Layout/Page.ss -->)
    Line 396 of SSViewer.php
    •SSViewer::parseTemplateContent( <div class="postheader"><h1>$Title</h1></div> <div class="postcontent typography"> <% if Level(2) %> <% include BreadCrumbs %> <% end_if %> $Content $Form $PageComments </div>,C:/wamp/www/SilverStripe/themes/COD/templates/Layout/Page.ss)
    Line 321 of SSViewer.php
    •SSViewer->process(Page_Controller)
    Line 346 of SSViewer.php
    •SSViewer->process(Page_Controller)
    Line 175 of Controller.php
    •Controller->handleAction(HTTPRequest)
    Line 129 of RequestHandler.php
    •RequestHandler->handleRequest(HTTPRequest)
    Line 122 of Controller.php
    •Controller->handleRequest(HTTPRequest)
    Line 29 of ModelAsController.php
    •ModelAsController->handleRequest(HTTPRequest)
    Line 44 of RootURLController.php
    •RootURLController->handleRequest(HTTPRequest)
    Line 277 of Director.php
    •Director::handleRequest(HTTPRequest,Session)
    Line 121 of Director.php
    •Director::direct(/)
    Line 118 of main.php

    I then renamed the folder to "black candy" (returning the config.php file SS viewer to blackcandy too) and the site worked except the page did not view correctly. (see attached file) this happened with several themes (call of duty 2, Globe,Wine) so I am ruling out that its a bad theme file and most likely an error on my part.

    NOTE: I will be unable to view this thread for about 4-5 days from tomorrow morning so dont expect a quick response however help is VERY much appreciated so post your ideas and possible solutions and I'll try them as soon as i can.

    Attached Files
  • Willr
    Avatar
    Forum Moderator
    5482 Posts

    Re: Installing theme Link to this post

    theme names should be lowercase. Try changing it

  • Thermalzombie
    Avatar
    Community Member
    27 Posts

    Re: Installing theme Link to this post

    Noob here I am not sure there is much you can do wrong?

    Check the theme name and theme folder name are exactly the same no spaces on the end of the folder name.

    Did you do this?

    Once you’ve added the code, visit your homepage, and flush the cache (append ?flush=1 to the url). Your new theme should now be working.

  • The Error Guy
    Avatar
    Community Member
    4 Posts

    Re: Installing theme Link to this post

    i tried flushing, didnt work. as to all letters being lowercase, ill try that but if that is the case then why didnt it display correctly when i copied the other theme's contents to the "blackcandy" theme folder? this puzzles me. am I toatally stupid and COMPLETElY screwing it up??

    PS sorry about the triple post.

  • Eastside Sean
    Avatar
    Community Member
    4 Posts

    Re: Installing theme Link to this post

    I'm having exactly the same issue with the 'pixelgreen' theme from the Silverstripe website.

    What is more bizarre is that I've uploaded and setup this theme before with an earlier version of Silverstripe without a hassle.

    ---------------------------------

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

    Line 277 in /home/lewitzka/public_html/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;

    Trace

    * file_get_contents()
    Line 277 of SSViewer.php
    * SSViewer::getTemplateContent(BreadCrumbs)
    Line 2 of SSViewer.php(396) : runtime-created function
    * __lambda_func(Array)
    * preg_replace_callback(/<% include +([A-Za-z0-9_]+) +%>/,�lambda_55,<!-- template /home/lewitzka/public_html/themes/pixelgreen/templates/Layout/Page.ss --> <div class="typography"> <% if Level(2) %> <% include BreadCrumbs %> <% end_if %> <h1>$Title</h1> $Content $Form $PageComments </div> <!-- end template /home/lewitzka/public_html/themes/pixelgreen/templates/Layout/Page.ss -->)
    Line 396 of SSViewer.php
    * SSViewer::parseTemplateContent(<div class="typography"> <% if Level(2) %> <% include BreadCrumbs %> <% end_if %> <h1>$Title</h1> $Content $Form $PageComments </div>,/home/lewitzka/public_html/themes/pixelgreen/templates/Layout/Page.ss)
    Line 321 of SSViewer.php
    * SSViewer->process(Page_Controller)
    Line 346 of SSViewer.php
    * SSViewer->process(Page_Controller)
    Line 175 of Controller.php
    * Controller->handleAction(HTTPRequest)
    Line 129 of RequestHandler.php
    * RequestHandler->handleRequest(HTTPRequest)
    Line 122 of Controller.php
    * Controller->handleRequest(HTTPRequest)
    Line 29 of ModelAsController.php
    * ModelAsController->handleRequest(HTTPRequest)
    Line 44 of RootURLController.php
    * RootURLController->handleRequest(HTTPRequest)
    Line 277 of Director.php
    * Director::handleRequest(HTTPRequest,Session)
    Line 121 of Director.php
    * Director::direct(/)
    Line 118 of main.php

    ------------------------------------------

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