Ticket #1200 (closed enhancement: fixed)

Opened 3 years ago

Last modified 16 months ago

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

Attachments

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

Change History

Changed 3 years ago by bricet

Changed 3 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.

Changed 3 years ago by bricet

  • review set to review?

Changed 3 years ago by laurentj

  • milestone Jelix 1.2 deleted

sorry, too late for 1.2

Changed 17 months ago by laurentj

  • component changed from jelix to jelix:plugins:tpl

Changed 17 months ago by laurentj

  • status changed from new to reviewing
  • owner set to bricet
  • review review? deleted

Changed 16 months 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.

Changed 16 months ago by laurentj

  • owner changed from bricet to laurentj

Changed 16 months ago by laurentj

  • milestone set to Jelix 1.4

Changed 16 months ago by laurentj

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