Overwriting templates
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!
-
- Posts: 8
- Joined: 04 Feb 2019, 08:11
Overwriting templates
Hi,
I'm not sure if we're getting the way we have to overwrite templates correctly, would be nice if someone could shed some light on this We are listing the templates we are overwriting in the shop config "client, html, <component>" array structure, but it seems to be a bit unclear on how we have to build up the array to overwrite the correct template.
For instance right now we are trying to overwrite the template:
ai-client-html/client/html/templates/catalog/filter/tree-standard.php
Which is the filter category list. How do we need to build up the array structure?
We have tried things like:
But to no success, or a serious amount of hit and miss Can someone ellaborate a little on how the structure is supposed to be set up? We have successfully overwritten other templates with trial and error but with partials it seems to be a bit unclear naming wise.
I'm not sure if we're getting the way we have to overwrite templates correctly, would be nice if someone could shed some light on this We are listing the templates we are overwriting in the shop config "client, html, <component>" array structure, but it seems to be a bit unclear on how we have to build up the array to overwrite the correct template.
For instance right now we are trying to overwrite the template:
ai-client-html/client/html/templates/catalog/filter/tree-standard.php
Which is the filter category list. How do we need to build up the array structure?
We have tried things like:
Code: Select all
'client' => [
'html' => [
'filter' => [
'tree' => [
'standard' => [
'template-body' => resource_path('views/catalog/filter/tree-body-standard.php'),
],
'partials' =>
[
'tree' => [
'template-body' => resource_path('views/catalog/filter/tree-standard.blade.php')
]
]
],
]
]
Last edited by KevinPopkorn on 04 Feb 2019, 10:12, edited 1 time in total.
Re: Overwriting templates
Youve' missed the "catalog" part, it's 'client/html/catalog/filter/tree/standard/template-body' and 'client/html/catalog/filter/partials/tree':
- https://github.com/aimeos/ai-client-htm ... rd.php#L98
- https://github.com/aimeos/ai-client-htm ... rd.php#L80
But you don't have to overwrite the configuration. If you copy the template you want to overwrite from:
./ext/ai-client-html/client/html/templates/catalog/filter/tree-body-standard.php
to
./ext/<yourext>/client/html/templates/catalog/filter/tree-body-standard.php
it will be found automatically and used instead of the original one
- https://github.com/aimeos/ai-client-htm ... rd.php#L98
- https://github.com/aimeos/ai-client-htm ... rd.php#L80
But you don't have to overwrite the configuration. If you copy the template you want to overwrite from:
./ext/ai-client-html/client/html/templates/catalog/filter/tree-body-standard.php
to
./ext/<yourext>/client/html/templates/catalog/filter/tree-body-standard.php
it will be found automatically and used instead of the original one
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
-
- Posts: 8
- Joined: 04 Feb 2019, 08:11
Re: Overwriting templates
Hi, thanks for the info but I apparently missed Catalog in the copy paste, it is there in our code
We tried adding our own ext but it still didn't seem to want to overwrite the templates, that's why we went with the configuration method instead.
Edit: We did try to use blade templates, not sure if that changes anything?
We tried adding our own ext but it still didn't seem to want to overwrite the templates, that's why we went with the configuration method instead.
Edit: We did try to use blade templates, not sure if that changes anything?
Re: Overwriting templates
For Blade templates, you need the configuration and the extension of the Blade templates must be ".blade.php" instead of only ".php"
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
-
- Posts: 8
- Joined: 04 Feb 2019, 08:11
Re: Overwriting templates
Yes, have the .blade.php but it still refuses to overwrite the partial.
We have it working without blade, but if we try to change it to a blade it doesn't take it.
Edit: Seems there's some special magic going on as it seems to work for my colleague and on production environment but not on my machine
We have it working without blade, but if we try to change it to a blade it doesn't take it.
Edit: Seems there's some special magic going on as it seems to work for my colleague and on production environment but not on my machine
-
- Posts: 8
- Joined: 04 Feb 2019, 08:11
Re: Overwriting templates
This seems like a different issue entirely, my templates seem hard stuck in cache, eventhough I cleared it all through aimeos:cache etc. I don't see my colleague's adjustments that are there in files on my localhost in the rendered page.
-
- Posts: 8
- Joined: 04 Feb 2019, 08:11
Re: Overwriting templates
Update: This command saved the day
php artisan optimize:clear
Seems everything was stuck in cache.
php artisan optimize:clear
Seems everything was stuck in cache.