Jump to content

{$NAVIGATION_TREE} disapearing


Danny_cz
 Share

Recommended Posts

Hi, im new to cubeCart and im really interested in!

I will learn how to make my own skin. For learning purposes, i edited main.php into something like this

...
{include file='templates/box.sale_items.php'}
<!--:--><br><br><hr><br><br><p>box.documents.php</p><br>
{include file='templates/box.documents.php'}
<!--:--><br><br><hr><br><br><p>SOCIAL_LIST</p><br>
{$SOCIAL_LIST}
<!--:--><br><br><hr><br><br><p>box.newsletter.php</p><br>
{include file='templates/box.newsletter.php'}
<!--:--><br><br><hr><br><br><p>element.js_foot.php</p><br>
{include file='templates/element.js_foot.php'}
<!--:--><br><br><hr><br><br><p>LIVE_HELP</p><br>
...

so i can see, what each file print on my webpage. Its only change i made for now. No other change were made into code or other php files. In other worlds, i just deleted html structure from main.php. It is just info for you.

Second step were into file box.navigation.php (WHERE I DID NOT MAKE ANY CHANGE), just taked "{$NAVIGATION_TREE}" and paste it into my main.php at the end. Again, for see, what it will print. So, source is looking like this.

...
{include file='templates/element.markup.json-ld.php'}
<!--:--><br><br><hr><br><br><p>modal.exit.php</p><br>
{include file='templates/modal.exit.php'}
<!--:--><br><br><hr><br><br><p></p><br>
{$NAVIGATION_TREE}
   </body>
</html>

OK, and now what is my problem. When i open homepage, it is working how i expect.

unt1.jpg

"menu" will apear, its clickable etc.. just everything is fine. But if I refresh page or click this link, next time some page loads with this layout, this link at the end of page will disapear and only way to bring it back is click "clear cache" in administration panel. Than my "new menu" will be there again just for once, until refresh. Im asking, wtf why?

There is another interesting thing. When i clear cache and open index.php which will lead to open page like you can see in screenshot, when i inspect page source of whole page in web broswer, there is nothing like menu item "test category" at the end of site. But if I mark end of page with mouse, and select "view selection source", my "test category" is there.

View page source -

...words%5D={search_term}&_a=category","query-input":"required name=search_term"}}</script></body></html>

View selection source when is marked with mouse -

words%5D={search_term}&_a=category","query-input":"required name=search_term"}}</script><br><br><hr><br><br><p>modal.exit.php</p><br><br><br><hr><br><br><p></p><br><li class="has-dropdown"><a href="/cubecart/test-category" title="Test Category">Test Category</a></li></body></html>

Source codes are from broswer, from same page, without refresh between it. Only diference is whole page source/selection source code.

 

Im using cubecart v6, running localy on windows10/wamp and using firefox.

Link to comment
Share on other sites

Welcome Danny_cz! Glad to see you made it to the forums.

CubeCart will create the entire Top Nav Bar and cache it. This saves a lot of time - especially if the Nav Bar contents do not change.

When getting everything ready to be displayed, the cached Top Nav Bar is given to the Smarty variable $CATEGORIES. The box.navigation.php template tests for $CATEGORIES and will incorporate that (already-compiled HTML) into the final page, instead of compiling the <nav> block. $CATEGORIES does incorporate $NAVIGATION_TREE.

However, let's look at /classes/gui.class.php, the private function _displayNavigation() near line 1154. Here we see that CubeCart will look for the already-built Top Nav Bar in the cache, and if found, will send $content directly to Smarty CATEGORIES. CubeCart will not execute the code that builds the navigation tree nor execute the code that gives anything to Smarty NAVIGATION_TREE.

 

Edited by bsmither
Link to comment
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.

 Share

×
×
  • Create New...