5.7 - custom modifications to Elemental

Permalink 2 users found helpful
Hello Community !

I've just started creating my company page with C5. I am using 5.7.4.
I like the interface and C5 itself very much however I encountered number of problems, but I am trying to understand the C5 and solve the problems.

First of all I'd like to customize Elementhal theme so I don't have to do everything from scratch. From what I understand, I shouldn't do that in the concrete/themes but have my custom theme in application/themes.

That's reasonable. But elemental theme can't be simply copied. If I do that I face errors during activation. On the forum I found the step by step instruction of how to make clean template based on Elementhal, but after following the howto my page displays nothing.
I probably should add some sections, etc, but as a beginner I would strongly prefer modifying elementhal than doing everything from scratch. If possible please show how to do that, so copy of elementhal can be installed without errors or (better) if possible could somebody publish properly modified elementhal theme so it could be easily pasted into custom themes in application folder. Then newbies like me could play with this theme without fear that they break something.

Thank you in advance.

View Replies:
mhawke replied on at Permalink Reply
Here's what I did...

1) Copy the 'concrete/themes/elemental' folder into 'application/themes/elementalcustom'
2) Open the 'application/themes/elementalcustom/description.txt' file and change the first line to 'Elementalcustom'. I also changed the second line to indicate that this was a copy of the core Elemental theme.
3) Open the 'application/themes/elementalcustom/css/main.less' and add a '../' to the path in line 6.

I think that's it but holler back if that doesn't work.
tronix replied on at Permalink Reply
Thank you for prompt answer, unfortunately it doesn't work

after I try to install the theme I get

ReflectionException thrown with message "Class \Application\Theme\Elementalcustom\PageTheme does not exist"
#16 ReflectionException in C:\PROJEKTY\C5\tronixwww\updates\concrete5.7.0.4\concrete\vendor\illuminate\container\Illuminate\Container\Container.php:501
#15 ReflectionClass:__construct in C:\PROJEKTY\C5\tronixwww\updates\concrete5.7.0.4\concrete\vendor\illuminate\container\Illuminate\Container\Container.php:501
#14 Illuminate\Container\Container:build in C:\PROJEKTY\C5\tronixwww\updates\concrete5.7.0.4\concrete\vendor\illuminate\container\Illuminate\Container\Container.php:425
#13 Illuminate\Container\Container:make in C:\PROJEKTY\C5\tronixwww\updates\concrete5.7.0.4\concrete\src\Support\Facade\Facade.php:113
#12 Concrete\Core\Support\Facade\Facade:__callStatic in C:\PROJEKTY\C5\tronixwww\updates\concrete5.7.0.4\concrete\src\Page\Theme\Theme.php:441
#11 Concrete\Core\Support\Facade\Application:make in C:\PROJEKTY\C5\tronixwww\updates\concrete5.7.0.4\concrete\src\Page\Theme\Theme.php:441
#10 Concrete\Core\Page\Theme\Theme:populateThemeQuery in C:\PROJEKTY\C5\tronixwww\updates\concrete5.7.0.4\concrete\src\Page\Theme\Theme.php:416
#9 Concrete\Core\Page\Theme\Theme:getByID in C:\PROJEKTY\C5\tronixwww\updates\concrete5.7.0.4\concrete\controllers\single_page\dashboard\pages\themes\inspect.php:21
#8 Concrete\Controller\SinglePage\Dashboard\Pages\Themes\Inspect:view in <#unknown>:0
#7 call_user_func_array in C:\PROJEKTY\C5\tronixwww\updates\concrete5.7.0.4\concrete\src\Controller\AbstractController.php:149
#6 Concrete\Core\Controller\AbstractController:runAction in C:\PROJEKTY\C5\tronixwww\updates\concrete5.7.0.4\concrete\src\Routing\DispatcherRouteCallback.php:146
#5 Concrete\Core\Routing\DispatcherRouteCallback:execute in C:\PROJEKTY\C5\tronixwww\updates\concrete5.7.0.4\concrete\src\Application\Application.php:316
#4 Concrete\Core\Application\Application:dispatch in C:\PROJEKTY\C5\tronixwww\updates\concrete5.7.0.4\concrete\bootstrap\start.php:244

and the only option to have themes working is to remove record in database and files from application/themes

shall path in line 6 look like this
/* Import core mixins so we can use them */
@import "../../../../css/build/core/include/mixins.less";

or like this (three dots)

/* Import core mixins so we can use them */
@import ".../../../../css/build/core/include/mixins.less";

I will appreciate further suggestions.
mhawke replied on at Permalink Reply
Sorry... you also have to change the first line in page_theme.php to

namespace Application\Theme\Elementalcustom;

Also, 2 dots.
tronix replied on at Permalink Reply
It is working now.
Thanks a lot :-)
boccko replied on at Permalink Reply
Hi guys, i did (i think so) everything you wrote to make this customtheme work, but when i go into pages & themes from dashboard, I can't install Elementalcustom. It says:
"The theme file page_theme.php does not defines the class Application\Theme\Elementalcustom\PageTheme"

I don't have an idea where am I going wrong?

Help pls
Storyteller replied on at Permalink Reply
Hi, got the same error. The issue seemed to be that it did not like my namespace. After few tweaks I changed it like this in page_theme.php:

namespace Concrete\Theme\signature2015;

namespace Application\Theme\signature2015;
jessJDG replied on at Permalink Reply
Hello, I've followed your instructions (thanks by the way) but I'm still encountering an issue. After installing the elementalcustom theme, I'll return to the homepage and it will give me:

"An unexpected error has occurred. File `../../../../css/build/core/include/mixins.less` not found. in main.less"

Have any suggestions? If it makes a difference, I'm attempting to get this to work locally using MAMP.
pvernaglia replied on at Permalink Reply
Edit your main.less, change it to @import "../../../../concrete/css/build/core/include/mixins.less";
mhawke replied on at Permalink Reply
When developing, make sure your caching is all turned off at 'Dashboard->System and Settings -> Cache and Speed Settings'.
jessJDG replied on at Permalink Reply
Adding concrete/ did the trick! Thought I had tried that, but regardless, thanks!
mhawke replied on at Permalink Reply
Right, sorry... I didn't notice the missing 'concrete/' in tronix's post above. You are just adjusting the relative path so it can find the core mixins.less file.
Willough replied on at Permalink Reply
This helped me as well. Thanks.
tronix replied on at Permalink Reply
I assume you've copied build folder from elemental as well.

I am using development version on WAMP. There should not be any difference in your case.
Please check paths carefully, error must be there.