Jump to content

[SOLVED] change category.tpl


Recommended Posts

How can I change the category.tpl for this ?

I want when products are in a category, that no subcategories where shown, only the products. Is this possible ? To get access to sub-categories user can use the navigation. So if a category has products user must use filtersearch, or navigationbar on top.

This is my category.tpl:

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

{if $category->id AND $category->active}
{strip}
       {$category->name|escape:'htmlall':'UTF-8'}

           {if $nb_products == 0}{l s='There are no products.'}
           {else}
               {if $nb_products == 1}{l s='There is'}{else}{l s='There are'}{/if} 
               {$nb_products} 
               {if $nb_products == 1}{l s='product.'}{else}{l s='products.'}{/if}
           {/if}
{/strip}


   {if $scenes}
       <!-- Scenes -->
       {include file=$tpl_dir./scenes.tpl scenes=$scenes}
   {else}
       <!-- Category image
       {if $category->id_image}
getCatImageLink($category->link_rewrite, $category->id_image, 'category')}" alt="{$category->name|escape:'htmlall':'UTF-8'}" title="{$category->name|escape:'htmlall':'UTF-8'}" id="categoryImage" />
       {/if} -->
   {/if}

   {if $category->description}
{$category->description}
   {/if}
   {if isset($subcategories)}
    <!-- Subcategories -->

{l s='Subcategories'}

       {foreach from=$subcategories item=subcategory}

getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}">
                   {if $subcategory.id_image}
getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium')}" alt="" />
                   {else}

                   {/if}



getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}">{$subcategory.name|escape:'htmlall':'UTF-8'}

       {/foreach}




   {/if}

   {if $products}
           {include file=$tpl_dir./product-sort.tpl}
           {include file=$tpl_dir./product-list.tpl products=$products}
           {include file=$tpl_dir./pagination.tpl}
       {elseif !isset($subcategories)}

{l s='There are no products in this category.'}
       {/if}
{elseif $category->id}

{l s='This category is currently unavailable.'}
{/if}

Link to comment
Share on other sites

Comment out the following part like this:

{*    {if isset($subcategories)}
    <!-- Subcategories -->

{l s='Subcategories'}

       {foreach from=$subcategories item=subcategory}

getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}">
                   {if $subcategory.id_image}
getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium')}" alt="" />
                   {else}

                   {/if}



getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}">{$subcategory.name|escape:'htmlall':'UTF-8'}

       {/foreach}




   {/if}*}

Link to comment
Share on other sites

  • 5 months later...

hey guys

please can you help, im going crazy here!

iv taken the following product slider code and need to change it into a category code so iv done the following :

    






           {counter start=0 assign=nbPrd}
           {foreach from=$bandmovingboxes_products item=bandmovingboxes_product name=bandmovingboxes}



getImageLink($bandmovingboxes_product.link_rewrite, $bandmovingboxes_product.id_image, 'large')}" alt="{$bandmovingboxes_product.legend|escape:htmlall:'UTF-8'}" />
getImageLink($bandmovingboxes_product.link_rewrite, $bandmovingboxes_product.id_image, 'large')}" alt="{$bandmovingboxes_product.legend|escape:htmlall:'UTF-8'}" />

{$bandmovingboxes_offer_message} {convertPrice price=$bandmovingboxes_product.price}

{$bandmovingboxes_product.name|truncate:27:'...'|escape:'htmlall':'UTF-8'}


           {/foreach}        





 <!-- the scroller -->



 <!-- slider -->




and i changed it to the following :


    






           {counter start=0 assign=nbPrd}
           {foreach from=$bandmovingboxes_category item=bandmovingboxes_category name=bandmovingboxes}



getCatImageLink($bandmovingboxes_category.link_rewrite, $bandmovingboxes_category.id_image, 'large')}" alt="{$bandmovingboxes_category.legend|escape:htmlall:'UTF-8'}" />
getCatImageLink($bandmovingboxes_category.link_rewrite, $bandmovingboxes_category.id_image, 'large')}" alt="{$bandmovingboxes_category.legend|escape:htmlall:'UTF-8'}" />

{$bandmovingboxes_offer_message} {convertPrice price=$bandmovingboxes_category.}

{$bandmovingboxes_category.name|truncate:27:'...'|escape:'htmlall':'UTF-8'}


           {/foreach}        





 <!-- the scroller -->



 <!-- slider -->





it just shows up blank and nothing shows on the frontpage at all
Please help guys :) what am i doing wrong????

Link to comment
Share on other sites

  • 4 weeks later...
hey guys

please can you help, im going crazy here!

iv taken the following product slider code and need to change it into a category code so iv done the following :

    






           {counter start=0 assign=nbPrd}
           {foreach from=$bandmovingboxes_products item=bandmovingboxes_product name=bandmovingboxes}



getImageLink($bandmovingboxes_product.link_rewrite, $bandmovingboxes_product.id_image, 'large')}" alt="{$bandmovingboxes_product.legend|escape:htmlall:'UTF-8'}" />
getImageLink($bandmovingboxes_product.link_rewrite, $bandmovingboxes_product.id_image, 'large')}" alt="{$bandmovingboxes_product.legend|escape:htmlall:'UTF-8'}" />

{$bandmovingboxes_offer_message} {convertPrice price=$bandmovingboxes_product.price}

{$bandmovingboxes_product.name|truncate:27:'...'|escape:'htmlall':'UTF-8'}


           {/foreach}        





 <!-- the scroller -->



 <!-- slider -->




and i changed it to the following :


    






           {counter start=0 assign=nbPrd}
           {foreach from=$bandmovingboxes_category item=bandmovingboxes_category name=bandmovingboxes}



getCatImageLink($bandmovingboxes_category.link_rewrite, $bandmovingboxes_category.id_image, 'large')}" alt="{$bandmovingboxes_category.legend|escape:htmlall:'UTF-8'}" />
getCatImageLink($bandmovingboxes_category.link_rewrite, $bandmovingboxes_category.id_image, 'large')}" alt="{$bandmovingboxes_category.legend|escape:htmlall:'UTF-8'}" />

{$bandmovingboxes_offer_message} {convertPrice price=$bandmovingboxes_category.}

{$bandmovingboxes_category.name|truncate:27:'...'|escape:'htmlall':'UTF-8'}


           {/foreach}        





 <!-- the scroller -->



 <!-- slider -->





it just shows up blank and nothing shows on the frontpage at all
Please help guys :) what am i doing wrong????



one way you might be able to handle it would be to create your own category images and then add a link to the large one in scenes.tpl. that way you would have category navigation as well. i'm trying to figure out how use the scenes.tpl category id to point to my custom html of my own nav slide show i'm using on the home page. i created a module and hooked it into home page but i haven't figured out how to trick category.tpl or scenes.tpl to either point directly to html file or hook my module into the correct category page as each cat page needs to point to a different html file or module. good luck. oh yeah what the hell is the point of the scenes anyways? if it's not navigation as well as images it doesn't need to be there at all! imho
Link to comment
Share on other sites

The scenes feature lets you have a banner image for a category that is different to the image used when listed as a subcategory. It also lets you mark parts of the banner as images, so you can link to different images from the banner.

Link to comment
Share on other sites

  • 3 years later...

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