Jump to content

HomeCategories in 1.6


Recommended Posts

Hi everybody!

 

I've used this module from jhnstcks which shows categories at homepage as a grid with 1.5.x versions, and it was great, but at 1.6 everything works, except images.

I think that there might be some kind of a problem with code, but I don't know where it can be.  :(

Please help!

 

I think this line of code need to be edited, it's around line 18 in homecategories.tpl:

<div><a href="{$categoryLink}" title="{$category.legend}" class="categoryImage"><img src="{$img_cat_dir}{$category.id_category}-large.jpg" alt="{$category.name}" title="{$category.name}" class="categoryImage" width="{$categorySize.width}" height="{$categorySize.height}" /></a></div>

basically I think that we should change this:

<img src="{$img_cat_dir}{$category.id_category}-large.jpg" alt="{$category.name}" title="{$category.name}" class="categoryImage" width="{$categorySize.width}" height="{$categorySize.height}" /> 

to smth like this (I found this in category.tpl from 1.6):

url({$link->getCatImageLink($category->link_rewrite, $category->id_image, 'category_default')|escape:'html':'UTF-8'}) 0 bottom no-repeat; background-size:contain; min-height:{$categorySize.height}px; 

It's around line 48, here's the full part:

<!-- Category image -->
<div class="content_scene_cat_bg" {if $category->id_image}style="background:url({$link->getCatImageLink($category->link_rewrite, $category->id_image, 'category_default')|escape:'html':'UTF-8'}) 0 bottom no-repeat; background-size:contain; min-height:{$categorySize.height}px;" {/if}>

I tried to do it in a few ways, but it's not working. :(  I'm not really understand what I'm doing, so...

Any help would be hugely appreciated!   :)

Edited by 1RONMAN© (see edit history)
Link to comment
Share on other sites

Okay, I've partially solved this issue with a help of another module. Basically I found module which works but shows categories as a list, without a grid. I'm modifying it at the moment so that it can show them as a grid. I'll post a link here when I'll finish it.

 

Update: grid works. Now I'm trying to make it responsive.

Edited by 1RONMAN© (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...

Replace your homecategories.tpl img line with this

<img src="/c/{$category.id_category}-medium_default/{$category.id_category}-large.jpg" alt="{$category.name}" title="{$category.name}" class="categoryImage" width="{$categorySize.width}" height="{$categorySize.height}" />
  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

that's my preview: http://www.italia-ecommerce.it/psh/index.php

 

----------------

17:20 - I think i've solved: watching the html code i saw the images filename pe. "6-large.jpg" while inside the path directory i found the same file called:"6-large_default.jpg" so i changed homecategories.tpl in the images row

<img src="{$img_cat_dir}{$category.id_category}-large_default.jpg" (adding only default)

 

thank you

Edited by marco78 (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

Hi, in prestashop 1,5 i've istalled homepage category module, it allow to upload a single image for each category, this ìmage will be the home page thumb for this category but when will open the category page appear the same squared image (think is called scene header image or something similar)

 

i thought to edit admin page for category so i could upload 2 or more images for category, but the second step will be to create mysql table for the second largest image and allow the category tpl to fit this image in top (just under the menu)

i've searched in forum and found only similar requests without answers- could someone help me

 

thanx

 

see related post

http://www.prestashop.com/forums/topic/162609-displaying-images-on-category-page-and-custom-thumbnails/

 

as in joomla or wordpress when article images are uploaded they will be resized/cropped for article preview, while the same image is wide open reading the full article - uploadning in prestashop will not in the categoty page (scene?)

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

×
×
  • Create New...