Jump to content

Modifier taille ul dans homefeature.tpl


jaubrun

Recommended Posts

Bonjour à tous,

Voila j'aimerai changer l'affichage des produits phares sur ma page d'accueil,

le problème c'est que la taille du <ul> est définit dans une variable ({$ulHeight}) que je n'arrive pas à trouver.

 

Voici le code source du homefeature.tpl

 

<div class="block_content">
  {assign var='liHeight' value=250}
  {assign var='nbItemsPerLine' value=3}
  {assign var='nbLi' value=$products|@count}
  {math equation="nbLi/nbItemsPerLine" nbLi=$nbLi nbItemsPerLine=$nbItemsPerLine assign=nbLines}
  {math equation="nbLines*liHeight" nbLines=$nbLines|ceil liHeight=$liHeight assign=ulHeight}
<ul style="height:{$ulHeight}px;">
  {foreach from=$products item=product name=homeFeaturedProducts}
<li class="list_products {if $smarty.foreach.homeFeaturedProducts.first}first_item{elseif $smarty.foreach.homeFeaturedProducts.last}last_item{else}item{/if} {if $smarty.foreach.homeFeaturedProducts.iteration%$nbItemsPerLine == 0}last_item_of_line{elseif $smarty.foreach.homeFeaturedProducts.iteration%$nbItemsPerLine == 1}clear{/if} {if $smarty.foreach.homeFeaturedProducts.iteration > ($smarty.foreach.homeFeaturedProducts.total - ($smarty.foreach.homeFeaturedProducts.total % $nbItemsPerLine))}last_line{/if}">
								<div class="ajax_block_product">
 <a href="{$product.link}" title="{$product.name|escape:html:'UTF-8'}" class="product_image">
											<img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home')}" height="{$homeSize.height}" width="{$homeSize.width}" alt="{$product.name|escape:html:'UTF-8'}" />
									</a>
											<h5>{$product.name|truncate:40:'...'|escape:'htmlall':'UTF-8'}</h5>
												<div class="product_desc">{$product.description_short|strip_tags|truncate:30:'...'}</div>

 <div class="price_container">
  {if $product.show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}
   <p>{if $product.specific_prices AND $product.specific_prices.reduction}
	<span class="bold old_price">
	{if $priceDisplay >= 0 && $priceDisplay <= 2}
	 {if $product.price_without_reduction > $product.price}
	  {convertPrice price=$product.price_without_reduction}
	 {/if}
	{/if}
	</span>

   {/if}
   </p>
   <p><span class="price">{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if} {if $cookie->id_lang == 2}{l s='tax excl.' mod='homefeatured'}{/if}</span></p>



  {else}<div style="height:21px;"></div>{/if}
											 <p>
												<span>{convertPrice price=$product.price} {l s='tax incl.' mod='homefeatured'}</span>
											</p>
 </div>
 <a class="button ajax_add_to_cart_button" rel="ajax_id_product_{$product.id_product|intval}" href="{$link->getPageLink('cart.php')}?add&id_product={$product.id_product|intval}{if isset($static_token)}&token={$static_token}{/if}" title="{l s='Add to cart' mod='homefeatured'}"><img src="{$img_dir}icon_cart_item.png" alt="{l s='Add to cart' mod='homefeatured'}" width="23" height="23" /></a>
								</div>
								<div class="shadow"></div>
</li>
  {/foreach}
  </ul>
 </div>

 

Si quelqu'un à une petite idje suis preneur.

Merci :)

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

La hauteur du UL est calculé d'après la hauteur des LI (assigné ligne 2) et le nombre de ligne.

 

 

{math equation="nbLines*liHeight" nbLines=$nbLines|ceil liHeight=$liHeight assign=ulHeight}

  • Like 1
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...