How to setup landing page

1. In your config/config.php file add below setting:

    'landingPage' => [
        'frontend' => [
            'guest' => [
                'namespace' => '\Socialveo\Frontend\controllers',
                'controller' => 'custom',
                'action' => 'landingPage',
            ],
        ],
    ],

2. In config/acl.php add below setting before end of file:

    'routes' => [ 
        'newsFeed' => [
            'allow' => ACL_USER,
            'deny' => ACL_GUEST,
        ],
    ],

3. Create new file in your theme folder under static-pages named “landingPage.volt” and add all your html code in file.

4. Create new controller file under controllers folder, example:

<?php
  namespace Socialveo\Frontend\controllers;
  class CustomController extends FrontendController
  {
      public function landingPageAction()
      {
         $this->view->pick("static-pages/landingPage");
      }
  }

NOTE: The name of controller “CustomController” should match the controller name and action name on step 1.

or you can add in StaticPagesController a new method like:

      public function landingPageAction()
      {
      }

NOTE: We will add in the core this method so you will not lost this change after upgrade. In this case change also in step 1 the controller name and action.

Was this article helpful?

Related Articles

Leave A Comment?

You must be logged in to post a comment.