Created a new theme, but it is not recognized

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
User avatar
matish
Posts: 12
Joined: 04 Nov 2025, 11:52

Created a new theme, but it is not recognized

Post by matish » 07 Nov 2025, 17:09

I created a new theme under the ./packages directory.
Partials are recognized just fine and composer updates fine, but CSS and JS files are loaded from default. Also under the admin settings the new theme is not on the list.
Here is a picture that shows, that files themselves are copied correctly.
Image

How does the theme detection work? I could rename the theme to "defaul" but, I think it would not be a proper step.

User avatar
matish
Posts: 12
Joined: 04 Nov 2025, 11:52

Re: Created a new theme, but it is not recognized

Post by matish » 07 Nov 2025, 17:19

Never mind, found it already.
Needed to copy new theme declaration to:
~/packages/notebooks/config/client.php

Code: Select all

<?php

return [
    'html' => [
        'themes' => [
            'notebooks' => 'notebooks',
        ],
    ],
    'jsonapi' => [
    ],
];

User avatar
matish
Posts: 12
Joined: 04 Nov 2025, 11:52

Re: Created a new theme, but it is not recognized

Post by matish » 07 Nov 2025, 17:26

But still some files are loaded from default theme...
I have a file ~/packages/notebooks/themes/client/html/notebooks/aimeos.css

Image

How can I make it so, that all files would be loaded from theme "notebooks"?

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

Re: Created a new theme, but it is not recognized

Post by aimeos » 08 Nov 2025, 11:26

Clear the cache to remove the cached components:

Code: Select all

php artisan aimeos:clear
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
matish
Posts: 12
Joined: 04 Nov 2025, 11:52

Re: Created a new theme, but it is not recognized

Post by matish » 09 Nov 2025, 13:14

aimeos wrote: 08 Nov 2025, 11:26 Clear the cache to remove the cached components:

Code: Select all

php artisan aimeos:clear
Usually I do not write here if it is a cache issue. To me it looks more like some assets are hardcoded.
When I copied "base.blade.php" to "~/resources/views/vendor/shop" directory and changed the contents. then it worked.
But my assumption was that it would also work when it is in a separate package such as "~/packages/notebooks/views/base.blade.php"
But it doesn't.

Picture attached.
Image

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

Re: Created a new theme, but it is not recognized

Post by aimeos » 10 Nov 2025, 10:53

Your "notebook" package contains a "views/base.blade.php", which should be used if you select the theme in the Aimeos backend settings. The view itself references CSS/JS files which are included in your package but they are stored in the themes/default folder and that's the reason why you see the "default" CSS/JS links in the HTML output. The solution is to adapt the "views/base.blade.php" in your "notebook" extension to use the files from the vendor/theme/default you've probably renamed to vendor/theme/notebook.

This is unintuitive and we will change that so the themes directory is already named like your extension and the Blade template references them automatically.

The basket CSS/JS links are cached and you have to remove the session cookie of the browser to get the new version after switching the theme.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

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

Re: Created a new theme, but it is not recognized

Post by aimeos » 10 Nov 2025, 11:19

The base.blade.php has been fixed now. Can you please check if a new extension works out of the box if you switch the theme (basket CSS/JS can still return cached links)?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
matish
Posts: 12
Joined: 04 Nov 2025, 11:52

Re: Created a new theme, but it is not recognized

Post by matish » 10 Nov 2025, 12:42

aimeos wrote: 10 Nov 2025, 11:19 The base.blade.php has been fixed now. Can you please check if a new extension works out of the box if you switch the theme (basket CSS/JS can still return cached links)?
Sorry, but how can I check? I ran composer update, but nothing changed. Also when I check here, the file looks the same.
https://github.com/aimeos/aimeos-larave ... .blade.php

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

Re: Created a new theme, but it is not recognized

Post by aimeos » 10 Nov 2025, 12:55

Please create a new Laravel theme extension here:
https://aimeos.org/extensions
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
matish
Posts: 12
Joined: 04 Nov 2025, 11:52

Re: Created a new theme, but it is not recognized

Post by matish » 10 Nov 2025, 14:30

aimeos wrote: 10 Nov 2025, 12:55 Please create a new Laravel theme extension here:
https://aimeos.org/extensions
I do not want to create a new extension every time. I would like to know how things work under the hood. Anyway I checked for the diff and found out that this was the only changed file.
Of course a huge load of files were also present under the ~/notebooks/views that are not included on my plugin (except for the base.blade.php). I am assuming that only those files need to be included, which are different from the default. If that is not the case, then I would say, it is not a very good design.

But end result is that it is not working.
If I copy ~/packages/notebooks/views/base.blade.php to /resources/views/vendor/shop/base.blade.php then it works immediately. Even without refreshing cache.
Each test was performed in incognito browser, so cookies and sessions should not be an issue.

Picture of the folder layouts:
Image

Post Reply