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

Opened 8 years ago

Last modified 8 years ago

#1441 delayed bug

Can not use {assign}'ed values in metas

Reported by: bricet Owned by:
Priority: normal Milestone:
Component: jelix:tpl Version: trunk
Severity: normal Keywords: assign variable meta
Cc: Blocked By:
Blocking: Documentation needed: no
Hosting Provider: Php version:

Description

It could be usefull (and logical) to be able to use variables assigned inside a template for meta purposes.

{assign $myPath='/my/path/to/my/js/'}

{meta_html js $myPath.'ui/jquery.ui.core.js'}
{meta_html js $myPath.'ui/jquery.ui.widget.js'}
{meta_html js $myPath.'ui/jquery.ui.mouse.js'}
{meta_html js $myPath.'ui/jquery.ui.position.js'}
{meta_html js $myPath.'ui/jquery.ui.draggable.js'}
{meta_html js $myPath.'ui/jquery.ui.droppable.js'}
{meta_html js $myPath.'ui/jquery.effects.core.js'}

This currently does not work because {assign}'ed stuff is only compiled to template_ function and not in the meta_.

I suppose we could solve this inserting on line 482 in lib/jelix/tpl/jTplCompiler.class.php (after $res = $this->_parseFinal($args,$this->_allowedAssign).';';) :

$this->addMetaContent( $res );

But I may not think to side effects it could have ...

Change History (2)

comment:1 Changed 8 years ago by bricet

It does have side effects.

E.g. if we {assign} a value in a {foreach} and if this assignement depends on {foreach}'s value ...

So this way to solve the problem is not good ...

comment:2 Changed 8 years ago by laurentj

  • Status changed from new to delayed

too complications.. no solutions for the moment.

Note: See TracTickets for help on using tickets.