neti_treves Posted February 23, 2019 Share Posted February 23, 2019 Hi, does anyone know if there is a way to display all the categories' tree (the box-navigation usually in the topbar) on a sidemenu (like box-featured or box-popular) thanks! Link to comment Share on other sites More sharing options...
bsmither Posted February 23, 2019 Share Posted February 23, 2019 There is this: https://www.cubecart.com/extensions/plugins/vertical-navigation-box Link to comment Share on other sites More sharing options...
neti_treves Posted February 24, 2019 Author Share Posted February 24, 2019 Thanks, but I am actually trying do something by myself.... I would reformulate my question like this: how/where do I edit the content of $CATEGORIES which appears in templates/box.navigation.php? Thanks Link to comment Share on other sites More sharing options...
bsmither Posted February 24, 2019 Share Posted February 24, 2019 CubeCart uses the template element.navigation_tree.php to create the list of items. This HTML snippet is then given to {$NAVIGATION_TREE} in the template box.navigation.php. This finalized navigation HTML structure is then cached. When building the next page, if the navigation structure can be found in the cache, it is given to {$CATEGORIES}. Most of the code to populate the nav menu templates is at /classes/gui.class.php, private function _displayNavigation(). Link to comment Share on other sites More sharing options...
neti_treves Posted March 3, 2019 Author Share Posted March 3, 2019 Thank you for the answer. I modified the first condition in box.navigation.php in order to let the documents appear in the navigation row.... however, it appears to behave randomly. I think it's a cache problem but I don't really know how to solve it Normally only the documents (About, Contact, ecc) ar visible, but sometimes I refresh and the normal category menu appears as well despite it's not included in the box.navigation.php executed code. Any ideas? (of course I already tried to reset the cache...) Thanks Link to comment Share on other sites More sharing options...
bsmither Posted March 3, 2019 Share Posted March 3, 2019 We would like to know what you modified in box.navigation.php. Link to comment Share on other sites More sharing options...
neti_treves Posted March 3, 2019 Author Share Posted March 3, 2019 The first IF condition {if $CATEGORIES_NO} {$CATEGORIES} {else} The rest is the same... Link to comment Share on other sites More sharing options...
bsmither Posted March 3, 2019 Share Posted March 3, 2019 You have renamed the variable to something that (presumably) does not exist. Therefore, always false. That means the <nav> block will always be used - relying on the existence of {$NAVIGATION_TREE}. The variable {$NAVIGATION_TREE} will not always be available. In GUI->_displayNavigation(), the <nav> block gets cached. For the second showing, the cache is read and the contents given to $CATEGORIES -- which you are no longer using. Link to comment Share on other sites More sharing options...
neti_treves Posted March 3, 2019 Author Share Posted March 3, 2019 Yes, I want the nav block to be used. The problem is that within it also the $CATEGORIES are displayed! As if product categories where the same as documents The weird aspect is that it does it really randomly.... there is no rule! I'll post the whole code chunk so it's clearer.... The bottom part is well commented and it shouldn't make any problem, right? {if $CATEGORIES_NO} {$CATEGORIES} {else} <nav class="top-bar category-nav" data-topbar="" id="box-navigation"> <ul class="title-area"> <li class="name"></li> <li class="toggle-topbar left"><a href="">{$LANG.navigation.menu}<svg class="icon"><use xlink:href="#icon-caret-down"></use></svg></a></li> </ul> <section class="top-bar-section"> <h5 class="hide">{$LANG.navigation.title}</h5> <ul itemscope itemtype="http://www.schema.org/SiteNavigationElement" class="left"> <li itemprop="name" class="show-for-medium-up"><a itemprop="url" href="{$ROOT_PATH}" title="{$LANG.common.home}"><svg class="icon"><use xlink:href="#icon-home"></use></svg></a></li> {foreach from=$DOCUMENTS item=document} <li><a href="{$document.doc_url}" title="{$document.doc_name}" {if $document.doc_url_openin}target="_blank"{/if}>{$document.doc_name}</a></li> {/foreach} {if isset($CONTACT_URL)} <li><a href="{$CONTACT_URL}" title="{$LANG.documents.document_contact}">{$LANG.documents.document_contact}</a></li> {/if} {$NAVIGATION_TREE} {if $CTRL_CERTIFICATES && !$CATALOGUE_MODE} <li itemprop="name"><a itemprop="url" href="{$URL.certificates}" title="{$LANG.navigation.giftcerts}">{$LANG.navigation.giftcerts}</a></li> {/if} {if $CTRL_SALE} <li itemprop="name"><a itemprop="url" href="{$URL.saleitems}" title="{$LANG.navigation.saleitems}">{$LANG.navigation.saleitems}</a></li> {/if} </ul> </section> {* <div id="top-bar-smartphone"> {$CATEGORIES} </div> *} </nav> {/if} Link to comment Share on other sites More sharing options...
bsmither Posted March 3, 2019 Share Posted March 3, 2019 Remove {$NAVIGATION_TREE} if you never want categories to appear here. Link to comment Share on other sites More sharing options...
neti_treves Posted March 3, 2019 Author Share Posted March 3, 2019 Thanks, last question: what if I do want categories to appear in the top-bar-smartpohne div? If a leave $CATEGORIES it always appear (despite set as display:none; in the css) and the div is bypassed if I insert $NAVIGATION_TREE into it, it doesn't show anything.... Link to comment Share on other sites More sharing options...
neti_treves Posted March 3, 2019 Author Share Posted March 3, 2019 Also.... I cloned box.navigation.php in box.navigation.lateral.php creating a sidemenu for categories. If I delete $NAVIGATION_TREE (or comment it) in box.navigation.php the categories menu disappear also from the sidemenu.... Ho can work the cache so randomly? Link to comment Share on other sites More sharing options...
bsmither Posted March 3, 2019 Share Posted March 3, 2019 Are we still trying to answer the question posed in the first post? If not, then I am not sure what it is exactly you are trying to do. Link to comment Share on other sites More sharing options...
neti_treves Posted March 4, 2019 Author Share Posted March 4, 2019 Actually yes. The main point is this: the cache is assigned randomly, and I don't get why sometimes it's there and sometimes not Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.