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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Themes /

Discuss SilverStripe Themes.

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

Problem with installing a new theme


Go to End


13 Posts   8606 Views

Avatar
Varberg

Community Member, 15 Posts

17 April 2009 at 7:53pm

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?

Avatar
Willr

Forum Moderator, 5523 Posts

18 April 2009 at 6:49pm

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

Avatar
Varberg

Community Member, 15 Posts

18 April 2009 at 7:29pm

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

Avatar
stx333

Community Member, 14 Posts

10 March 2010 at 11:28am

Edited: 10/03/2010 11:29am

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

Avatar
Willr

Forum Moderator, 5523 Posts

10 March 2010 at 11:40am

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?

Avatar
stx333

Community Member, 14 Posts

10 March 2010 at 11:46am

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

Avatar
Willr

Forum Moderator, 5523 Posts

10 March 2010 at 11:52am

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.

Avatar
stx333

Community Member, 14 Posts

10 March 2010 at 11:58am

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.

Go to Top