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: Translations of the new text

...

Status
colourRed
titleTo translate

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

...

This file is defined (by default) as follows:

  • Include header.tpl (si on en affiche le contenu)
  • Inclusion du fichier de template désiré
  • Inclusion du fichier file (if we display the contents)
  • Include the desired template file
  • Include footer.tpl (si on en affiche le contenu)Inclusion de file (if we display the contents)
  • Include "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é

...

You can modify the contents of this file based on an entity type or entity itself.

Type of entity

When you want to change the layout as an entity type such as categories, you can define a file layout-EntityType.tpl defined as follows:

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é dansThis file will be placed in: /themes/default/override/layout-category.tpl (Entité catégorieFor the caterogy entity )

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 suitBy entity

When you want to change the layout according to a particular entity (e.g. for the product entity with ID 1) you can define a file-layout-EntityType-ID.tpl defined as:

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é dansThis file will be placed in: /themes/default/override/layout-product-1.tpl (Entité de produit ayant l'For the product entity with ID 1)

Dynamic template

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

...