Jump to content

[opgelost] Een "lees meer" knop bij categorie omschrijving


Recommended Posts

Goedeavond,

 

Kan iemand mij hiermee misschien mee helpen?

 

Ik wil een 'lees meer' knop bij mijn categorie beschrijving plaatsen. Momenteel laat die de gehele tekst zien maar ik wil dat die alleen een paar regels van de categorie beschrijving laat zien en zodra ik op de 'lees meer' knop heb gedrukt de gehele tekst laten zien. Dit is al standaard in Prestashop 1.6 maar ik gebruik Prestashop 1.7 en hier heb ik dat niet meer.

 

Is er iemand die weet hoe je dit weer toevoegd of een oplossing hiervoor?

 

Alvast bedankt!

Link to comment
Share on other sites

Ik heb hier mijn category.tpl, deze kan u vervangen op: Themes>templates>catalog>listing

{**
 * 2007-2017 PrestaShop
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 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:
 * http://opensource.org/licenses/osl-3.0.php
 * 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 <contact@prestashop.com>
 * @copyright 2007-2017 PrestaShop SA
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
 * International Registered Trademark & Property of PrestaShop SA
 *}
{extends file='catalog/listing/product-list.tpl'}

{block name='product_list_header'}
    <div class="block-category card card-block hidden-sm-down">
      <h1 class="h1">{$category.name}</h1>

      {assign var="morebutton" value=1}
      {if ($category.description|count_characters) > 350}
          <div id="myDIV2">
            <div id="category-description" class="text-muted">{$category.description|substr:0:400 nofilter}</div>
          </div>
          <a href="#" onclick="myFunction()">{l s='More'}</a>

        <div id="myDIV" style="display: none;">
          {$category.description nofilter}
        </div>
      {else}
        <div>[spam-filter]$category.description nofilter[spam-filter]</div>
      {/if}





      {if $category.image.large.url}
        <div class="category-cover">
          <img src="{$category.image.large.url}" alt="{$category.image.legend}">
        </div>
      {/if}
    </div>
    <div class="text-xs-center hidden-md-up">
      <h1 class="h1">{$category.name}</h1>
    </div>

    <script>
      function myFunction() {
          var x = document.getElementById("myDIV");
          if (x.style.display === "none") {
              x.style.display = "block";
          } else {
              x.style.display = "none";
          }
          var b = document.getElementById("myDIV2");
          if (b.style.display === "none") {
              b.style.display = "block";
          } else {
              b.style.display = "none";
          }
      }
    </script>
{/block}

 

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