Custom theme not getting used

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
User avatar
whatdaro
Posts: 42
Joined: 19 May 2021, 17:48

Custom theme not getting used

Post by whatdaro » 22 May 2022, 08:54

Laravel: 9.13.0
Aimeos: 2022.04
PHP: 8.1.6
DB: MariaDB 15.1

Custom theme/ext not loading.
This is a complete new install of the sample shop. I've followed the instructions to create an ext and also copy the existing theme to mytheme's (abc) own folder

"cp -r ./themes/client/html/default/ ./themes/client/html/abc/"

When I run "composer update" the theme contents get copied to the /public/vendor/shop/themes/abc" folder.

However the page does not use the custom theme files.

I've added the entry to the config/shop.php as per below and tried different variations of the baseurl path, but none get picked up.


'client' => [
'html' => [
'basket' => [
'cache' => [
// 'enable' => false, // Disable basket content caching for development
],
],
'common' => [
'cache' => [
// 'force' => true // enforce caching for logged in users
],
'template' => [
'baseurl' => './public/vendor/shop/themes/abc'
],
],

Could you please advice what else needs to be done to use a custom theme, thanks.

cyberdev
Posts: 14
Joined: 06 May 2022, 09:10

Re: Custom theme not getting used

Post by cyberdev » 22 May 2022, 15:47

you are using wrong infrastructure ;) firstly download Laravel theme Extension instead of aimeos extenstion.
https://aimeos.org/extensions
And then put the extracted files in packages directory of the root..
https://aimeos.org/docs/latest/laravel/themes/
after use composer req aimeos-extenstion/themename: "version"
that's it🙃

User avatar
whatdaro
Posts: 42
Joined: 19 May 2021, 17:48

Re: Custom theme not getting used

Post by whatdaro » 23 May 2022, 06:38

Thanks cyberdev,
That was really helpful, now I see where I went wrong. Got my theme working.
Somewhere along the documentation it switches from Laravel to Aimeos extension creating instructions. (I still don't know what the difference is, but I'm using Laravel ext created now).

One more thing to note though, which took me a while to figure out.
The Laravel created extension does not create a cms-page.css or cms-page.js files. Had to manually copy them from the default.
thanks again.

kind regards,

Jay

User avatar
aimeos
Administrator
Posts: 7866
Joined: 01 Jan 1970, 00:00

Re: Custom theme not getting used

Post by aimeos » 23 May 2022, 07:26

The difference between the Laravel Theme extension and the Aimeos extension is that you can switch between different themes in the backend using the Theme extension.

When using the Aimeos extension, you can only overwrite templates and you have to overwrite the base.blade.php and the component header files too if you want to use the CSS/JS files from your Aimeos extension. This is automatically available in the Laravel Theme extensions.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

cyberdev
Posts: 14
Joined: 06 May 2022, 09:10

Re: Custom theme not getting used

Post by cyberdev » 23 May 2022, 08:31

whatdaro wrote: 23 May 2022, 06:38
The Laravel created extension does not create a cms-page.css or cms-page.js files. Had to manually copy them from the default.
e.g if you want to override the cms client template then copy the file from ai-cms-grapesjs/templete/client/html/cms/page/.. to packages/themename/templetes/client/html/cms/page/.... just follow
the same structure and this will override all cms templates,css,js just like normal html client and admin.

Post Reply