Jump to content

[blockcategories] underline only for parent's category


MAPVince

Recommended Posts

Hi,

 

First, sorry for my bad english, i'm french ( I tried to found help on french forum but nobody helped me ).

I gonna try to explain my problem as clearly as possible.

 

I use Prestashop on 1.5.4 with module blockcategories. I would like to change css for only parent's category.

 

I'm gonna show you what i really want :

 

1466085010-sans-titre.png

 

Since 5 days i tried to do it without success.

 

Here my HTML ( blockcategories.tpl ) :

<!-- Block categories module -->
<div id="categories_block_left" class="block">
<!--  	<p class="title_block">{l s='Categories' mod='blockcategories'}</p> -->
	<div class="block_content">
		<ul class="tree {if $isDhtml}dhtml{/if}">
		{foreach from=$blockCategTree.children item=child name=blockCategTree}
			{if $smarty.foreach.blockCategTree.last}
				{include file="$branche_tpl_path" node=$child last='true'}
			{else}
				{include file="$branche_tpl_path" node=$child}
				
			{/if}
		{/foreach}
		</ul>
		{* Javascript moved here to fix bug #PSCFI-151 *}
		<script type="text/javascript">
		// <![CDATA[
			// we hide the tree only if JavaScript is activated
			$('div#categories_block_left ul.dhtml').hide();
		// ]]>
		</script>
	</div>
</div>
<!-- /Block categories module -->

category-tree-branch.tpl :

<!-- Tree -->
<li {if isset($last) && $last == 'true'}class="last"{/if}>
<a href="{$node.link|escape:'htmlall':'UTF-8'}" title="Logos {$node.name|escape:'htmlall':'UTF-8'}">
{if ($node.name == "Catégories")} 
	<div class="name_hardtofind"><p>{FrontController::getCategoryName(3)}</p></div>
{else}
{$node.name|escape:'htmlall':'UTF-8'}
({$node.products})
{/if}
</a>
	{if $node.children|@count > 0}
		<ul>
		{foreach from=$node.children item=child name=categoryTreeBranch}
			{if $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>
<!-- /Tree -->

I'll hope found answer here, you're my last chance lol !

 

And i'm really sorry for my bad english ... Everybody knows google trad is bad for traduction

 

 

Link to comment
Share on other sites

It should be possible by adding CSS code like the following:

#categories_block_left ul > li { border-bottom: 1px solid #dcdcdc }
#categories_block_left ul ul { border-top: 1px solid #dcdcdc }

This should add a bottom border on the first level of <li> tags and a top border on the second level of <ul> tags. I haven't tested this code though, so you'll have to test it yourself.

Link to comment
Share on other sites

I added the following to your blockcategories.css in Firebug and it seems to look like the screenshot now:

#categories_block_left ul li { border-bottom: 1px solid #dcdcdc }
#categories_block_left ul ul ul li { border-bottom: none }
#categories_block_left ul ul { padding-top: 10px; border-top: 1px solid #dcdcdc }
#categories_block_left ul ul ul { margin-top: 12px }
#categories_block_left ul ul span.grower { background-position: 0 0 }
Link to comment
Share on other sites

Yes ! That's exactly what i wanted ! Thank you for your precious help ! Since 6 days i try to do it ... I was thinking about change this module many times, i tried to change php , tpl , add function etc ... But i didn't think about change CSS ... Whatever, your help was precious to me because i began to become crazy

Thank you again !

And sorry for my very very bad english !

Link to comment
Share on other sites

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