Ticket #2199 (closed enhancement: fixed)
EntryIf : posibilité de lister plusieurs catégories
Reported by: | effisk1 | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 2.11 |
Component: | module:core | Version: | 2.10.2 |
Severity: | normal | Keywords: | EntryIf, category, tags |
Cc: |
Description
Hello,
Je fais suite à ce sujet dans le forum: https://forum.dotclear.org/viewtopic.php?id=37548
Aujourd'hui nous sommes contraints de faire ça: <tpl:EntryIf category="cat1"> CONTENU SI cat1 OU cat2 </tpl:EntryIf><tpl:EntryIf category="cat2"> CONTENU SI cat1 OU cat2 </tpl:EntryIf>
Ou encore: <tpl:EntryIf category="!cat1"><tpl:EntryIf category="!cat2"> CONTENU SI NI cat1 NI cat2 </tpl:EntryIf></tpl:EntryIf>
Quand il y a en a deux, ça va... C'est quand il y en a beaucoup qu'il y a des problèmes :)
Ma proposition serait de pouvoir faire ça à la place: <tpl:EntryIf category="cat1,cat2"> CONTENU SI cat1 OU cat2 </tpl:EntryIf>
Ou encore: <tpl:EntryIf category="!cat1,!cat2"> CONTENU SI NI cat1 NI cat2 </tpl:EntryIf>
Change History
comment:3 Changed 9 years ago by franck <carnet.franck.paul@…>
- Status changed from new to closed
- Resolution set to fixed
(In [1627515406c9]) Add new categories attribute to EntryIf? template tag, closes #2199
Ex:
- categories="!Plugin,!Theme" → valid if entry's category is not Plugin nor Theme
- categories="Plugin,Theme" operator="or" → valid if entry's category is Plugin or Theme
Et quand c'est <tpl:EntryIf category="!cat1,cat2"> … </tpl:EntryIf>
Ça serait quoi ? un OU ou un ET ?
Finalement le plus simple est de tenir compte de l'attribut operator s'il est présent, sinon ça sera un ET comme pour le reste.