Jump to content

Creating alternative homepage


Recommended Posts

Hello,

in my presta 1.5.4 I needed to create second, alternative homepage, that will have hookHome, but with different modules attached than in index.php (the default homepage).

 

Because I was looking for help here and didn't find it, I figured out by myself and I want to share with you my sort-of-tutorial. Because I am not an expert, I cannot guarantee it is safe or proper method. If any of you have an idea how to do it better, I'll be glad to hear ;)

 

So, that is how I duplicated homepage:

 

1) in public_html I duplicated index.php and renamed it to shop.php.

 

2) in public_html/controllers/front I duplicated IndexController.php and renamed it to ShopController.php.

 

3) inside my bright new ShopController.php I alterneted

class IndexControllerCore extends FrontController

with

class ShopControllerCore extends FrontController

as well as

public $php_self = 'index';

with

public $php_self = 'shop';

 

4) in my backoffice SEO&URLs I created new friendly url for shop page (I called it "shop" which is not a surprise)

 

5) Now on myshopurl.com/shop i saw the exact copy of my homepage

 

6) In modules/positions I added appropriate exceptions for modules I don't want to be visible on my shop page but only on my homepage and vice versa.

 

And voila :) I hope it will help someone.

Link to comment
Share on other sites

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