Child pages
  • Gestionar módulos y temas

Versions Compared

Key

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

...

Posiciones de los módulos

A modules can have to aspects: one on the Un módulo puede tener dos aspectos: uno en el back-office (its options, or even a configuration screen), and one on the sus opciones, o incluso su pantalla de configuración), y el otro en el front-office. The La parte front-office view is how and where the module is displayed within your shop's theme.

The position of a module in your theme can be changed, because you might want one module's block to be placed much higher (or lower) in the page that others. In PrestaShop's parlance, this is called "transplanting", and is done using the tool available in the "Positions" page, under the "Modules" menu. 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" page displays all the available hooks, and their attached modules. Many are empty by default, but some of the most useful ones have a dozen of modules (the Header hook has 27 by default).

Image Removed

At the top of the page, a drop-down menu enables you to only display the hook in which you are interested.
By default, this page only displays the hooks on which you can position functions. Checking the "Display non-positionable hooks" box below displays all the hooks, even those where you cannot position something.

The header of the table for each hook displays the hook's name, its technical name (and for some, a quick description), and its number of attached modules. The table lists the modules that are attached to that hook.

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:

  • 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 while moving the cursor over the row/position where you want the module to be: the module's row changes position accordingly.
    3. Release the mouse button: the current position for the module is saved.

Image Removed

For most modules, transplantation can easily be done directly via the back-office. Some modules require you to alter their code in order to transplant them corresponde a cómo y dónde se mostará el módulo en su tema. 

La posición de un módulo en su tema puede ser cambiada, porque es posible que desee que el bloque de un módulo  esté posicionado más arriba (o más abajo) en la página que otros. En la jerga Prestashop, a esta acción se la denomina "trasplante", y se realiza mediante la herramienta disponible en la página "Posiciones de los módulos", bajo el menú "Módulos". En realidad, esto le permite conectar un módulo a uno de los muchos hooks disponibles en el tema actual, sin necesidad de escribir ningún código.

La página "Posiciones de los módulos" le muestra todos los hooks disponibles, así como sus correspondientes módulos conectados a ellos Muchos están vacíos por defecto, pero la mayoría utilizan  fácilmente una docena de módulos (el hook Pages header, perteneciente a la cabecera de la tienda, tiene 27 módulos de forma predeterminada).

Image Added

En la parte superior de la página, un menú desplegable le permite mostrar sólo el hook en el que esté interesado.
De forma predeterminada, la lista sólo muestra los hooks en los cuales puede posicionar módulos. Al marcar la casilla "Mostrar hooks invisibles " se mostrarán todos los hooks, incluso aquellos en donde no puede colocar nada.

La cabecera de la tabla para cada hook muestra el nombre del hook, su nombre técnico (y para algunos de ellos, una rápida descripción ), y su número de módulos conectados. La tabla muestra los módulos que están conectados a ese hook.

Los módulos son mostrados en el orden en el que aparecen en el hook.

Mover un módulo dentro de un hook

Tienes dos maneras de cambiar la posición de un módulo dentro de un hook:

  • Haciendo clic en las flechas arriba o abajo. La página se actualizará y mostrará el nuevo orden.
  • Arrastrar y soltar el módulo a la posición deseada:
    1. Coloque el cursor del ratón entre las flechas de movimiento y el nombre del módulo para que este cambie a un cursor de "movimiento de elementos". Lo reconocerá porque el cursor se convierte en una cruz.
    2. Haga clic con el botón derechos del ratón y mantengalo presionado, mientras mueve el cursor del ratón a la fila / posición deseada  : el módulo pasará a ocupar la fila / posición correspondiente.
    3. Suelte el botón del ratón: para guardar la posición actual del módulo.

Image Added

Para la mayoría de los módulos, el trasplante se puede hacer fácilmente a través del back-office. Algunos módulos requieren que se modifique su código para poder trasplantarlos.

Attaching a module to a hook: Transplanting

...