Several theme loading views problem
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!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Re: Several theme loading views problem
First of all, 2021.07.x isn't supported any more, only 2021.10.x LTS.
Furthermore, 2021.x was never tested with several themes for different sites in one setup while in 2022.04+ it's officially supported when using PHP templates. We have also no experience if there are any problems when using Blade templates that replace the standard PHP templates as this way is not widely used among Aimeos developers (you can use Laravel objects/functions in the PHP templates too but no Blade syntax).
As you've said before, you've already disabled the Aimeos content cache, so it doesn't seem to be a caching problem which would always be our first guess.
Another problem could be that the client/html templates are not bound to the themes you've installed because they all have the same name and may be loaded by the view in random order and the last one is used. You can test if that's the problem by renaming your overwritten templates and configure their new names in the Locale > Site Option/Value table.
Furthermore, 2021.x was never tested with several themes for different sites in one setup while in 2022.04+ it's officially supported when using PHP templates. We have also no experience if there are any problems when using Blade templates that replace the standard PHP templates as this way is not widely used among Aimeos developers (you can use Laravel objects/functions in the PHP templates too but no Blade syntax).
As you've said before, you've already disabled the Aimeos content cache, so it doesn't seem to be a caching problem which would always be our first guess.
Another problem could be that the client/html templates are not bound to the themes you've installed because they all have the same name and may be loaded by the view in random order and the last one is used. You can test if that's the problem by renaming your overwritten templates and configure their new names in the Locale > Site Option/Value table.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Several theme loading views problem
Most likely, the Laravel Blade template engine chooses the wrong template file because Laravel has no concept of multi-site/multi-tenancy within one installation:
https://github.com/aimeos/ai-laravel/bl ... de.php#L48
https://github.com/aimeos/ai-laravel/bl ... de.php#L48
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Several theme loading views problem
I have a small mutlishop, so I will convert it into my own controllers and template and use the Aimeos code, then I will have full control over it.
Re: Several theme loading views problem
Another option might be to overwrite the same templates in all theme extensions, i.e. if you need to overwrite ./templates/client/html/catalog/detail/body.php in one extension, you also need to add a copy in every other theme extension so the template files are not mixed between themes.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Several theme loading views problem
But that's how I got it done now and it keeps on mixing.
I had done as you write from the very beginning and there is still a problem.
I had done as you write from the very beginning and there is still a problem.
Re: Several theme loading views problem
Then, it's most likely that the Laravel Blade view integration mixes things up as it doesn't happen when using the Aimeos PHP templates.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Several theme loading views problem
Are you able to fix it ?
Then I have to use Aimeos standalone shop ?Then, it's most likely that the Laravel Blade view integration mixes things up as it doesn't happen when using the Aimeos PHP templates.
Re: Several theme loading views problem
Not sure about that. Laravel may support a file syntax like "mytheme::catalog/detail/body" if you place the .blade.php templates in the ./view/ directory of the theme extensions.
Can you check if it works for one theme if you add the theme name as "<mytheme>::$filename" here (in ./vendor/aimeos/ai-laravel/lib/custom/src/MW/View/Engine/Blade.php, Line 48, replace "<mytheme>" with your theme name):
https://github.com/aimeos/ai-laravel/bl ... de.php#L48
Can you check if it works for one theme if you add the theme name as "<mytheme>::$filename" here (in ./vendor/aimeos/ai-laravel/lib/custom/src/MW/View/Engine/Blade.php, Line 48, replace "<mytheme>" with your theme name):
https://github.com/aimeos/ai-laravel/bl ... de.php#L48
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Several theme loading views problem
$filename variable contains full path for file. Example:
C:\xampp\htdocs\giftcard\vendor\aimeos-themes\sk-theme\client\html\templates\catalog\stage\body-standard.blade.php
C:\xampp\htdocs\giftcard\vendor\aimeos-themes\sk-theme\client\html\templates\catalog\stage\body-standard.blade.php
Re: Several theme loading views problem
If you switch sites with different themes, is the theme name in the file path still the same?
Can you dump "$this->paths" here and check what the array contains when you switch sites with different themes?
https://github.com/aimeos/aimeos-base/b ... #L296-L317
Can you dump "$this->paths" here and check what the array contains when you switch sites with different themes?
https://github.com/aimeos/aimeos-base/b ... #L296-L317
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star