is not used any more and exists only for history. Post new tickets on the Github account. n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Opened 10 years ago

Closed 9 years ago

#1200 closed enhancement (fixed)

add {meta_if} {meta_elsif} {meta_else} {/meta_if} operators to jTpl

Reported by: bricet Owned by: laurentj
Priority: normal Milestone: Jelix 1.4
Component: jelix:plugins:tpl Version: 1.1.7
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Documentation needed: no
Hosting Provider: Php version:


I think it would be intersting to have condtionnal possiblities for metas in jTpl.

{if} {elsif} {else} {/if} only concern content for now. So I would like to introduce {meta_if} {meta_elsif} {meta_else} {/meta_if} operators.

Those new operators would add conditions for both content and metas.

I prefer to add new operators instead of mofifying existing for 2 reasons :

  1. do not break current behaviour of {if} and Co.
  2. when used in a template of a cached zone, metas (and then, with this patch, their conditions) can only use parameters given to the zone. It can NOT use parameters changed or computed by the zone itself. So keeping the ability to disinguish meta and content on one side and content only on the other side seems to me an important possiblity

Here is a patch

Attachments (1)

ticket_1200.patch (2.1 KB) - added by bricet 10 years ago.

Download all attachments as: .zip

Change History (10)

Changed 10 years ago by bricet

comment:1 Changed 10 years ago by bricet

I just forgot to say that this patch uses enhancements given by #1198. This could be unplugged removing lines concerning $blockArgsStack if #1200 is OK and #1198 is not.

As for #1199, those conditions will concern {meta} and {meta_html} tags. This should also concern {include} and {zone} if #1196 and #1197 are accepted.

comment:2 Changed 10 years ago by bricet

  • review set to review?

comment:3 Changed 10 years ago by laurentj

  • Milestone Jelix 1.2 deleted

sorry, too late for 1.2

comment:4 Changed 9 years ago by laurentj

  • Component changed from jelix to jelix:plugins:tpl

comment:5 Changed 9 years ago by laurentj

  • Owner set to bricet
  • review review? deleted
  • Status changed from new to reviewing

comment:6 Changed 9 years ago by laurentj

  • Status changed from reviewing to assigned

I'm almost ok for this patch. I will made little change before to commit it.

comment:7 Changed 9 years ago by laurentj

  • Owner changed from bricet to laurentj

comment:8 Changed 9 years ago by laurentj

  • Milestone set to Jelix 1.4

comment:9 Changed 9 years ago by laurentj

  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.