Errors after installing a 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!
Installed themes successfully, but error happened after activating.
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...
It's something to do with a class file and the $ptThemeGridFrameworkHandle = 'bootstrap3'but it is still a secret how to do it
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.
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
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
Hop into 'elements/footer.php' and remove everything apart from
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
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.
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
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!
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"
#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)?
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.
Whoops\Exception\ErrorException thrown with message "Call to a member function getPageThemeGridFrameworkRowStartHTML() on a non-object"
#0 in /hsphere/local/home/fishing/xxxx/concrete5/concrete/blocks/core_area_layout/view_grid.php:9
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?
So it seems like supportsGridFramework() is ignored when rendering Areas, which have their own flag in a db table. Why would that be?
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.
protected $pThemeGridFrameworkHandle = 'bootstrap3'
in page_theme.php and change references to elements in other doc to your theme name seemed to work for me