Jump to content

Manufacturer.tpl - How to hide part of the short description and add read more button?


Recommended Posts

Hi,

 

We use Presta 1.6.0.9 and we want to have the manufacturer.tpl somewhat changed.

Now you see the whole long and short description. We want to have one of the two (no prefference)

showing around 355 caracters and hide the rest of the text + add a bottun to read more (Read more).

 

Anyone??

 

Below is the full code:

 

{*
* 2007-2014 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author PrestaShop SA <[email protected]>
*  @copyright  2007-2014 PrestaShop SA
*  @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*}
 
 
{include file="$tpl_dir./errors.tpl"}
 
{if !isset($errors) OR !sizeof($errors)}
<h1 class="page-heading product-listing">
{l s='List of products by manufacturer'} {$manufacturer->name|escape:'html':'UTF-8'}
</h1>
{if !empty($manufacturer->description) || !empty($manufacturer->short_description)}
<div class="description_box rte">
{if !empty($manufacturer->short_description)}
<div class="short_desc">
{$manufacturer->short_description}
</div>
<div class="hide_desc">
{$manufacturer->description}
</div>
<a href="#" class="lnk_more" onclick="$(this).prev().slideDown('slow'); $(this).hide();$(this).prev().prev().hide(); return false;">
{l s='Sluiten'}
</a>
{else}
<div>
{$manufacturer->description}
                    
                    {if Tools::strlen($manufacturer->description) > 350}
                                <div id="manufacturer_description_short" class="rte">{$description_short}</div>
                                <div id="manufacturer_description_full" class="unvisible rte">{$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 class="rte">{$manufacturer->description}</div>
                            {/if}
                    
</div>
{/if}
</div>
{/if}
 
{if $products}
<div class="content_sortPagiBar">
    <div class="sortPagiBar clearfix">
{include file="./product-sort.tpl"}
{include file="./nbr-product-page.tpl"}
</div>
    <div class="top-pagination-content clearfix">
        {include file="./product-compare.tpl"}
           {include file="$tpl_dir./pagination.tpl"}
       </div>
</div>
 
{include file="./product-list.tpl" products=$products}
 
<div class="content_sortPagiBar">
       <div class="bottom-pagination-content clearfix">
        {include file="./product-compare.tpl"}
{include file="./pagination.tpl" paginationId='bottom'}
       </div>
</div>
{else}
<p class="alert alert-warning">{l s='No products for this manufacturer.'}</p>
{/if} 
{/if}
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...