Jump to content

[solved] I modified the home featured products picture size and amount. But


Recommended Posts

Hi

As you can see on the images at the moment my home featured block has some column grid problems. Basically I changed the default of PrestaShop 1.5.4's home layout and deleted right column on footer.tpl so I have only left and main column. And I changed the number 4 to 5 on homefeatured.tpl 's product number per row number. And also in admin panel homefeatured module's configuration I made the picture width size to 141px. And total pic amount to 15 at home featured page.

 

So I guessed I made all the changes to have 5 pic on each row, and width nice width size and gaps between them. But it seems I missed out something, and I cant find out what I missed out. Please help.

 

I want my page looks like this "HomeFeatured_GOOD.jpg" each pic width 141px and gap between them 12px And the last item shouldnt be like that as seen here "HomeFeatured_WRONG.jpg"

 

Please see attachments. Thanx.

grid_prestashop.css

homefeatured.css

post-353921-0-00380000-1374178279_thumb.jpg

post-353921-0-56799400-1374178280_thumb.jpg

footer.tpl.css

homefeatured.tpl.css

Link to comment
Share on other sites

hello

css styles works as you said, so the problem is in the .tpl file.

Make sure that you edit correct .tpl file.

 

What i mean?

sometimes theme override the module's .tpl file, in this case you have to check if in your theme directory is file: modules/homefeatured/homefeatured.tpl - if it exist there - you have to change this file.

Link to comment
Share on other sites

hello, so you haven't got this file under the: themes/YOUR_THEME/modules/homefeatured/homefeatured.tpl ?

i checked your file, and the code looks well

 

sometimes is also necessary to run shop under the "force compile" mode, it mean that you have to put this setting on under the advanced preferences > performance (turn on force compile)

Link to comment
Share on other sites

I edited this file didnt work:

/modules/homefeatured/homefeatured.tpl

 

But after your warning I edited this file, it worked:

/themes/default/modules/homefeatured/homefeatured.tpl

 

Yes PrestaShop works in mysterious ways, there is always another file with the same name somewhere :)

Thanx Vekia

thnx very much

  • Like 1
Link to comment
Share on other sites

You're welcome B)

i want to add somethig more to this thread, just for clarify the idea of these two files :)

 

PrestaShop enables you to override various default components and behaviors. You can for example override prestashop classes and controllers, and also visible part of modules (templates, JS, css)

 

what does it mean? it mean that you can adapt modules for your theme without modyfing the original module file. It's great feature because "update" process of prestashop to higher version usualy overwrite original files.

 

when you will have overrides in the themes directory - overrides will stay untouched.

 

 

here is a part of documentation:

 

Overriding a module's behavior

The modules are usually in the following format:

  • /modules/my_module/my_module.tpl
  • /modules/my_module/my_module.css
  • /modules/my_module/my_module.js

warning.png

Since PrestaShop 1.5, they can and should also be in the following format:

  • /modules/my_module/views/templates/front/my_module.tpl
  • /modules/my_module/views/templates/front/my_module.css
  • /modules/my_module/views/templates/front/my_module.js

PrestaShop allows you to override or replace certain front-office module files with new ones within the same theme. The override is governed by the theme: once it contains a/modules folder (or more!), PrestaShop will browse its content for files which have the same name and path as those of existing modules, and replace these with the new ones.

This means, for PrestaShop 1.4-compatible modules:

  • /themes/my_theme/modules/my_module/my_module.tpl
  • /themes/my_theme/css/modules/my_module/my_module.css
  • /themes/my_theme/js/modules/my_module/my_module.js

Since PrestaShop 1.5, the path is slightly longer

  • /themes/my_theme/modules/my_module/views/templates/front/my_module.tpl
  • /themes/my_theme/css/modules/my_module/views/templates/front/my_module.css
  • /themes/my_theme/js/modules/my_module/views/templates/front/my_module.js

In general, the proper path to override a .tpl, .js or .css file depends on the module's own path. That is the reason why if PrestaShop 1.5 has to work with a module without a view folder, it will need the same override path.

In short, you can keep overriding code in 1.5 just as you did in 1.4.

The new files will be used when the customer loads your shop.

 

 

enjoy the overriding! ;)

 

thread marked as [solved]

 

best regards

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

Thks, i just watch the whol thing, and i place the solution and it's work.

 

If works for someone else i just use the same u did.

 

1 - Modify Css on defoult theme.

/themes/default/css/grid_prestashop.css   (change the grid nº5 to de size you need)

 

2- Modify the Main Featured and also the Theme Featured (change the file numer)

/modules/homefeatured/homefeatured.tpl

/themes/default/modules/homefeatured/homefeatured.tpl

 

And that's it put the same Lines for each.

Link to comment
Share on other sites

  • 2 months later...
  • 2 weeks later...
 
oh sorry, and thank you for your reply
 
 
with the module " homefeatured pro"  i have images not centered - image below
 
1.png
 

 

 
I would like this :
 
2.png
 
 
i didn't find where i can adjust on css module
 

 

Thank you

Link to comment
Share on other sites

×
×
  • Create New...