Jump to content

Third level category not active (no class="selected") ? Prestashop 1.4.8.3


Recommended Posts

Hi everybody!

 

I've used the Category Block, with only first level showed, as an horizontal menu.

 

But there's a little problem:

 

My last level (last category) doesn't get "active" (no class="selected" added). See picture below to understand it better:

 

 

392895Untitled1.jpg

 

second level = OK third & last level = NOT OK

 

Is something to change/adapt in category-tree-branch.tpl ?

 

Prestashop 1.4.8.3

 

Thank you for your help!

Edited by hitomiie (see edit history)
Link to comment
Share on other sites

would it help with some bits of source code ?

 

The category that sould be highlighted (active category):

 

<!-- Block categories module -->											 							
<div id="categories_block_left" class="block">	
<h4>Categories</h4>
<div class="block_content">
<ul class="tree ">																				

....
<li class="last">
<a href="/fr/4-blessure" title="">Blessure</a></li></ul>

 

(=> the <li> should have a class="selected" added...)

 

i thought that having:

 

<a href="{$node.link}" {if isset($currentCategoryId) && ($node.id == $currentCategoryId)}class="selected"{/if} title="{$node.desc|strip_tags:false|escape:html:'UTF-8'}">{$node.name|escape:html:'UTF-8'}</a>

 

in category-tree-branch.tpl would be enough but apparently not!

Edited by luisaimp (see edit history)
Link to comment
Share on other sites

well, sorry i know you trying to help but...what do you want to check ?

 

Do you want the .tpl files, some source code,.. ?

Should i create more understandable screen caps?

 

if you could navigate on the website, what would you check first to understand my problem?

 

I'm really sorry i can't give any link, my client won't allow it.

Edited by luisaimp (see edit history)
Link to comment
Share on other sites

Thanks for your answer.

I guess the .tpl is category-tree-branch.tpl? Here's the code:

 

 

<li {if isset($last) && $last == 'true'}class="last"{/if}>
<a href="{$node.link}" {if isset($currentCategoryId) && ($node.id == $currentCategoryId)}class="selected"{/if} title="{$node.desc|strip_tags:false|escape:html:'UTF-8'}">{$node.name|escape:html:'UTF-8'}</a>
{if $node.children|@count > 0}
<ul>
{foreach from=$node.children item=child name=categoryTreeBranch}
{if isset($smarty.foreach.categoryTreeBranch) && $smarty.foreach.categoryTreeBranch.last}
{include file="$branche_tpl_path" node=$child last='true'}
{else}
{include file="$branche_tpl_path" node=$child last='false'}
{/if}
{/foreach}
</ul>
{/if}
</li>

 

i guess this bit should be changed to add a class="selected" to highlight my first category level when i'm inside it's third level?

 

($node.id == $currentCategoryId)}class="selected"{/if} 

 

what i'm trying to achieve: add a .selected in the third level, right now it's only added to the first and second level. I would like to get that kind of markup:

 

<ul class="tree ">
<li><a title="" href="/fr/2-produit">Produit</a></li>
<li><a title="" href="/fr/2-sport">Sport</a></li>
<li><a title="" href="/fr/2-blessure"  class="selected"> Blessure = First level category</a>
  <ul>
	 <li><a href=""  class="selected"> Second Level category</a>
		   <ul>
			 <li><a href=""  class="selected"> Third Level category</a>
		  </ul>
	</li>
  </ul>
</li>

Edited by hitomiie (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...