Child pages
  • Managing Modules

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Finally, a section lists the latest themes from the Addons site, and you can click on any of them to reach their page, and possibly download them.

Positions

The order in which modules' front-office interface are displayed can be customized – because you might want one module to be place much higher (or lower) in the page that others. In PrestaShop's jargon, this is called "transplanting", and is done using the tool available under the "Positions" sub-tab for the "Modules" tab. In effect, this enables you to attach a module to one of the many available hooks in the current theme, without writing any code.

The "Positions" home-page displays all the available hooks, and their attached modules.

Image Added

Each hook's table displays the hook's name, its technical name, its number of attached modules, and finally lists the attached modules themselves
For each module, you have access to its position relative to this hook.

Moving a module

You have two ways of moving a module within a hook:

  • Click the up or down arrow. The page will reload and display the new order.
  • Drag and drop the module's row itself:
    1. Place the mouse cursor between the moving arrows and the module's name to have it change into a "move item" cursor.
    2. Click and hold: the row turns orange
    3. Move the cursor over the row/position where you want the module to be: the module's row changes position accordingly.
    4. Release the mouse button: the now position for the module is saved.

For most modules, transplantation can easily be done directly via the Back Office. Certain modules require altering the code in order to transplant the module.

Transplanting a module via the back-office

Image Added

  1. Go to the "Modules" tab, and its "Positions" sub-tab.
  2. Click the "Transplant a module" link.
  3. In the "Module" drop-down list, select the module you want to transplant.
  4. In the "Hook Into" drop-down list, select where you want to transplant the module to.
  5. In the "Exceptions" field, type the name of the file(s) of the pages in which you do not want the module to appear.
  6. Click the "Save" button.

Transplanting a module by modifying its code

Some modules cannot be transplanted into other page sections because they lack the necessary code. For example, the Quick Search block contains templates for both column display and header display, while the Currencies block only has one template file which only pertains to the header section. Likewise, the default Featured Products block can only be placed in the center content section of the main page. If you want to move it to a column, you'll have to do the customization yourself.

If you want to display simpler modules such as the Currencies block or the Featured block in a position for which it wasn't built, you'll have to edit its template files.

To customize the transplantation of a module on a hook, you must give it the PHP function for the hook. For example, the Currency block has this function exists:

Code Block
html
html

function hookTop($params)
  {
  ...
  }

In order to transplant the Currency block into the right column, you need to create:

Code Block
html
html

function hookRightColumn($params)
  {
  ...
  }

...and edit its PHP, HTML and CSS code accordingly.

Live Edit

Another way to move modules around on the shop's homepage is the Live Edit mode, which embeds said homepage into a tool that let's you graphically decide where to place your modules. You can access it from the "Position" sub-tab, by clicking the "Run LiveEdit" button.