How to add new layout and assign a module to a page using it in OpenCart

How to add new layout and assign a module to a page using it in OpenCart

In order add a new layout and assign a module to a page, you should perform the following:

Step 1: Create a new layout.

Not all pages have layouts by default, f.e. the ‘Specials’ page. So, in order to assign any Module to the Specials page, the Layout has to be created.

To create the Layout (f.e. for the Specials page), please do the following:

  1. Navigate to System -> Design -> Layouts in your Opencart admin panel.
  2. Click the ‘Insert’ button at the top right.
  3. Specify the ‘Layout Name’.
  4. Click the ‘Add Route’ button and add the route for the Layout (f.e.’product/special’ for the ‘Specials’ page).
  5. Click ‘Save’ at the top right.

     

Step 2: Assign the Module to the page Layout.

  1. Navigate to Extensions -> Modules.
  2. Select the Module you would like to assign and click ‘Edit’.
  3. In the Layout field please select the Layout for the page you would like to assign the module to.
  4. Click ‘Save’ at the top right

Was this article helpful?

Related Articles

Leave A Comment?

You must be logged in to post a comment.