[Solved] What can "params" really do?
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!
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
[Solved] What can "params" really do?
In the filter tree templates there is this code section:
In my setup there is a property, which I can get via
Can i use the params attribute to pass it on to the template? And if so, how?
(As an object like
{ "cssClass": $item->get['css-class'] }
would be great...)
Code: Select all
<?php if( count( $item->getChildren() ) > 0 ) : ?>
<?= $this->partial(
$this->config(
'client/html/catalog/filter/partials/tree',
'catalog/filter/navigation/tree-partial-standard'
),
[
'nodes' => $item->getChildren(),
'path' => $this->get( 'path', map() ),
'level' => $this->get( 'level', 0 ) + 1,
'params' => $this->get( 'params', [] ). // <== how can I pass on stuff?
]
); ?>
<?php endif; ?>
Code: Select all
$item->get['css-class']
(As an object like
{ "cssClass": $item->get['css-class'] }
would be great...)
Last edited by rowild on 31 Oct 2020, 08:56, edited 1 time in total.
Re: What can "params" really do?
Don't use the "params" argument for passing additional data to the partial because "params" is used to build the URLs.
Instead, you can pass additional data using an additional arbitrary name, e.g.:
Then, the data will be available in the partial using
Instead, you can pass additional data using an additional arbitrary name, e.g.:
Code: Select all
<?= $this->partial(
$this->config(
'client/html/catalog/filter/partials/tree',
'catalog/filter/navigation/tree-partial-standard'
),
[
'nodes' => $item->getChildren(),
'path' => $this->get( 'path', map() ),
'level' => $this->get( 'level', 0 ) + 1,
'params' => $this->get( 'params', [] ),
'css' => $item->getConfig()
]
); ?>
Code: Select all
$this->get( 'css', [] );
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