Jump to content

Featured Products inside a CMS page


fateloso

Recommended Posts

Hi.

 

I've been trying to find a solution for this for a while but can't find an answer...

 

1 - What I basically need is to show the "Featured Products" module inside some CMS pages, not all (you can find an example in 1.jpg). Is this possible? If so, how can I do?

 

2 - One other thing I'd like to change, in "Featured Products", is the font type, size and remove bold from the first line (as seen on 2.jpg). I tried a few things but none of them worked...

 

Thank you.

Miguel

post-342163-0-17390200-1335227642_thumb.jpg

post-342163-0-60184600-1335227648_thumb.jpg

Link to comment
Share on other sites

Hi,

 

#1: You could try by adding {$HOOK_HOME} to the cms.tpl and place it in an {if} statement. The condition would be e.g. {if $cms->id == 2}

Then add the 'cms.php' as an exception to the home modules you do not want to display on the cms page.

This should work.

 

#2: The style should be add to global.css line 948. It would be better if you defined a completely new style to it, as not to affect other elements. e.g.:-

#featured-products_block_center h5 {font-weight: normal;}

Link to comment
Share on other sites

Hi CartExpert.

 

Thanks a lot for your help.

 

Issue #2 is solved. I ended up changing the style directly... I don't like that look so, if it got changed elsewhere, that's great :P

 

As to issue #1... I got the point and I think you're heading exactly to what I'd like to apply in the site. Unfortunatelly I don't know how to do it...

Can you help me write the "if" statement and tell me exacty where to put it in the tpl?

This would be to aply to about 20 cms pages, with Id's like 1,2,5,8,13,25,33... (not in a ordered sequence).

How can I add the "cms.php" as an exception?

 

Thanks again.

 

Miguel

Link to comment
Share on other sites

Hi Miguel,

 

You should know the id's of the cms pages:

{if $cms->id == 1 OR $cms->id == 2 [ETC]}

{$HOOK_HOME}

{/if}

 

You could add it after {$cms->content}

 

You also need to add:

self::$smarty->assign('HOOK_HOME', Module::hookExec('home'));

to the 'display' function of the CMSController.php

 

To add an exception to a module: Back Office -> Positions -> edit the module -> put 'cms.php' in the Exceptions box.

Link to comment
Share on other sites

Hi CartExpress.

 

Thanks again for your precious help.

 

I think I did exactly what you said... cleared the cache... but for some reason is not working.

 

This is what I did:

 

cms.tpl

<div class="rte{if $content_only} content_only{/if}">

{$cms->content}

{if $cms->id == 25 OR $cms->id == 11 OR $cms->id == 22 OR $cms->id == 7}

{$HOOK_HOME}

{/if}

</div>

 

CMSController.php

public function displayContent()

{

parent::displayContent();

self::$smarty->display(_PS_THEME_DIR_.'cms.tpl');

self::$smarty->assign('HOOK_HOME', Module::hookExec('home'));

}

 

Also added cms.php as a Featured Products exception.

 

What may I have done wrong?

 

Thank you for your time and patience.

Miguel

Link to comment
Share on other sites

Hi CartExpert.

 

Thank you.

 

I did what you said and got something like this (see attached file).

 

It is actually showing the content of home text editor followed by featured products. I'd like to show only the featured products and remove the home text editor content.

 

Other issue may occur in the featured products width which is breaking each line and moving the 4th item to a new line...

 

I believe we're almost done here :P

 

Thanks again for your precious help.

 

Miguel

post-342163-0-43782600-1335439785_thumb.jpg

Link to comment
Share on other sites

  • 7 months later...
  • 10 months later...

...It is actually showing the content of home text editor followed by featured products. I'd like to show only the featured products and remove the home text editor content.

 

I too have this problem! How can we show the featured products and remove the home text content? I still want the home content to show on the homepage too. I am new to Prestashop and have noticed that simple tasks are so difficult to do. Anyone know why this is?? 

Link to comment
Share on other sites

go to modules and search for "editorial" module or just for "home text editor"

and just disable this addon.

 

it's easy!

 

 

... I still want the home content to show on the homepage too. ...

 

If I disable this add-on won't that disable it on the homepage too??

Link to comment
Share on other sites

hello

 

sorry but i don't understand now, you said this:
 

 

 

and remove the home text content? I still want the home content to show on the homepage too

you said that you want to remove home text content module but you want to show it on homepage.

but.... this module appears only on homepage

Link to comment
Share on other sites

If you refer to the beginning of this thread the original poster was asking how to display featured products on another page other than the homepage. @CartExpert.net showed us how to do this but his method displays ALL of the homepage content. We were looking to display ONLY the featured products. You suggested disabling the homepage content but this would disable it sitewide. Am I making sense here?  :unsure:

Link to comment
Share on other sites

  • 7 months later...
  • 4 months later...
  • 5 months later...
  • 4 months later...
  • 9 months 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...