Using Hook Content with Content Anywhere is a powerful way to enhance your PrestaShop store. It allows you to design custom sections in Creative Elements and inject them into specific predefined locations within your theme, known as "hooks."


What is a PrestaShop Hook?

A "hook" is a specific placeholder in your PrestaShop theme's code where modules can attach content. For example, most themes have a displayHome hook for the main homepage area and a displayFooterBefore hook for the area just above the footer. By creating content and assigning it to a hook, you can add custom-designed sections to your theme without editing any code.

Note: If a hook is rendered via AJAX, content added through Content Anywhere may not display correctly.

Creating New Hook Content

  1. From your PrestaShop admin, navigate to Creative Elements > Content Anywhere.
  2. Click the Add New button in the top right corner.
  3. Provide a title for your content block (e.g., "Homepage Banner"). This is for internal identification only.
  4. In the Position dropdown, select the hook where you want your content to appear. A list of common hooks is provided for convenience.
  5. Set the Status to "Enabled" to make the content live immediately. If disabled, you can still design it and preview it in the Live Editor.
  6. Click Save.
  7. Click Edit with Creative Elements to open the Live Editor and design your content block.
Configuring new hook content
Set the title, position (hook), and status for your new content block.
Tip: If you wish to completely replace your entire homepage, we recommend building a Homepage template in the Theme Builder instead of using the displayHome hook.

Managing Hook Position

After creating hook content, you can adjust its placement in two ways:

Changing the Order Within the Same Hook

If multiple modules are attached to the same hook, you can change their display order directly in PrestaShop's core positioning tool.

  1. In your PrestaShop admin, navigate to Design > Positions.
  2. Use the search bar to find the hook you want to modify (e.g., `displayLeftColumn`).
  3. In the list of modules, find "Creative Elements" and simply drag and drop it to your desired position in the sequence.
Moving content within the same hook
Drag the Creative Elements module to reorder it within a hook.

Moving Content to a Different Hook

You can easily re-assign an existing content block to a completely different hook.

  1. In your PrestaShop admin, go to Creative Elements > Content Anywhere.
  2. Find the content block you want to move and click Edit.
  3. From the Position dropdown, select the new hook.
  4. Click Save.
Moving content to a different hook
Change the assigned hook by editing the content block.

Using Custom Hooks (Advanced)

For advanced users, Content Anywhere also supports custom hooks. If you have added a new, non-standard hook to your theme's .tpl files, you can use it as a target for your content.

To do this, simply type the name of your custom hook directly into the Position field instead of selecting one from the dropdown list.

Adding custom hook
Adding a custom hook in Content Anywhere.
© WebshopWorks - Professional PrestaShop Addons