X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   Where can i edit Left Category menu (https://forum.x-cart.com/showthread.php?t=68844)

cyberastore 03-12-2014 04:00 PM

Where can i edit Left Category menu
 
Top menu has its own "top_menu.tpl" file but none for the side menu..
Where can i find/edit the Left Category menu?... :?

cyberastore 03-13-2014 05:34 AM

Re: Where can i edit Left Category menu
 
bump.. i would like to replace it with a custom menu...

qualiteam 03-15-2014 01:56 AM

Re: Where can i edit Left Category menu
 
It depends on what you want to achieve.

\XLite\View\TopCategories is the widget that renders the Categories menu. Depending on the menu mode, it uses different templates from the "[xc5]/skins/default/en/categories/[mode]/" directories.

However, I guess you just want add another block to the side bar. If so, you should create either a new template, or a new widget (the PHP class) and add the
Code:

@ListChild (list="sidebar.first", zone="customer", weight="100")
tag to comments to the file (weight determines the position of the block).

You can read more about the @ListChild tag here:
https://x-cart.atlassian.net/wiki/display/XDD/Templater+lists

"sidebar.first" is the "list" for the left side bar.

cyberastore 03-17-2014 07:13 AM

Re: Where can i edit Left Category menu
 
thanks for the quick reply.. is there a way to pull the sub-categories? can someone please help me with this code..




Code:

<div id="ddsidemenubar" class="markermenu">
<ul>
  {foreach:getCategories(),idx,_category}
<li>
<a rel="{_category.getName()}" href="{buildURL(#category#,##,_ARRAY_(#category_id#^_category.category_id))}" {displayLinkClass(idx,_categoryArraySize,_category):h}>{_category.getName()}</a>

<!--Submenu of category -->
<ul id="{_category.getName()}" class="ddsubmenustyle blackwhite">
<li><a href="sub menu link here">sub menu NAME here 1</a></li>
<li><a href="sub menu link here">sub menu NAME here 2</a></li>

</ul>
 </li>
  {end:}


qualiteam 03-19-2014 05:15 AM

Re: Where can i edit Left Category menu
 
Actually, it already can do this :-)

You just need to switch the widget mode to "tree" by creating a custom module and decorating the "defineWidgetParams()" method in the \XLite\View\TopCategories class as follows:

PHP Code:

/**
     * Define widget parameters
     *
     * @return void
     */
    
protected function defineWidgetParams()
    {
        
parent::defineWidgetParams();

        
$this->widgetParams[static::PARAM_DISPLAY_MODE]->setValue(static::DISPLAY_MODE_TREE);
    } 


This should make the widget to generate HTML for the full categories tree (however, out of the box there are no CSS classes to display the tree properly, so you should add them yourself in your module).


All times are GMT -8. The time now is 08:22 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.