Attribute and Sorting
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!
Re: Attribute and Sorting
The only thing that is wrong is the naming of the view parameter. It's different in the class and in the template. Please change it in your _setViewParams() method to "submenuItems" so it matches what the view expects.Metalics wrote: To display the current sub-categories in product list page, i followed your method and added a new subpart with name Submenu. (catalog/list/submenu)
- I added a new folder with name Submenu inside /client/html/src/Client/Html/Catalog/List
- I edited the Default.php file in this directory as: private $_subPartNames = array( 'head', 'submenu', 'quote', 'promo', 'pagination', 'items', 'pagination' );
- I added a Default.php file in the new "Submenu" folder and added your code > You can see HERE
- I added 2 files in /client/html/layouts/catalog/list with name submenu-body-default.html and submenu-header-default.html. You can see submenu-header-default.html HERE and submenu-body-default.html HERE submenu-body-default.html file HERE.
But i still can not see current subcategories in catalog list page. Am i missing anything? Can you please advice?
Furthermore, you should move your new files to your own extension. Otherwise, they will be removed and you will loose them after the next update. Adding the new subpart can be done via configuration. How to create an extension for TYPO3 can be found in this article: https://aimeos.org/docs/TYPO3/Extend_Aimeos
Re: Attribute and Sorting
I changed the view parameter in _setViewParams() method to "submenuItems" but still nothing:
protected function _setViewParams( MW_View_Interface $view, array &$tags = array(), &$expire = null )
{
if( !isset( $this->_cache ) )
{
$controller = Controller_Frontend_Factory::createController( $this->_getContext(), 'catalog' );
$view->submenuItems = $controller->getCatalogTree( $view->param( 'f_catid' ), array( 'text', 'media' ), MW_Tree_Manager_Abstract::LEVEL_LIST );
$this->_cache = $view;
}
return $this->_cache;
}
I am sorry if im boring you by insisting on that but we are building a really large website and we will need 1 level down subcategory links in a category.
protected function _setViewParams( MW_View_Interface $view, array &$tags = array(), &$expire = null )
{
if( !isset( $this->_cache ) )
{
$controller = Controller_Frontend_Factory::createController( $this->_getContext(), 'catalog' );
$view->submenuItems = $controller->getCatalogTree( $view->param( 'f_catid' ), array( 'text', 'media' ), MW_Tree_Manager_Abstract::LEVEL_LIST );
$this->_cache = $view;
}
return $this->_cache;
}
I am sorry if im boring you by insisting on that but we are building a really large website and we will need 1 level down subcategory links in a category.
Re: Attribute and Sorting
Is the "f_catid" parameter part of the URL? You should add some debug code to your methods to see if they are called and what's the result of the getCatalogTree() method.Metalics wrote:I changed the view parameter in _setViewParams() method to "submenuItems" but still nothing:Code: Select all
$view->[b]submenuItems [/b]= $controller->getCatalogTree( $view->param( 'f_catid' ), array( 'text', 'media' ), MW_Tree_Manager_Abstract::LEVEL_LIST );