Child pages
  • Changes in version 1.5 which impact theme development

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Section "New template" + "Dynamic template"

...

The file layout.tpl should be taken into account.

Status
colourRed
titleTo translate

Ce fichier est définit (par défaut) comme suit:

  • Inclusion du fichier header.tpl (si on en affiche le contenu)
  • Inclusion du fichier de template désiré
  • Inclusion du fichier footer.tpl (si on en affiche le contenu)
  • Inclusion de "Live Edit" (si nous sommes en mode "Live Edit")

Il vous est possible de modifier le contenu de ce fichier en fonction d'un type d'entité ou d'une entité elle-même.

Par type d'entité

Lorsque vous souhaitez modifier le layout selon un type d'entité tel que les catégories, vous pouvez définir un fichier layout-TypeEntité.tpl définit comme suit:

Code Block
{if !empty($display_header)}
    {include file='../header.tpl' HOOK_HEADER=$HOOK_HEADER}
{/if}
{* Your template start here *}
{if !empty($display_footer)}
    {include file='../footer.tpl'}
{/if}
{if !empty($live_edit)}
    {$live_edit}
{/if}

Ce fichier sera placé dans: /themes/default/override/layout-category.tpl (Entité catégorie)

Par entité

Lorsque vous souhaitez modifier le layout selon une entité particulière (p.e, le produit correspondant à l'ID 1), vous pouvez définir un fichier layout-TypeEntité-ID.tpl définit comme suit:

Code Block
{if !empty($display_header)}
    {include file='../header.tpl' HOOK_HEADER=$HOOK_HEADER}
{/if}
{* Your template start here *}
{if !empty($display_footer)}
    {include file='../footer.tpl'}
{/if}
{if !empty($live_edit)}
    {$live_edit}
{/if}

Ce fichier sera placé dans: /themes/default/override/layout-product-1.tpl (Entité de produit ayant l'ID 1)

Dynamic template

It's possible to override the getOverrideTemplate from a FrontController to dynamically change the template.

General considerations theme URLs and form action

...