FLUX RSS



ACCUEIL / FORUMS / QUESTIONS TECHNIQUES / SURCHARGE DE TEMPLATES




sondages
Avez-vous déjà utilisé les exports statiques ? :
oui
non
RESULTATS | SONDAGES
liens
eZ systems
http://ez.no
PHPEdit
http://www.waterproof.fr/
AFUL
http://www.aful.org
Framasoft
http://www.framasoft.net
surcharge de templates

Vous devez être connecté pour utiliser le forum. Vous pouvez le faire ici.

Auteur Message

danielle Dyama

Mercredi 24 Décembre 2008 10:15:26 am

surcharge de templates

Bonjour,
ce serait juste pour savoir si un objet peut avoir deux templates différent pour un même template de noeud avec une même règle de surcharge sinon qu'estce que ça cause comme problème, je m'explique:
que donnerait cette surcharge de noeud:

[full_example]
Source=node/view/full.tpl
MatchFile=full/lexample.tpl
Subdir=templates
Match[class_identifier]=example

[full_example]
Source=node/view/full.tpl
MatchFile=full/lexample1.tpl
Subdir=templates
Match[class_identifier]=example

ou que donnerait ceci:

[full_example1]
Source=node/view/full.tpl
MatchFile=full/lexample1.tpl
Subdir=templates
Match[class_identifier]=example

[full_example]
Source=node/view/full.tpl
MatchFile=full/lexample.tpl
Subdir=templates
Match[class_identifier]=example

Merci de m'éclairer, bonnes fêtes à vous

gilles guirand

Mardi 06 Janvier 2009 9:04:36 am

Re: surcharge de templates

Dans cet exemple, les directives sont identiques, donc eZ va exploiter le premier :

http://ez.no/doc/ez_publish/techn...mplates/the_template_override_system
"The priorities of the overrides are determined by their positions in the file. If there are several overrides with similar/equal rules, eZ publish will use the first override that matches and thus the rest of the overrides will be omitted."

Il faut donc ajouter d'autres critères pour indiquer à eZ dans quel cas il doit exploiter tel ou tel template :

Dans le cas de content/view/*.tpl
object : Matches the ID number of the object.
class: Matches the ID number of the class which the object is an instance of.
class_identifier : Matches the identifier of the class which the object is an instance of.
section : Matches the number of the section which the object belongs to.
class_group : Matches the ID number of the group that the class which the object is an instance of belongs to.

Voir la doc :
http://ez.no/doc/ez_publish/techn...ference/template_override_conditions

Gandbox - http://www.gandbox.fr

actualités
Traduction d'un tutorial eZ
eZ publish 4.0 est sorti
EzPublish 3.9 enfin disponible !
Ez Publish 3.9 RC2 est en ligne !
Ez Publish 3.9 RC1 disponible !
références
Site ohmycom
OhmyBlog