Page 1 of 1

Changing Template Path...

Posted: 24 May 2018, 16:11
by asfga
Hey guys!

I am trying to customize the aimeos extension for TYPO3 but I have my problems with changing the template path for e.g. the category list. I read that I need to download a customize extension of aimeos which I did and put it in typo3conf/ext. Now I copied all templates which I want to customize from the aimeos extension to my own and changed some code.

And now what's next? I tried to write something in my main setup file but didn't work:

Code: Select all

plugin.tx_aimeos.settings.client.html.catalog.lists.standard.template-body = /typo3conf/ext/aimeos_custom/client/html/catalog/lists/body-standard.php
Can anyone of you give me some hint here?
I also saw in the TYPO3 TyposcriptObjectBrowser that there is a field for customcss + customjs but I couldn't reach it with typoscript either. What am I overseeing?

Re: Changing Template Path...

Posted: 25 May 2018, 08:59
by tenkraD
hi, u forgot *items* i believe.
"client/html/catalog/lists/items/standard/template-body = catalog/lists/items-body-standard.php"
see here https://aimeos.org/docs/Configuration/C ... plate-body

and instead of typoscript value plugin.tx_aimeos.settings.client.html.catalog.lists.standard.template-body i would register it in /*your extension*/Ressources/Private/Extensions/*your extension*/config/client.php

Code: Select all

<?php
return [
	'html' => [
		'client' => [
			'html' => [
				'catalog' => [
					'lists' => [
						'items' => [
							'standard' [
 							                   'template-body' => 'YourNewTemplateName'		
							]
						]
					]
				]
			]	
		]
	],
	'jsonapi' => [
	],
];

Re: Changing Template Path...

Posted: 25 May 2018, 11:41
by aimeos
To overwrite existing templates with the same name, you don't need any configuration. Only copy the template into the same directory structure in your Aimeos TYPO3 extension (./Resources/Private/Extensions/<extname>/client/html/templates/)

Re: Changing Template Path...

Posted: 25 May 2018, 11:53
by asfga
Thanks for the quick response! I don't want to change the thing with the items, just the main body-template of the list (https://aimeos.org/docs/Configuration/C ... plate-body).

My code looks like this now:
in main setup.t3s:

Code: Select all

plugin.tx_aimeos.settings.client.catalog.lists.standard.template-body = catalog/lists/body-standard.php
in typo3conf/ext/aimeos_custom/config/client.php:

Code: Select all

<?php
return [
	'html' => [
		'client' => [
			'html' => [
				'catalog' => [
					'lists' => [
						'standard' [
							'template-body' => 'body-standard.php'      
						]
					]
				]
			]   
		]
	],
	'jsonapi' => [],
];
But it doesn't work. What I am wondering about is where does the aimeos extension know if it should use a custom template path from another extension or not?

Re: Changing Template Path...

Posted: 25 May 2018, 11:56
by asfga
aimeos wrote:To overwrite existing templates with the same name, you don't need any configuration. Only copy the template into the same directory structure in your Aimeos TYPO3 extension (./Resources/Private/Extensions/<extname>/client/html/templates/)
So you mean I just could edit the default template file? That's what I did but I read not to overwrite default templates and I find it cleaner to use a path to a custom template instead of overwriting the default.

Re: Changing Template Path...

Posted: 25 May 2018, 12:33
by tenkraD
As the admin said if u name your template like the standard one "body-standard.php" you dont need a config file or a setup.ts to register it. Just use the same directory structure in your extension and it will automatically included.
- And no dont edit the default one.
- Copy the default one in your extension, with the same directory structure . edit it and voilĂ 

But if you want give the template a new name you must register it with a config file or setup.ts. And here u cant name it like the default "body-standard.php"!

Perhaps my config was wrong. Try it without html array.

Code: Select all

<?php
return [
      'client' => [
         'html' => [
            'catalog' => [
               'lists' => [
                  'standard' [
                     'template-body' => 'NewTemplateName'      
                  ]
               ]
            ]
         ]   
      ],	
	'jsonapi' => [
	],
];

Re: Changing Template Path...

Posted: 25 May 2018, 14:31
by asfga
tenkraD wrote:Just use the same directory structure in your extension and it will automatically included.
- Copy the default one in your extension, with the same directory structure . edit it and voilĂ 
Ok there must be a point which I miss.

I deleted now the added things in the config + setup. All I have is the installed aimeos extension, in my "typo3conf > ext" I have the custom extension from the downloader called aimeos-custom and copied the file "catalog > lists > body-standard.php" from the original aimeos extension to my custom extension in "client > html > catalog > lists" and edited it. But in browser only the default file is shown.

Re: Changing Template Path...

Posted: 25 May 2018, 16:20
by tenkraD
Just to get clear:
- 1.) For Your Aimeos extension, build with the extensionbuilder from aimeos, You have choosen the Aimeos Version witch matches your Typo3 Version.
- 2.) Your extension is in typo3conf/ext/ directory and u have activated your extension in the typo3 extension manager
- 3.) You have copied the "body-standard.php" file from aimeos extension /typo3conf/ext/aimeos/Resources/Private/Extensions/ai-client-html/client/html/templates/catalog/lists/body-standard.php to /typo3conf/ext/<yourExtensionName>/Resources/Private/Extensions/<yourExtensionName>/client/html/templates/catalog/lists/body-standard.php
- 4.) You edited the body-standard file in /typo3conf/ext/<yourExtensionName>/Resources/Private/Extensions/<yourExtensionName>/client/html/templates/catalog/lists/body-standard.php

and its not working?

Re: Changing Template Path...

Posted: 26 May 2018, 09:49
by aimeos
You created a bare Aimeos extension instead of an Aimeos TYPO3 extension and copied that to your ./typo3conf/ext/ folder. That doesn't work. Create a TYPO3 extension instead and copy your templates you want do modify into ./typo3conf/ext/<extname>/Resources/Private/Extensions/<extname>/client/html/templates/

Re: Changing Template Path...

Posted: 28 May 2018, 19:38
by asfga
Ah ok thanks for the clarification. When I want to upload the custom aimeos folder, the typo3 extension manager throws an error saying "Extension aimeos-custom is not available". Guess I have to handle this until it finally works