Jump to content

Tronquer le nombre de caractères au survol souri des catégories


Recommended Posts

Bonjour,

je cherche à limiter, voir supprimer la description au survol de la souri sur le bloc "catégorie".

J'ai bien trouvé des posts sur les produits mais, là, je nage...

Voir photo.

 

Merci de vos réponses.

PS: J'utilise un thème différent de celui d'origine.

Version 1.5.4.1

 

post-96811-0-80426300-1376224500_thumb.png

Link to comment
Share on other sites

Bonjour,

 

Pour modifier çela il faut créer le fichier tpl du module blockcategorie en override dans le répertoire module de votre template.

Chercher le lien du menu catégorie et virer l'option title="" pour retirer ce qui s'affiche au survol.

Link to comment
Share on other sites

Bonjour,

 

Pour modifier çela il faut créer le fichier tpl du module blockcategorie en override dans le répertoire module de votre template.

Chercher le lien du menu catégorie et virer l'option title="" pour retirer ce qui s'affiche au survol.

 

J'ai ça dans category-tree-branch.tpl

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

 

Je peux aussi le tronquer?

Si oui, avec quelle variable?

Si je veux supprimer, je supprime quoi au juste?

Merci Jeckyl

Link to comment
Share on other sites

bonjour,

 

plutôt avec un truncate au niveau du Title=""

 

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

 

j'ai ajouté |truncate:12:'...' dans l'exemple !

Link to comment
Share on other sites

bonjour,

 

plutôt avec un truncate au niveau du Title=""

 

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

 

j'ai ajouté |truncate:12:'...' dans l'exemple !

 

Salut Stéphane, tu est certain que le truncate doit être en début et non à la fin afin de traiter la chaine coder convenablement en utf-8 et ne pas considérer à tord les accents comme correspondant à 6 caractères ?

Link to comment
Share on other sites

Merci, mais dans les deux cas, ça ne marche pas...

Je ne modifie peut-être pas le bon fichier tpl.

 

Dans montheme/modules/blockcategories/category-tree-branch.tpl j'ai:

 

<li {if isset($last) && $last == 'true'}class="last"{/if}>
<a href="{$node.link|escape:'htmlall':'UTF-8'}" {if isset($currentCategoryId) && $node.id == $currentCategoryId}class="selected"{/if} title="{$node.desc|truncate:12:'...'|escape:'htmlall':'UTF-8'}">{$node.name|truncate:12:'...'|escape:'htmlall':'UTF-8'}</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>

 

Dans montheme/modules/blockcategories/blockcategories.tpl j'ai:

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

 

Dans montheme/modules/blockcategories/blockcategories_footer.tpl j'ai:

<!-- Block categories module -->
<div class="blockcategories_footer">
<p class="title_block">{l s='Categories' mod='blockcategories'}</p>
<div class="category_footer" style="width:{$widthColumn}%">
<div class="list">
 <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}

  {if ($smarty.foreach.blockCategTree.iteration mod $numberColumn) == 0 AND !$smarty.foreach.blockCategTree.last}
 </ul>
</div>
</div>
<div class="category_footer" style="float:left;clear:none;width:{$widthColumn}%">
 <div class="list">
 <ul class="tree {if $isDhtml}dhtml{/if}">
  {/if}
  {/foreach}
 </ul>
</div>
</div>
<br class="clear"/>
</div>
<!-- /Block categories module -->

 

Voici le code dans montheme/category-tree-branch.tpl:

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

 

Voici le code dans montheme/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'}
   {if isset($categoryNameComplement)}
 {$categoryNameComplement|escape:'htmlall':'UTF-8'}
   {/if}
  {/strip}
 </h1>

 {hook h='displayCategory'}
 <div class="resumecat category-product-count">
  {include file="$tpl_dir./category-count.tpl"}
 </div>

 {if $scenes || $category->description || $category->id_image}
 <div class="content_scene_cat">
  {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_default')}" 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">
   {if strlen($category->description) > 120}
 <p id="category_description_short">{$category->description|truncate:120}</p>
 <p id="category_description_full" style="display:none">{$category->description}</p>
 <a href="#" onclick="$('#category_description_short').hide(); $('#category_description_full').show(); $(this).hide(); return false;" class="lnk_more">{l s='More'}</a>
   {else}
 <p>{$category->description}</p>
   {/if}
   </div>
  {/if}
 </div>
 {/if}
 {if isset($subcategories)}
 <!-- Subcategories -->
 <div id="subcategories">
  <h3>{l s='Subcategories'}</h3>
  <ul class="inline_list">
  {foreach from=$subcategories item=subcategory}
   <li class="clearfix">
 <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}" class="img">
  {if $subcategory.id_image}
   <img src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium_default')}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />
  {else}
   <img src="{$img_cat_dir}default-medium_default.jpg" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />
  {/if}
 </a>
 <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" class="cat_name">{$subcategory.name|escape:'htmlall':'UTF-8'}</a>
 {if $subcategory.description}
  <p class="cat_desc">{$subcategory.description}</p>
 {/if}
   </li>
  {/foreach}
  </ul>
  <br class="clear"/>
 </div>
 {/if}
 {if $products}
  <div class="content_sortPagiBar">
   {include file="$tpl_dir./pagination.tpl"}
   <div class="sortPagiBar clearfix">
 {include file="./product-sort.tpl"}
 {include file="./product-compare.tpl"}
 {include file="./nbr-product-page.tpl"}
   </div>
  </div>

  {include file="./product-list.tpl" products=$products}

  <div class="content_sortPagiBar">
   <div class="sortPagiBar clearfix">
 {include file="./product-sort.tpl"}
 {include file="./product-compare.tpl"}
 {include file="./nbr-product-page.tpl"}
   </div>
   {include file="./pagination.tpl"}
  </div>
 {/if}
{elseif $category->id}
 <p class="warning">{l s='This category is currently unavailable.'}</p>
{/if}
{/if}

 

J'ai aussi: category-count.tpl, category-cms-tree-branch.tpl, à la racine du theme mais je n'ai pas édité les codes car je ne pense pas que mon problème puisse venir de là. Mais je peux les fournir si vous voulez.

Merci à tout les deux de vous pencher sur le problème.

Link to comment
Share on other sites

voilà le code de mon fichier category-tree-branch.tpl qui fonctionne chez moi :

 

<li {if isset($last) && $last == 'true'}class="last"{/if}>
<a href="{$node.link|escape:'htmlall':'UTF-8'}" {if isset($currentCategoryId) && $node.id == $currentCategoryId}class="selected"{/if} title="{$node.desc|escape:'htmlall':'UTF-8'|truncate:12:'...'}">{$node.name|escape:'htmlall':'UTF-8'}</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>

Link to comment
Share on other sites

voilà le code de mon fichier category-tree-branch.tpl qui fonctionne chez moi :

 

<li {if isset($last) && $last == 'true'}class="last"{/if}>
<a href="{$node.link|escape:'htmlall':'UTF-8'}" {if isset($currentCategoryId) && $node.id == $currentCategoryId}class="selected"{/if} title="{$node.desc|escape:'htmlall':'UTF-8'|truncate:12:'...'}">{$node.name|escape:'htmlall':'UTF-8'}</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>

 

C'est celui qui est à la racine du thème ou celui du dossier modules?

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