Ticket #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: | Php version: | ||
| Hosting Provider: | Blocked By: | ||
| Documentation needed: | no | Blocking: |
Description
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

