|Table of Contents|
A modules can have to views: one on the back - office (its options, or even a configuration screen), and one on the front - office. The front - office view is how and where the module is displayed within your shop's theme.
The modules are displayed in the order in which they appear in the hook.
Moving a module within a hook
You have two ways of changing a module's position within a hook:
For most modules, transplantation can easily be done directly via the back-officeback office. Some modules require you to alter their code in order to transplant them.
Attaching a module to a hook: Transplanting
In PrestaShop, "transplanting" is the action of attaching a module to a hook. You can add a module to more than one hook.
Even though the "Hook into" drop-down list gives a comprehensive overview of the available hooks, it might not always be clear which is the one to which you want to attach your module. Do not hesitate to try another hook if the result of your selection if not what you expect.
The list gives some detail: some hook have a description after the hook's name, for instance "Add fields to the form 'attribute value'" for
displayAttributeForm. Peruse them all in order to choose your hook correctly.
Editing an attached module
Each module has two icons on the right side of its row: one to edit its settings, the other to delete the module.
Always check your front-office to make sure the module is indeed where you intended it to be.
Removing a module from a hook
There are two ways to remove a module from a hook:
- Removing a single module: click the trashcan icon on the right of the module's row.
- Removing a batch of modules: select the modules by checking the box on the right of their row, and then click the "Unhook" button, found at the top and the bottom of the list of hooks.
Moving a module visually: 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 lets you visually decide where to place your modules. You can access it from the "Position" page, by clicking the "Run Live Edit" button.
Once you have removed a module, if you want to bring it back, you will have to go to the "Positions" page and use the "Transplant a module" form.
Where to move modules?
Modules cannot be moved just about anywhere: it depends on both the theme's hooks, and each module's hook support (as seen in the above section). Therefore, you mostly can only move modules within their understood context: column modules can be moved within a column as well as from one column to the other (right to left, for instance), while regular homepage modules (the ones at the center) can only be moved within their specific column.
In order to give you a visual hint about where a given module can be moved, it will display an empty green block if the location is correct, and an empty red block if not.
Transplanting a module by modifying its code
This is for experts only: you must have a good knowledge of PHP and HTML before attempting anything with the code of a module.