Jump to content

Description des catégories tronquée


Recommended Posts

Bonjour,

 

J'utilise le thème CRAFT pour ma boutique Prestashop.

 

Je veux ajouter du texte à la description de mes catégories mais ce texte n'apparaît pas complètement sur mon site.

 

Une partie n'apparaît pas et est remplacée par (...)

 

Comment faire pour afficher tout le texte?

 

D'avance merci.

Link to comment
Share on other sites

Bonjour

Il y a une limite des caractères pour la description, je ne me rappelle plus exactement ou elle se trouve, mais peut etre que tu peux la trouver dans un categorie.tpl de ton theme.

Le truc a changer doit etre un "truncan" qq chose..!

Une petite recherche sur Google devrait t aider.!

 

Bon courage

Brice

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

Bonjour,

Dans mon fichier category.tpl, vers la fin, j'ai cela :

                	<div class="subcategory-image">
						<a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'html':'UTF-8'}" title="{$subcategory.name|escape:'html':'UTF-8'}" class="img">
						{if $subcategory.id_image}
							<img class="replace-2x" src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium_default')|escape:'html':'UTF-8'}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />
						{else}
							<img class="replace-2x" src="{$img_cat_dir}default-medium_default.jpg" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />
						{/if}
					</a>
                   	</div>
					<h5><a class="subcategory-name" href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'html':'UTF-8'}">{$subcategory.name|truncate:25:'...'|escape:'html':'UTF-8'|truncate:350}</a></h5>
					{if $subcategory.description}
						<div class="cat_desc">{$subcategory.description}</div>
					{/if}
				</li>

En modifiant la valeur (ici 350) pour une plus grande, votre problème devrait être résolu. (NB : code issu d'une version 1.6 de Prestashop).

Link to comment
Share on other sites

Oups ! Voici les bonnes lignes (au début normalement) :

{if $category->description}
                            <div class="cat_desc rte">
                            {if Tools::strlen($category->description) > 350}
                                <div id="category_description_short">{$description_short}</div>
                                <div id="category_description_full" class="unvisible">{$category->description}</div>
                                <a href="{$link->getCategoryLink($category->id_category, $category.link_rewrite)|escape:'html':'UTF-8'}" class="lnk_more">{l s='More'}</a>
                            {else}
                                <div>{$category->description}</div>
                            {/if}

Il faut mettre une valeur supérieure à 350 dans la ligne "{if Tools::strlen($category->description) > 350}". Essayez avec 1000 pour commencer.

  • Like 1
Link to comment
Share on other sites

Oups ! Voici les bonnes lignes (au début normalement) :

{if $category->description}
                            <div class="cat_desc rte">
                            {if Tools::strlen($category->description) > 350}
                                <div id="category_description_short">{$description_short}</div>
                                <div id="category_description_full" class="unvisible">{$category->description}</div>
                                <a href="{$link->getCategoryLink($category->id_category, $category.link_rewrite)|escape:'html':'UTF-8'}" class="lnk_more">{l s='More'}</a>
                            {else}
                                <div>{$category->description}</div>
                            {/if}

Il faut mettre une valeur supérieure à 350 dans la ligne "{if Tools::strlen($category->description) > 350}". Essayez avec 1000 pour commencer.

Merci pour lui.. c'est exactement ca.! ca devrait tourner sans probleme par la suite.!

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