Jump to content

[SOLVED] categories align problem


Recommended Posts

hi there,

 

I change the code to make the categories at the front end centre aligned, but another alignment problem came up, pls check pic.

 

here is the related code :

 

 

/* ————— tmcategories.tpl ————— */

#tmcategories {height:87px;background:url(../img/hr_line.png) 50% 0 no-repeat;}

#tmcategories_inner {height:87px;background:url(../img/hr_line.png) 50% bottom no-repeat;}

#cat {padding:19px 0 0 180px;}

#cat > li {height:50px;float:left;position:relative;}

#cat > li + li {margin:0 0 0 13px;padding:0 0 0 21px;background:url(../img/bullet_categories.png) 0 19px no-repeat;}

#cat > li.last {margin:0 0 0 11px;}

#cat > li > a {display:block;font-family:'Oswald', sans-serif;font-size:31px;color:#4b6a69;text-decoration:none;text-transform:uppercase;}

 

howpost-530598-0-26386500-1378280592_thumb.jpg to fix it?

 

thanks in advance

 

:-)

Link to comment
Share on other sites

i tried this and unfortunately doesnt work, take a look:

DKCnMnF.png


I am afraid I don't know much about coding,

 

is the code &nbsp generated ?

 

or I can delete it in a .tpl or .php page?

 

thanks

 

 

you use some module for these links? it looks like tmcategories

you should edit this module .tpl file

 

can you attach contents of .tpl file here?

Link to comment
Share on other sites

here it is

 

tmcategories.tpl

 

 

<!-- TM Categories -->
<div id="tmcategories">
<div id="tmcategories_inner">
<ul id="cat">
{foreach from=$blockCategTree.children item=child name=blockCategTree}
    {if $smarty.foreach.blockCategTree.index < 25}
        {if $smarty.foreach.blockCategTree.last}
            {include file="$branche_tpl_path" node=$child last='true'}
        {else}
            {include file="$branche_tpl_path" node=$child}
        {/if}
    {/if}
{/foreach}
</ul>
</div>
</div>
<!-- /TM Categories -->
Link to comment
Share on other sites

here is another .tpl 

 

../modules/tmcategories/category-tree-branch.tpl

 

 

 

<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|escape:html:'UTF-8'}">{$node.name|escape:html:'UTF-8'}</a>
{if $node.children|@count > 0}
<ul class="subcat">
{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>
{*
<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|escape:html:'UTF-8'}">{$node.name|escape:html:'UTF-8'}</a>
{if $node.children|@count > 0}
<ul class="subcat">
{foreach from=$node.children item=child}
<li><a href="{$child.link|escape:html:'UTF-8'}">{$child.name|escape:html:'UTF-8'}</a></li>
{/foreach}
</ul>
{/if}
</li>
*}
Link to comment
Share on other sites

or 

 

../themes/theme210/category.tpl

 

 

 

{include file="$tpl_dir./breadcrumb.tpl"}
{include file="$tpl_dir./errors.tpl"}
{if isset($category)}
{if $category->id AND $category->active}
<h1>{strip}
{$category->name|escape:'htmlall':'UTF-8'}
<span>
{if $category->id == 1 OR $nb_products == 0}{l s='There are no products.'}
{else}
{if $nb_products == 1}{l s='There is'}{else}{l s='There are'}{/if} 
{$nb_products} 
{if $nb_products == 1}{l s='product.'}{else}{l s='products.'}{/if}
{/if}
</span>{/strip}
</h1>
{if $scenes}
<!-- Scenes -->
{include file="$tpl_dir./scenes.tpl" scenes=$scenes}
{*
{else}
<!-- Category image -->
{if $category->id_image}
<div class="align_center">
<img src="{$link->getCatImageLink($category->link_rewrite, $category->id_image, 'category')}" alt="{$category->name|escape:'htmlall':'UTF-8'}" title="{$category->name|escape:'htmlall':'UTF-8'}" id="categoryImage" width="{$categorySize.width}" height="{$categorySize.height}" />
</div>
{/if}
*}
{/if}
{if $category->description}
<div class="cat_desc">{$category->description}</div>
{/if}
{if isset($subcategories)}
<!-- Subcategories -->
<div id="subcategories">
<h3>{l s='Subcategories'}</h3>
<ul>
{foreach from=$subcategories item=subcategory}
<li>
<a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}">
{if $subcategory.id_image}
<img src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium')}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />
{else}
<img src="{$img_cat_dir}default-medium.jpg" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />
{/if}
</a><br />
<a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}">{$subcategory.name|escape:'htmlall':'UTF-8'}</a>
</li>
{/foreach}
</ul>
<div class="clearblock"></div>
</div>
{/if}
{if $products}
{include file="$tpl_dir./product-compare.tpl"}
{include file="$tpl_dir./product-sort.tpl"}
{include file="$tpl_dir./product-list.tpl" products=$products}
{include file="$tpl_dir./product-compare.tpl"}
{include file="$tpl_dir./pagination.tpl"}
{elseif !isset($subcategories)}
<p class="warning">{l s='There are no products in this category.'}</p>
{/if}
{elseif $category->id}
<p class="warning">{l s='This category is currently unavailable.'}</p>
{/if}
{/if}
Link to comment
Share on other sites

use this:

<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|escape:html:'UTF-8'}">{$node.name|escape:html:'UTF-8'}</a>{if $node.children|@count > 0}<ul class="subcat">{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>
{*
<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|escape:html:'UTF-8'}">{$node.name|escape:html:'UTF-8'}</a>
{if $node.children|@count > 0}
<ul class="subcat">
{foreach from=$node.children item=child}
<li><a href="{$child.link|escape:html:'UTF-8'}">{$child.name|escape:html:'UTF-8'}</a></li>
{/foreach}
</ul>
{/if}
</li>
*}

i removed all spaces, before you apply changes to file, make sure that you've got force compilation ON and cache OFF under adv. pref. > performance tab in BO

Link to comment
Share on other sites

use this:

<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|escape:html:'UTF-8'}">{$node.name|escape:html:'UTF-8'}</a>{if $node.children|@count > 0}<ul class="subcat">{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>
{*
<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|escape:html:'UTF-8'}">{$node.name|escape:html:'UTF-8'}</a>
{if $node.children|@count > 0}
<ul class="subcat">
{foreach from=$node.children item=child}
<li><a href="{$child.link|escape:html:'UTF-8'}">{$child.name|escape:html:'UTF-8'}</a></li>
{/foreach}
</ul>
{/if}
</li>
*}

i removed all spaces, before you apply changes to file, make sure that you've got force compilation ON and cache OFF under adv. pref. > performance tab in BO

 

I see if that work too!

 

thank you very much!

 

:-)

Link to comment
Share on other sites

×
×
  • Create New...