Jump to content
Sign in to follow this  
neti_treves

box-navigation on a side

Recommended Posts

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!

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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().

Edited by bsmither

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

We would like to know what you modified in box.navigation.php.

Share this post


Link to post
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.

Share this post


Link to post
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}

 

Share this post


Link to post
Share on other sites

Remove {$NAVIGATION_TREE} if you never want categories to appear here.

Share this post


Link to post
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....

Share this post


Link to post
Share on other sites
Posted (edited)

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?

Edited by neti_treves

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...