cyntoch Posted May 2, 2013 Share Posted May 2, 2013 (edited) Bonjour, Je souhaiterais réduire le nombre de caractère des titres de mes produits présents sur l'index ou sur les pages de catégories. Actuellement les titres sont trop longs et prennent parfois 2 lignes du coup les prix ne sont plus alignés et cela me dérange. Pour des titres trop longs, j'aimerais qu'il y ai par exemple tant de caractères suivi de 3 petits points (...) Est-ce possible? Merci Edited May 5, 2013 by cyntoch (see edit history) Link to comment Share on other sites More sharing options...
YopixelAE Posted May 3, 2013 Share Posted May 3, 2013 Bonjour, il vous faut changer le paramètre du truncate Smarty. Cherchez "truncate" dans vos .tpls concernés et changez la valeur (exemple, 80 devient 70 etc.) Link to comment Share on other sites More sharing options...
cyntoch Posted May 3, 2013 Author Share Posted May 3, 2013 Ok merci je vais chercher ça de suite ;-) Link to comment Share on other sites More sharing options...
cyntoch Posted May 3, 2013 Author Share Posted May 3, 2013 Je pense avoir trouvé: Fichier product_list.tpl , ligne 39, j'ai mis le truncate à 28 mais rien ne se passe... <p class="product_desc">{$product.description_short|truncate:28:'...'|strip_tags:'UTF-8'}</p> J'attends un peu car j'ai remarqué que les modifs ne sont pas prisent en compte immédiatement. Link to comment Share on other sites More sharing options...
Bondaty and Co Posted May 3, 2013 Share Posted May 3, 2013 Là c'est la description courte que vous avez modifié. recherchez plus du coté "title" Link to comment Share on other sites More sharing options...
cyntoch Posted May 3, 2013 Author Share Posted May 3, 2013 Ah ok! J'ai trouvé: title="{$product.name|escape:'htmlall':'UTF-8'}">{$product.name|truncate:28:'...'|escape:'htmlall':'UTF-8'}</a></h3> C'est bien ici? Link to comment Share on other sites More sharing options...
Bondaty and Co Posted May 3, 2013 Share Posted May 3, 2013 oui c'est bien ça, merci de mettre le post en [RESOLU] Link to comment Share on other sites More sharing options...
cyntoch Posted May 3, 2013 Author Share Posted May 3, 2013 Super! Merci ;-) Je mets en résolu de suite. 1 Link to comment Share on other sites More sharing options...
cyntoch Posted May 5, 2013 Author Share Posted May 5, 2013 Je reviens sur ce topic car je souhaitais aussi que cela soit effectif sur les nouveaux produits de l'index mais je ne trouve pas ou changer le truncate... j'ai cherché dans new_products.tpl Merci Link to comment Share on other sites More sharing options...
YopixelAE Posted May 5, 2013 Share Posted May 5, 2013 (edited) blocknewproducts.tpl Edited May 5, 2013 by Félix-v1.5 (see edit history) Link to comment Share on other sites More sharing options...
cyntoch Posted May 5, 2013 Author Share Posted May 5, 2013 Bonjour, Merci pour la réponse. C'est ici ?? (j'ai utilisé la fonction recherche et c'est le seul truncate du fichier) {$newproduct.description_short|strip_tags:'UTF-8'|truncate:28:'...'} Car j'ai fais la modif, j'ai vidé le cache pour voir et rien ne change. Merci beaucoup. Link to comment Share on other sites More sharing options...
splash_info Posted May 5, 2013 Share Posted May 5, 2013 Non ça doit être un peu plus haut dans le fichier. La ligne en question tronque la description des produits et non leur nom. Link to comment Share on other sites More sharing options...
cyntoch Posted May 6, 2013 Author Share Posted May 6, 2013 Bonjour, Et bien je n'arrive pas à trouver... Est-il possible que vous me disiez quel ligne je dois modifier? C'est bien le truncate que je dois modifier? Voici mon fichier: <!-- MODULE Block new products --> <div id="new-products_block_right" class="block products_block"> <h4 class="title_block"><a href="{$link->getPageLink('new-products')}" title="{l s='New products' mod='blocknewproducts'}">{l s='New products' mod='blocknewproducts'}</a></h4> <div class="block_content"> {if $new_products !== false} <ul class="product_images clearfix"> {foreach from=$new_products item='product' name='newProducts'} {if $smarty.foreach.newProducts.index < 2} <li{if $smarty.foreach.newProducts.first} class="first"{/if}><a href="{$product.link}" title="{$product.legend|escape:html:'UTF-8'}"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'medium_default')}" height="{$mediumSize.height}" width="{$mediumSize.width}" alt="{$product.legend|escape:html:'UTF-8'}" /></a></li> {/if} {/foreach} </ul> <dl class="products"> {foreach from=$new_products item=newproduct name=myLoop} <dt class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if}"><a href="{$newproduct.link}" title="{$newproduct.name|escape:html:'UTF-8'}">{$newproduct.name|strip_tags|escape:html:'UTF-8'}</a></dt> {if $newproduct.description_short}<dd class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if}"><a href="{$newproduct.link}">{$newproduct.description_short|strip_tags:'UTF-8'|truncate:28:'...'}</a><br /><a href="{$newproduct.link}" class="lnk_more">{l s='Read more' mod='blocknewproducts'}</a></dd>{/if} {/foreach} </dl> <p><a href="{$link->getPageLink('new-products')}" title="{l s='All new products' mod='blocknewproducts'}" class="button_large">» {l s='All new products' mod='blocknewproducts'}</a></p> {else} <p>» {l s='Do not allow new products at this time.' mod='blocknewproducts'}</p> {/if} </div> </div> <!-- /MODULE Block new products --> Merci beaucoup. Link to comment Share on other sites More sharing options...
cyntoch Posted May 8, 2013 Author Share Posted May 8, 2013 Bonjour, Est-ce que quelqu'un peut m'aider s'il vous plait? Merci ;-) Link to comment Share on other sites More sharing options...
Bondaty and Co Posted May 9, 2013 Share Posted May 9, 2013 remplacez escape:html:'UTF-8' par: strip_tags:'UTF-8'|truncate:28:'...' Link to comment Share on other sites More sharing options...
cyntoch Posted May 10, 2013 Author Share Posted May 10, 2013 Bonjour, Cela ne marche pas... j'ai bien vidé le cache. voici la ligne en question, y a t-il un soucis ? : <li{if $smarty.foreach.newProducts.first} class="first"{/if}><a href="{$product.link}" title="{$product.legend|strip_tags:'UTF-8'|truncate:28:'...' }"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'medium_default')}" height="{$mediumSize.height}" width="{$mediumSize.width}" alt="{$product.legend|strip_tags:'UTF-8'|truncate:28:'...' }" /></a></li> Link to comment Share on other sites More sharing options...
Bondaty and Co Posted May 10, 2013 Share Posted May 10, 2013 Normal, c'est pas la bonne ligne, c'est en dessous de <dl class="products"> Link to comment Share on other sites More sharing options...
cyntoch Posted May 10, 2013 Author Share Posted May 10, 2013 Oups! j'ai rectifié c'est bien celle-ci? CAr ca ne marche toujours pas... <dt class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if}"><a href="{$newproduct.link}" title="{$newproduct.name|strip_tags:'UTF-8'|truncate:28:'...' }">{$newproduct.name|strip_tags|strip_tags:'UTF-8'|truncate:28:'...'}</a></dt> Link to comment Share on other sites More sharing options...
Bondaty and Co Posted May 10, 2013 Share Posted May 10, 2013 Merci de mettre en [RESOLU] Link to comment Share on other sites More sharing options...
cyntoch Posted May 10, 2013 Author Share Posted May 10, 2013 Ce n'est malheureusement pas résolu, cela ne marche pas... Link to comment Share on other sites More sharing options...
Bondaty and Co Posted May 10, 2013 Share Posted May 10, 2013 $newproduct.name|strip_tags|strip_tags:'UTF-8'|truncate:28:'...'} vous avez mis 2 fois strip_tags Link to comment Share on other sites More sharing options...
cyntoch Posted May 10, 2013 Author Share Posted May 10, 2013 J'ai corrigé l'erreur cela ne marche toujours pas Link to comment Share on other sites More sharing options...
Bondaty and Co Posted May 10, 2013 Share Posted May 10, 2013 Vous avez le code ? Link to comment Share on other sites More sharing options...
cyntoch Posted May 10, 2013 Author Share Posted May 10, 2013 Voila mon fichier: <!-- MODULE Block new products --> <div id="new-products_block_right" class="block products_block"> <h4 class="title_block"><a href="{$link->getPageLink('new-products')}" title="{l s='New products' mod='blocknewproducts'}">{l s='New products' mod='blocknewproducts'}</a></h4> <div class="block_content"> {if $new_products !== false} <ul class="product_images clearfix"> {foreach from=$new_products item='product' name='newProducts'} {if $smarty.foreach.newProducts.index < 2} <li{if $smarty.foreach.newProducts.first} class="first"{/if}><a href="{$product.link}" title="{$product.legend|strip_tags:'UTF-8'|truncate:28:'...' }"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'medium_default')}" height="{$mediumSize.height}" width="{$mediumSize.width}" alt="{$product.legend|strip_tags:'UTF-8'|truncate:28:'...' }" /></a></li> {/if} {/foreach} </ul> <dl class="products"> {foreach from=$new_products item=newproduct name=myLoop} <dt class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if}"><a href="{$newproduct.link}" title="{$newproduct.name|strip_tags:'UTF-8'|truncate:28:'...' }">{$newproduct.name|strip_tags:'UTF-8'|truncate:28:'...'}</a></dt> {if $newproduct.description_short}<dd class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if}"><a href="{$newproduct.link}">{$newproduct.description_short|strip_tags:'UTF-8'|truncate:28:'...'}</a><br /><a href="{$newproduct.link}" class="lnk_more">{l s='Read more' mod='blocknewproducts'}</a></dd>{/if} {/foreach} </dl> <p><a href="{$link->getPageLink('new-products')}" title="{l s='All new products' mod='blocknewproducts'}" class="button_large">» {l s='All new products' mod='blocknewproducts'}</a></p> {else} <p>» {l s='Do not allow new products at this time.' mod='blocknewproducts'}</p> {/if} </div> </div> <!-- /MODULE Block new products --> Link to comment Share on other sites More sharing options...
Bondaty and Co Posted May 10, 2013 Share Posted May 10, 2013 Essayez avec $newproduct.name|truncate:28:'...'|escape:'htmlall':'UTF-8' Link to comment Share on other sites More sharing options...
cyntoch Posted May 10, 2013 Author Share Posted May 10, 2013 Comme ceci: title="{$newproduct.name|truncate:28:'...'|escape:'htmlall':'UTF-8'}">{$newproduct.name|truncate:28:'...'|escape:'htmlall':'UTF-8' }</a></dt> ( Je préfère vous demander avant de corriger ) Link to comment Share on other sites More sharing options...
Bondaty and Co Posted May 11, 2013 Share Posted May 11, 2013 faites un essai... Osez !!!! ça ne mord pas. Link to comment Share on other sites More sharing options...
cyntoch Posted May 11, 2013 Author Share Posted May 11, 2013 Ça ne marche toujours pas Link to comment Share on other sites More sharing options...
cyntoch Posted May 24, 2013 Author Share Posted May 24, 2013 Bonjour, Je reviens sur ce sujet car je n'ai toujours pas réussi à réduire le nombre de caractère. Merci ;-) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now