Errors after installing a theme

Permalink
I'm new to concrete5, and I'm currently learning how to create my own theme.

I try to change different built-in themes by the following steps:

1. copy dark_chocolate from concrete/themes to application/themes
2. Go to dashboard => Themes
3. Install the theme, and activate the theme.
4. Back to home to see what happened.

But then the whole site shut down with the error message:

An unexpected error occurred.
An error occurred while processing this request.

I cannot debug since there's no useful information in the error message. I'm creating theme with a blank site which means no sample content in my site.

I just want to learn how to make a custom theme by knowing how to change themes first.

Am I missing anything?

Thank you very much for any suggestions!

howtomakeaturn
 
kieranrushby replied on at Permalink Reply
kieranrushby
Are you using version 5.7.0 or 5.7.0.1?
howtomakeaturn replied on at Permalink Reply
howtomakeaturn
5.7.0

any difference?

thx!
kieranrushby replied on at Permalink Reply
kieranrushby
Some folk have had similar issues with unexpected theme installing, 5.7 is still buggy to I would try the upgrade to eliminate that first.
howtomakeaturn replied on at Permalink Reply
howtomakeaturn
I re-installed with 5.7.0.1 version, but the same error happened.

Installed themes successfully, but error happened after activating.
Steevb replied on at Permalink Reply
Steevb
Only theme you could try modifying is the 'Elements' theme with 5.7 I think.
howtomakeaturn replied on at Permalink Reply
howtomakeaturn
I copied 'Elements' theme, give it a new name, change the description.txt file.

Then I cannot open the 'Pages &Themes' in dashboard anymore...

An unexpected error occurred.
An error occurred while processing this request.

Even if I removed the copied folder...
kieranrushby replied on at Permalink Reply
kieranrushby
Have you removed the themes from the directory before uninstalling from the dashboard?
dexterurbanski replied on at Permalink Reply
Hi, I have a similar problem. To remove new theme delete record from the database (pagethemes).
pvernaglia replied on at Permalink Reply
pvernaglia
If you set debugging to show on page you will se the error, Call to a member function getPageThemeGridFrameworkRowStartHTML() on a non-object It was supposed to have been fixed in 5.7.0.1 but it is still happening.

It's something to do with a class file and the $ptThemeGridFrameworkHandle = 'bootstrap3'but it is still a secret how to do it
howtomakeaturn replied on at Permalink Reply
howtomakeaturn
Hi, thanks.
I remove the theme files and records in PageThemes table.
Now I can open Pages & Themes in dashboard without any error.
But once I want to create a custom theme, the same error happen.
So.. what should I do to try my first theme?
I'm just start to learn how to build my custom theme.
kieranrushby replied on at Permalink Reply
kieranrushby
OK this may be a bit lengthy but I have detailed everything I did to try and ensure you don't get any problems..

Copy the elemental theme into 'application/themes' directory.

Rename the folder from elemental to something like ‘my_new_theme’

Go into the theme and keep the 'css', 'elements' and 'images' folders (good to have but not required).

Get rid of all other files apart from 'default.php', 'description.txt', 'full.php' (again good to have) and 'view.php'

Change your 'description.txt' to something like

My New Theme
This is my new theme


'full.php' just includes 'default.php' and 'view.php' just includes the 'header.php' and 'footer.php' elements and prints the content so we really only have to edit 'default.php' and the elements

Open 'default.php' and remove
$a->enableGridContainer();

This appears after each new area and will throw an error if you keep it in. We may as well keep the areas in so we have something to test on install.

Now jump into your 'elements/header.php' and remove everything apart from
defined('C5_EXECUTE') or die("Access Denied.");
$this->inc('elements/header_top.php');


Hop into 'elements/footer.php' and remove everything apart from
defined('C5_EXECUTE') or die("Access Denied.");
$this->inc('elements/footer_bottom.php');


Leave 'elements/header_top.php' alone apart from removing
<link rel="stylesheet" type="text/css" href="<?php echo $this->getThemePath()?>/css/bootstrap-modified.css">

And replacing with
<?php echo $html->css($view->getStylesheet('build/bootstrap-3.2.0/bootstrap.less'))?>

This will give you an unmodified version of bootstrap

Leave 'elements/footer_bottom.php' alone

Go into css directory and remove 'styles.xml' and 'presets' directory (if you want your theme to have customisable styles look these up and add back in later) also remove 'bootstrap-modified.css'

Open main.less and remove everything apart from
@import "build/body.less";


Jump into 'css/build' and remove 'blocks', 'custom-design-classes', 'fonts' and 'mobile directories' also remove all the '.less' files apart from 'body.less'

Open 'css/build/body.less' and delete everything

And finally remove everything from the 'images' directory

Swing over to the themes dashboard, install and activate.

This will give you a very bare bones theme but you can always reference back and put things back in if you want. Also as a note your new theme as is doesn't make use of anything from bootstrap yet.

Fingers crossed!!
farghal replied on at Permalink Reply
Hi kieranrushby

Thanks for you're elaborated description there is however one small problem I'm having at the end. I can't actually get on the theme's page because every page gives an error :(. I have not yet figured out how to restore that after trying to install a custom theme
kieranrushby replied on at Permalink Reply
kieranrushby
I suggest maybe a fresh install to clear the errors your getting on the themes page or clean up the pagethemes table mentioned above to try and resolve the error then try again.
cmborchert replied on at Permalink Reply
Hi all,

The above ended up throwing me an error, also. After some playing around, I discovered the culprit to be in default.php:

<?php
$a = new Area('Main');
$a->display($c);
?>

I'm still new to C5, but it seems that naming that there's something particular about the naming conventions for areas that I'm not quite privy to. Renaming the area to "Main Content" instead of "Main" solved the error for me:
<?php
$a = new Area('Main Content');
$a->display($c);
?>


Hope this helps those in similar situations!
fischershaw replied on at Permalink Reply
v5.7.0.1
Copied dark_chocolate to the /themes folder and renamed it biff, changing also the description.txt file. Installed it and received the following error:

ReflectionException thrown with message "Class helper/concrete/scrapbook does not exist"

Stacktrace:
#17 ReflectionException in /hsphere/local/home/fishing/xxxx/concrete5/concrete/vendor/illuminate/container/Illuminate/Container/Container.php:501
#16 ReflectionClass:__construct in /hsphere/local/home/fishing/xxxx/concrete5/concrete/vendor/illuminate/container/Illuminate/Container/Container.php:501
#15 Illuminate\Container\Container:build in /hsphere/local/home/fishing/xxxx/concrete5/concrete/vendor/illuminate/container/Illuminate/Container/Container.php:425
#14 Illuminate\Container\Container:make in /hsphere/local/home/fishing/xxxx/concrete5/concrete/src/Support/Facade/Facade.php:113
#13 Concrete\Core\Support\Facade\Facade:__callStatic in /hsphere/local/home/fishing/xxxx/concrete5/concrete/src/Legacy/Loader.php:23
#12 Concrete\Core\Support\Facade\Application:make in /hsphere/local/home/fishing/xxxx/concrete5/concrete/src/Legacy/Loader.php:23
#11 Concrete\Core\Legacy\Loader:helper in /hsphere/local/home/fishing/xxxx/concrete5/concrete/src/Block/Block.php:59
#10 Concrete\Core\Block\Block:getByName in /hsphere/local/home/fishing/xxxx/concrete5/application/themes/biff/elements/header.php:32
#9 include in /hsphere/local/home/fishing/xxxx/concrete5/concrete/src/View/View.php:56
#8 Concrete\Core\View\View:inc in /hsphere/local/home/fishing/xxxx/concrete5/application/themes/biff/full.php:3
#7 include in /hsphere/local/home/fishing/xxxx/concrete5/concrete/src/View/View.php:153
#6 Concrete\Core\View\View:renderViewContents in /hsphere/local/home/fishing/xxxx/concrete5/concrete/src/View/AbstractView.php:123
#5 Concrete\Core\View\AbstractView:render in /hsphere/local/home/fishing/xxxx/concrete5/concrete/src/Routing/DispatcherRouteCallback.php:20
#4 Concrete\Core\Routing\DispatcherRouteCallback:sendResponse in /hsphere/local/home/fishing/xxxx/concrete5/concrete/src/Routing/DispatcherRouteCallback.php:152
#3 Concrete\Core\Routing\DispatcherRouteCallback:execute in /hsphere/local/home/fishing/xxxx/concrete5/concrete/src/Application/Application.php:284
#2 Concrete\Core\Application\Application:dispatch in /hsphere/local/home/fishing/xxxx/concrete5/concrete/bootstrap/start.php:245
#1 require in /hsphere/local/home/fishing/xxxx/concrete5/concrete/dispatcher.php:36
#0 require in /hsphere/local/home/fishing/xxxx/concrete5/index.php:2

Edit: So the question is why getByName() is trying to load 'helper/concrete/scrapbook' (/concrete/src/Block/Block.php line 59)?
Steevb replied on at Permalink Reply 1 Attachment
Steevb
I've been playing with 5.7 and watching the videos Andy has done. I have now got my head around the basics. Three of my custom themes run perfectly, apart from customisation.

If you want to try installing and playing with good old GY, I've attached to download. just put it in the application/themes folder.
fischershaw replied on at Permalink Reply
Another issue that was reported previously occurs with your greek_yogurt:

Whoops\Exception\ErrorException thrown with message "Call to a member function getPageThemeGridFrameworkRowStartHTML() on a non-object"

Stacktrace:
#0 in /hsphere/local/home/fishing/xxxx/concrete5/concrete/blocks/core_area_layout/view_grid.php:9

Edit:
Interesting that the function called immediately prior to return the ThemeGridFrameworkObject (getThemeGridFrameworkObject) is able to return randomness if there is no handle. Why is it doing that here?
pvernaglia replied on at Permalink Reply
pvernaglia
it is missing page_theme.php
fischershaw replied on at Permalink Reply
As in /concrete/themes/concrete/page_theme.php? Does not seem to help. But I am just throwing darts in the dark, as I have not poked around at this code yet.

Edit:
So it seems like supportsGridFramework() is ignored when rendering Areas, which have their own flag in a db table. Why would that be?
fischershaw replied on at Permalink Reply
So the real problem seems to be that if a theme supports this grid thing (like the Elements theme), then any Area created has that flag checked in the Area db table. So if you switch to another theme that does not support grids, you are hosed.

So do not install the sample site, always start with a blank one. Also, don't create any content while using a theme that supports grids if you ever want to change in the future to one that does not.
pvernaglia replied on at Permalink Reply
pvernaglia
As long as you have page_theme.php when you install your theme you can add to it later. It does seem a little tricky to make a theme that you can switch to if you aleady have Elemental installed. I tried a little to get one to work with the sample content but kept running into problems and moved on to other things. I guess you could rename Elemental and use it as a template and if you had everything from Elementals page_theme.php and had all of the area names that Elemental uses it might work. Starting with an empty site all goes together pretty easily.
cmborchert replied on at Permalink Reply
Have you added this to the bug tracker? It sounds like a real usability error that will hinder developers and clients from using the CMS well.
cmborchert replied on at Permalink Reply
a2vdesign replied on at Permalink Reply
a2vdesign
Hello, try to add
;
to the
protected $pThemeGridFrameworkHandle = 'bootstrap3'
line in your page_theme.php
dcgny replied on at Permalink Reply
changed
namespace Concrete\Theme\Yourthemename;
in page_theme.php and change references to elements in other doc to your theme name seemed to work for me