overwrite template: more than one extension

Questions around the TYPO3 integration and plugins
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
heural
Posts: 58
Joined: 09 Jun 2022, 07:55

overwrite template: more than one extension

Post by heural » 04 Jul 2022, 12:21

Hi Aimeos-Team!

I have two Typo3-Ext (2022, composer/webconfig) with same template for overwriting the original aimeos ():
( .. aimeos_(composer/webconfig)\Resources\Private\Extensions\aimeos_ext(composer/webconfig)\templates\client\html\catalog\detail\body.php) for overwriting but the "first is winning".

I assumed that the ordering in the static template is responsible for the overwriting but it seems that the naming is responsible for that behaviour. aimeos_webconfig is always "winning", if i uninstall then aimeos_composer kicks in.

Is this a bug or cannot we overwriting templates from other custom aimeos-ext.?
Attachments
screenshot-aimeos.local-2022.07.04-14_31_06.png
screenshot-aimeos.local-2022.07.04-14_31_06.png (14.56 KiB) Viewed 2686 times

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

Re: overwrite template: more than one extension

Post by aimeos » 04 Jul 2022, 14:18

If you have installed two custom Aimeos TYPO3 extensions, they are sorted by name because the used keys in ext_localconf.php are:

Code: Select all

0_aimeos // Aimeos extension
1_aimeos_composer // own Aimeos extension
1_aimeos_webconfig // own Aimeos extension
See here for the code in the Aimeos TYPO3 extension:
https://github.com/aimeos/aimeos-typo3/ ... hp#L19-L20

You can change the order of your extensions if you rename "1_aimeos_composer" to "2_aimeos_composer" in typo3conf/ext/aimeos_composer/ext_localconf.php
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

heural
Posts: 58
Joined: 09 Jun 2022, 07:55

Re: overwrite template: more than one extension

Post by heural » 05 Jul 2022, 06:33

This does not work for me. I changed the keys as your described but same effect, aimeos_webconfig is used.

Strange:
I uses 10_ and 20_ as key, but Configuration->Extconf looks

Code: Select all

extDirs
    0_aimeos = EXT:aimeos/Resources/Private/Extensions/
    1_aimeos_webconfig = EXT:aimeos_webconfig/Resources/Private/Extensions/
    2_aimeos_composer = EXT:aimeos_composer/Resources/Private/Extensions/
The static template config has no effect. If I remove a aimeos-own-extension, the template is still used.
I have to uninstall the extension.

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

Re: overwrite template: more than one extension

Post by aimeos » 06 Jul 2022, 07:39

Remember that the ext_localconf.php file is cached by TYPO3. You have to remove and add the extension again in the extension manager to see any effect of your changes.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply