How to change templates

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!
kimholberg
Posts: 29
Joined: 21 Aug 2017, 09:42

How to change templates

Post by kimholberg » 24 Oct 2017, 16:40

On my front page (shop/list) i want to move the bottom text of the product, up on top of the product image.

So, i have created an extension via Aimeos extension builder named: ai-myname and placed this in the Extension folder of Neos.

Then i copied the templates from client/html/templates and placed them in the same position in my extension.

Then i tried to move the html code from various templates to be before the image section:

Code: Select all

				<div class="text-list">
					<h2 itemprop="name"><?= $enc->html( $productItem->getName(), $enc::TRUST ); ?></h2>
					<?php foreach( $productItem->getRefItems( 'text', 'short', 'default' ) as $textItem ) : ?>
						<div class="text-item" itemprop="description">
							<?= $enc->html( $textItem->getContent(), $enc::TRUST ); ?><br/>
					</div>
					<?php endforeach; ?>
				</div>


This does not seem to make any changes to the output. In your documentation you write:

"Extensions that depend on the core and contain PHP template files in the client/html/templates/ directory named the same as existing ones are used first."

So i asumed that any change in my extension would change the output, but can you please explain which template i should work in, for the front page of the shop.

Thanks...
Neos 3.2.0 - Bitnami AWS C2 - Aimeos 2017-10.1

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

Re: How to change templates

Post by aimeos » 25 Oct 2017, 09:00

Did you cleared the Aimeos content cache (./flow aimeos:cache) or configured no caching for development?
https://github.com/aimeos/aimeos-flow/b ... E.md#hints
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

kimholberg
Posts: 29
Joined: 21 Aug 2017, 09:42

Re: How to change templates

Post by kimholberg » 25 Oct 2017, 18:24

Yes i cleared the caches and also configured to develope with no cache via Settings.yaml file nothing changes.

See image upload of both file tree where i have changed 'items-body-list.php' - but nothing shows any change in either of them.
my extension
my extension
ai-twelveinch.png (40.81 KiB) Viewed 3783 times
aimeos extension
aimeos extension
ai-client-html.png (52.85 KiB) Viewed 3783 times
Can you confirm that this is the file i should change if i want to re-arrange things on the first page of the shop (/shop/list page)
Neos 3.2.0 - Bitnami AWS C2 - Aimeos 2017-10.1

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

Re: How to change templates

Post by aimeos » 26 Oct 2017, 08:34

No, "items-body-list.php" is the alternative list view (texts and price right of the image). The standard list view in generated by the "items-body-default.php" template file.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

kimholberg
Posts: 29
Joined: 21 Aug 2017, 09:42

Re: How to change templates

Post by kimholberg » 26 Oct 2017, 21:26

Thanks for your reply. As far as i could see, i needed to change the products-default in the common templates folder, then a change is happening (did this in ai-client-html). Then i tried to do this in my own extension (called ai-twelveinch) but nothing happends. Why not?
Neos 3.2.0 - Bitnami AWS C2 - Aimeos 2017-10.1

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

Re: How to change templates

Post by aimeos » 27 Oct 2017, 23:23

Can you check if the manifest.php file of your own extension contains "ai-client-html" in the "depends" section?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

kimholberg
Posts: 29
Joined: 21 Aug 2017, 09:42

Re: How to change templates

Post by kimholberg » 28 Oct 2017, 13:20

In my own extension (ai-twelveinch) manifest i have following:

Code: Select all

return array(
	'name' => 'ai-twelveinch',
	'depends' => array(
		'aimeos-core',
		'ai-admin-extadm',
		'ai-admin-jqadm',
		'ai-admin-jsonadm',
		'ai-client-html',
		'ai-client-jsonapi',
		'ai-controller-jobs',
	),
	'include' => array(
		'lib/custom/src',
		'client/html/src',
		'client/jsonapi/src',
		'controller/common/src',
		'controller/frontend/src',
		'controller/extjs/src',
		'controller/jobs/src',
		'admin/jsonadm/src',
		'admin/jqadm/src',
	),
	'i18n' => array(
		'admin' => 'admin/i18n',
		'admin/jsonadm' => 'admin/jsonadm/i18n',
		'controller/common' => 'controller/common/i18n',
		'controller/frontend' => 'controller/frontend/i18n',
		'controller/extjs' => 'controller/extjs/i18n',
		'controller/jobs' => 'controller/jobs/i18n',
		'mshop' => 'lib/custom/i18n',
		'client' => 'client/i18n',
	),
	'config' => array(
		'lib/custom/config',
	),
	'custom' => array(
		'admin/jsonadm/templates' => array(
			'admin/jsonadm/templates',
		),
		'admin/jqadm/templates' => array(
			'admin/jqadm/templates',
		),
		'admin/extjs' => array(
			'admin/extjs/manifest.jsb2',
		),
		'client/html/templates' => array(
			'client/html/templates',
		),
		'client/jsonapi/templates' => array(
			'client/jsonapi/templates',
		),
		'controller/extjs' => array(
			'controller/extjs/src',
		),
		'controller/jobs' => array(
			'controller/jobs/src',
		),
		'controller/jobs/templates' => array(
			'controller/jobs/templates',
			'client/html/templates',
		),
	),
	'setup' => array(
		'lib/custom/setup',
	),
);
Neos 3.2.0 - Bitnami AWS C2 - Aimeos 2017-10.1

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

Re: How to change templates

Post by aimeos » 28 Oct 2017, 21:08

Did you placed the modified "product-default.php" partial into the "client/html/templates/common/partials/" directory of your extension?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

kimholberg
Posts: 29
Joined: 21 Aug 2017, 09:42

Re: How to change templates

Post by kimholberg » 29 Oct 2017, 21:01

Yes the file is there...
Neos 3.2.0 - Bitnami AWS C2 - Aimeos 2017-10.1

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

Re: How to change templates

Post by aimeos » 30 Oct 2017, 14:55

Where is your own extension located in your Flow application?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply