Jump to content

box-navigation on a side


neti_treves

Recommended Posts

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

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

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

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...