Separate tree, search and attribute from filter component
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Separate tree, search and attribute from filter component
I would like to display categories tree as main menu, attributes lists as right column at list page and display search field in the header section.
I see the only way to do it just by reimplementing this subparts as separate components. Is it right solution for the task or there is better method to deal with this?
I see the only way to do it just by reimplementing this subparts as separate components. Is it right solution for the task or there is better method to deal with this?
Re: Separate tree, search and attribute from filter componen
Which integration are you using?
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
Re: Separate tree, search and attribute from filter componen
I'm using laravel integration.
Re: Separate tree, search and attribute from filter componen
The easiest way is to add the catalog filter components three times in your controller action, each with a different configuration for the subparts. In the template, you can then put the output of each component/subpart at a different place.
You should have a look at the "Page" object in the Aimeos Laravel integration to see how to instantiate components on your own:
https://github.com/aimeos/aimeos-larave ... ge.php#L74
You should have a look at the "Page" object in the Aimeos Laravel integration to see how to instantiate components on your own:
https://github.com/aimeos/aimeos-larave ... ge.php#L74
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
Re: Separate tree, search and attribute from filter componen
I see from your method that this components will be available for a single action only, which is not suitable for my task. I have a global header, so this components should be available on multiple pages. Overriding each action seems to be a bad solution.
I'm thinking about overriding components factory, to make it able to use some sort of aliases.
For example I can specify
client/html/alias/<alias for component>/base/<original_component>
client/html/alias/<alias for component>/override/<original_component_config_option_path>
and configure my page to use 'alias/<alias for component>'. Then the factory will figure out that alias is requested and will populate context config with alias values. After all the factory will produce original component with alias configuration.
What you think?
I'm thinking about overriding components factory, to make it able to use some sort of aliases.
For example I can specify
client/html/alias/<alias for component>/base/<original_component>
client/html/alias/<alias for component>/override/<original_component_config_option_path>
and configure my page to use 'alias/<alias for component>'. Then the factory will figure out that alias is requested and will populate context config with alias values. After all the factory will produce original component with alias configuration.
What you think?
Re: Separate tree, search and attribute from filter componen
Another possible solution is extend base component and override the getSubClientNames() method in way like this.
Component properties are private that's why more elegant solution is not possible, which is a little bit weird. (or component classes are not supposed to be extended?).
UPD:
found a better solution
Component properties are private that's why more elegant solution is not possible, which is a little bit weird. (or component classes are not supposed to be extended?).
Code: Select all
protected function getSubClientNames()
{
return $this->getContext()->getConfig()->get('client/html/catalog/navigation/standard/subparts', ['search']);
}
found a better solution
Code: Select all
<?php
namespace Aimeos\Client\Html\Catalog\Search;
class Factory implements \Aimeos\Client\Html\Common\Factory\Iface
{
public static function createClient( \Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $name = null )
{
$context->getConfig()->set('client/html/catalog/filter/standard/subparts', ['search'] );
return \Aimeos\Client\Html\Catalog\Filter\Factory::createClient($context, $templatePaths, $name);
}
}
Re: Separate tree, search and attribute from filter componen
Hi devyk,
Can you post the complete solution implementation as I am also trying to achieve the same but not so experienced with the aimeos yet.
Thanks in advance/
Mubashir
Can you post the complete solution implementation as I am also trying to achieve the same but not so experienced with the aimeos yet.
Thanks in advance/
Mubashir
Re: Separate tree, search and attribute from filter componen
The parts of the catalog/filter component are already available as single components:
- catalog/attribute
- catalog/search
- catalog/tree
Please have a look into the docs how you can use them in your pages:
https://aimeos.org/docs/Laravel/Adapt_pages
- catalog/attribute
- catalog/search
- catalog/tree
Please have a look into the docs how you can use them in your pages:
https://aimeos.org/docs/Laravel/Adapt_pages
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
Re: Separate tree, search and attribute from filter componen
Thanks, now i can create new components .
However in order to get it working I added missing 'getBody()' function in client's Standard.php
files .
However in order to get it working I added missing 'getBody()' function in client's Standard.php
files .
Re: Separate tree, search and attribute from filter componen
Which HTML client are you talking about?
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