Jump to content

Category content under the products display


Recommended Posts

Hello,

I have a question, i am making a new Webshop with Prestashop now.

If i add my content ( description ) to a category, first the content will show and than the products, so people need to scroll to much to come by the products.

Does any body know how to show first the products and than the category content ( description ) ? I know I have to work with category.tpl files, but I don't know how to edit it correctly. 

Please let me know if someone can help ;)

 

I add my category.tpl file

 

Quote

{include file="$tpl_dir./errors.tpl"}

{if isset($category)}
  {if $category->id && $category->active}
    {if $scenes || $category->description || $category->id_image}
      <div class="content_scene_cat">
        {if $scenes}
          <div class="content_scene">
            <!-- Scenes -->
            {include file="$tpl_dir./scenes.tpl" scenes=$scenes}
            {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}
              </div>
            {/if}
          </div>
        {else}
          <!-- Category image -->
          <div class="content_scene_cat_bg row">
            {if $category->id_image}
              <div class="category-image hidden-xs col-xs-12 col-sm-5 col-md-4 col-lg-3">
                <img class="img-responsive" src="{$link->getCatImageLink($category->link_rewrite, $category->id_image, 'tm_category_default')|escape:'html':'UTF-8'}" alt="{$category->name|escape:'html':'UTF-8'}" />
              </div>
            {/if}
            {if $category->description}
              <div class="cat_desc col-xs-12 col-sm-7 col-md-8 col-lg-9">
                <span class="category-name">
                  {strip}
                    {$category->name|escape:'html':'UTF-8'}
                    {if isset($categoryNameComplement)}
                      {$categoryNameComplement|escape:'html':'UTF-8'}
                    {/if}
                  {/strip}
                </span>
                {if Tools::strlen($category->description) > 350}
                  <div id="category_description_short" class="rte">{$description_short}</div>
                  <div id="category_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" title="{l s='More'}">{l s='More'}</a>
                {else}
                  <div class="rte">{$category->description}</div>
                {/if}
              </div>
            {/if}
          </div>
        {/if}
      </div>
    {/if}
    <h1 class="page-heading{if (isset($subcategories) && !$products) || (isset($subcategories) && $products) || !isset($subcategories) && $products} product-listing{/if}">
      <span class="cat-name">{$category->name|escape:'html':'UTF-8'}{if isset($categoryNameComplement)}&ensp;{$categoryNameComplement|escape:'html':'UTF-8'}{/if}</span>
      {include file="$tpl_dir./category-count.tpl"}
    </h1>

    {if isset($subcategories)}
      {if (isset($display_subcategories) && $display_subcategories eq 1) || !isset($display_subcategories)}
        <!-- Subcategories -->
        <div id="subcategories">
          <p class="subcategory-heading">{l s='Subcategories'}</p>
          <ul class="clearfix">
            {foreach from=$subcategories item=subcategory}
              <li>
                <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, 'tm_medium_default')|escape:'html':'UTF-8'}" alt="{$subcategory.name|escape:'html':'UTF-8'}" />
                    {else}
                      <img class="replace-2x" src="{$img_cat_dir}{$lang_iso}-default-medium_default.jpg" alt="{$subcategory.name|escape:'html':'UTF-8'}" 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'}" title="{$subcategory.name|truncate:25:'...'|escape:'html':'UTF-8'|truncate:50}">{$subcategory.name|truncate:25:'...'|escape:'html':'UTF-8'}</a>
                </h5>
                {if $subcategory.description}
                  <div class="cat_desc">{$subcategory.description}</div>
                {/if}
              </li>
            {/foreach}
          </ul>
        </div>
      {/if}
    {/if}

    {if $products}
      <div class="content_sortPagiBar clearfix">
        <div class="sortPagiBar clearfix">
          {include file="./product-sort.tpl"}
          {include file="./nbr-product-page.tpl"}
        </div>
      </div>
      {include file="./product-list.tpl" products=$products}
      <div class="content_sortPagiBar bottom">
        <div class="bottom-pagination-content clearfix">
          {include file="./product-compare.tpl" paginationId='bottom'}
          {include file="./pagination.tpl" paginationId='bottom'}
        </div>
      </div>
    {/if}
  {elseif $category->id}
    <p class="alert alert-warning">{l s='This category is currently unavailable.'}</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...