Jump to content

Adding Texts to Homepage under Featured Products


Recommended Posts

I would like to add texts on my homepage below the featured product block. Right now my featured products block is at the bottom of the page and any text I add on the homepage text edit goes just on top of it.

Will it be possible to add some texts after this block? I am just trying to fill up some keywords and phrases on my homepage for SEO.

Link to comment
Share on other sites

You'll need to duplicate the editorial module to do that. Copy modules/editorial to modules/editorial2. In the new editorial2 folder, rename editorial.php to editorial2.php, then open up the file and change line 3:

class Editorial extends Module



to:

class Editorial2 extends Module



and line 10 from:

$this->name = 'editorial';



and line 16 from:

$this->displayName = $this->l('Home text editor');



to:

$this->displayName = $this->l('Home text editor two');



and line 249-251 from:

if (file_exists('modules/editorial/editorial.xml'))
{
   if ($xml = simplexml_load_file('modules/editorial/editorial.xml'))



to:

if (file_exists('modules/editorial2/editorial.xml'))
{
   if ($xml = simplexml_load_file('modules/editorial2/editorial.xml'))



Once you've uploaded the new editorial2 folder to your server, you should have two editorial modules "Home text editor v1.6" and "Home text editor two v1.6". Position one above the featured products and one below the featured products, then go to the configuration page of each to change the content.

Link to comment
Share on other sites

Very neat. Awesome. Thanks a lot for this tips.
One last thing, there seems to be a a lot of space between the featured product block and each of the homepage texts. From which files do these spaces come? Can I delete them so as to bring each block close to each other?

Link to comment
Share on other sites

I think you can change the spacing of the "Featured products block" in the following code in the /* block in the center column */ section of global.css (on line 916 in the default PrestaShop v1.3.1 theme):

#center_column div.block { width: 536px; margin: auto }



You can change the margin to 0 auto to remove the top and bottom spacing.

And change the following code in editorial block in the /* Block editorial */ section on line 1131:

.editorial_block { margin-bottom: 2em }



Change 2em to the amount of space you want at the bottom of the editorial blocks.

Link to comment
Share on other sites

Hi Rocky,
The first change you mentioned on #center_column div.block { width: 536px; margin: auto } did not do anything.
However the second one (.editorial_block { margin-bottom: 2em }) worked.
Now I have one other problem. Following your suggestions on top, I had created a 2nd home text block which I positioned under featured product block. On top of this block there is a huge space, and I cannot seem to get rid of it. And in globa.css I was looking for something like .editorial2_block { margin-bottom: 2em }, but could not find it.
Any suggestion?

Link to comment
Share on other sites

It is hard for me to help without actually looking at your site. I suggest that you use Firebug in Firefox or the Developer Tools in IE8, choose the "Find element by click" option, then click on the space to determine which element is creating the space.

Link to comment
Share on other sites

Here is my site http://shop.ametibetaine.com/. It is in french. Please scroll all the way to the bottom and you will see that there is a chunk of text titled "L’origine du bouddhisme" and a chunk of spaces between this paragraph and the featured product block.

BTW, with firebug, inspect element, how can one figure out the file name in which the codes reside?

Link to comment
Share on other sites

  • 6 months later...
  • 1 month later...
  • 1 month later...
  • 1 month later...
  • 5 years later...
×
×
  • Create New...