Locating components / templates
Forum rules
Always add your Symfony, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Symfony, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Locating components / templates
I am having a bit of a problem understanding where certain function take place.
For example if I want to change the format for {% block aimeos_nav %}{% endblock %}
I can find the templates and I understand how to overwrite them, and I can find the views and how to overwite them, but I can't figure out where blocks aimeos_nav or aimeos_body etc. are located or how I would overwrite it.
For example if I want to change the format for {% block aimeos_nav %}{% endblock %}
I can find the templates and I understand how to overwrite them, and I can find the views and how to overwite them, but I can't figure out where blocks aimeos_nav or aimeos_body etc. are located or how I would overwrite it.
Re: Locating components / templates
You must understand that Aimeos consists of different components, the core is a PHP library and the Symfony bundle using it. The core itself consists of a few composer packages, e.g. one that renders the HTML blocks which are included in the Twig templates (ai-client-html). Here's the software stack of the core:
https://aimeos.org/docs/Developers/Software_stack
The HTML is generated by these templates:
https://github.com/aimeos/ai-client-htm ... /templates
To overwrite or extend them, you need to copy those you want to change in your own project-specific Aimeos extension:
https://aimeos.org/docs/Developers/Create_an_extension
https://aimeos.org/docs/Developers/Software_stack
The HTML is generated by these templates:
https://github.com/aimeos/ai-client-htm ... /templates
To overwrite or extend them, you need to copy those you want to change in your own project-specific Aimeos extension:
https://aimeos.org/docs/Developers/Create_an_extension
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: 5
- Joined: 20 Nov 2017, 12:58
Re: Locating components / templates
Can you more explane this?aimeos wrote:You must understand that Aimeos consists of different components, the core is a PHP library and the Symfony bundle using it. The core itself consists of a few composer packages, e.g. one that renders the HTML blocks which are included in the Twig templates (ai-client-html). Here's the software stack of the core:
https://aimeos.org/docs/Developers/Software_stack
The HTML is generated by these templates:
https://github.com/aimeos/ai-client-htm ... /templates
To overwrite or extend them, you need to copy those you want to change in your own project-specific Aimeos extension:
https://aimeos.org/docs/Developers/Create_an_extension
Working on "symfony/symfony": "3.3.*","aimeos/aimeos-symfony": "~2017.10", PHP Version 5.6.29, Window 8.
I see template in my_project\ext\ai-client-html\client\html\templates, try edit him - but changes not show in the front end. Directory my_project\vendor\aimeos\aimeos-core\misc\ext-template\client\html\templates is empty(
Coppied ai-client-html directory to app/Resources and single directories from ai-client-html\client\html\templates.
Edit my config client:
html:
catalog:
basket:
mini:
template-body: basket/mini/body-default.html.twig
My custom class not shown.
What i do wrong?
Re: Locating components / templates
Caching is enabled by default as long as you don't disable it during development. Add this to your ./app/config/config.yml (four spaces per level) to disable caching:
The basket is cached too until it's updated as long as you don't disable caching for this as well:
https://aimeos.org/docs/Configuration/C ... che/enable
You can find more how to set configuration options here:
https://aimeos.org/docs/Symfony/Change_configuration
Code: Select all
aimeos_shop:
madmin:
cache:
manager:
name: None
https://aimeos.org/docs/Configuration/C ... che/enable
You can find more how to set configuration options here:
https://aimeos.org/docs/Symfony/Change_configuration
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: 5
- Joined: 20 Nov 2017, 12:58
Re: Locating components / templates
Thank you for the answer - but it's not working.
Added example of code to my config, clear cache for project, use dev environment.
Can you tell full path to template in core, example project\vendor\aimeos\aimeos-core ...
also full path to directory where i must copy this template, exapmle project\app\Resources\AimeosBundle\...
I think i did wrong copy(
Added example of code to my config, clear cache for project, use dev environment.
Can you tell full path to template in core, example project\vendor\aimeos\aimeos-core ...
also full path to directory where i must copy this template, exapmle project\app\Resources\AimeosBundle\...
I think i did wrong copy(
Re: Locating components / templates
For example, the template for the catalog list view is in ./ext/ai-client-html/client/html/templates/catalog/lists/body-default.php
You have to generate your own project-specific Aimeos extension and place it in the ./ext/ folder to, e.g. named "myproject". Then, you have to copy the template you want to overwrite (e.g. the catalog list template) to ./ext/myproject/client/html/templates/catalog/lists/body-default.php
You have to generate your own project-specific Aimeos extension and place it in the ./ext/ folder to, e.g. named "myproject". Then, you have to copy the template you want to overwrite (e.g. the catalog list template) to ./ext/myproject/client/html/templates/catalog/lists/body-default.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: 5
- Joined: 20 Nov 2017, 12:58
Re: Locating components / templates
Added to config.yml
aimeos_shop:
client:
html:
basket:
mini:
template-body: basket/mini/body-default.html.twig
Added class for test in symshop\ext\ai-client-html\client\html\templates\basket\mini\body-default.php then copied them to symshop\ext\symshop\client\html\templates\basket\mini\, changed new template for my design.
After added product to cart (cache: manager: name: None - not working) i can see changes, but i see file from core aimeos((
Something wrong?
aimeos_shop:
client:
html:
basket:
mini:
template-body: basket/mini/body-default.html.twig
Added class for test in symshop\ext\ai-client-html\client\html\templates\basket\mini\body-default.php then copied them to symshop\ext\symshop\client\html\templates\basket\mini\, changed new template for my design.
After added product to cart (cache: manager: name: None - not working) i can see changes, but i see file from core aimeos((
Something wrong?
Re: Locating components / templates
If you copy the PHP template file, don't configure the "template-body" setting. This is not necessary and you told Aimeos that you want to use the Twig engine for processing the file and this is only valid if you rewrite the file to use the Twig syntax.
The mini basket component has an additional caching mechanism in the session of the user. It's only updated if you change the products in the basket or their quantity or by setting this configuration to 0:
https://aimeos.org/docs/Configuration/C ... che/enable
The mini basket component has an additional caching mechanism in the session of the user. It's only updated if you change the products in the basket or their quantity or by setting this configuration to 0:
https://aimeos.org/docs/Configuration/C ... che/enable
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: 5
- Joined: 20 Nov 2017, 12:58
Re: Locating components / templates
Deleted configurated. Not working whatever(
Any else ideas?
Any else ideas?
Re: Locating components / templates
Remove the session cookie from your browser. You will get a new session without cached mini basket
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