Dotclear

Ticket #2199 (closed enhancement: fixed)

Opened 9 years ago

Last modified 9 years ago

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:1 Changed 9 years ago by franck

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.

Last edited 9 years ago by franck (previous) (diff)

comment:2 Changed 9 years ago by franck

  • Milestone changed from A definir to 2.11

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

comment:4 Changed 9 years ago by philippe

Ça marche nickel :)

Note: See TracTickets for help on using tickets.

Sites map