Forums / Setup & design / Problems with Set and namespaces

Problems with Set and namespaces

Author Message

Kjerand Pedersen

Saturday 19 July 2003 8:04:46 am

Hi,

Can anyone tell me why this isn't working? :-|

{let today=0 daystamp=currentdate()}
{section name=Weeks loop=5}
{set #:today=$daystamp}
{$myvariable}
{/section}
{/let}

Debug:
Error: eZTemplate:parser error @ design/user/override/templates/node_termin.tpl:12[4] Jul 19 2003 16:38:27
Invalid parameter characters in function 'set': '#:today=$daystamp'

As you see from the code, I'm trying to assign a value to the variable 'today' in the root namespace.

I also have some problems with logical operators like:

{section show=gt(10,5)}
code
{/section}

For some reason, this statement doesn't validate. The weird thing is that if i replace 'gt' with 'lt', the statement validates regardless of the parameters given. The 'eq' operator seems to work fine though.

Any clues? Anyone?

I'm running Versjon 3.1-1 (3.1) SVN revision 2703 on a non-virtual host.

Kjerand Pedersen

Saturday 19 July 2003 3:38:14 pm

Just discovered that if I write something like:

{section show=$variable|gt($variable2)}

then it works...and I think I understand why. 'eq' and 'ne' checks all given parameters to see if they match or differ, while the 'lt', 'gt' etc. takes _one_ parameter and checks it with the input value. That's why you can use the syntax eq(parameter1, parameter2, ...) and not lt(parameter1, parameter2, ...), right?

Suppose I'm a bit slow ;-)

Still, got problems with the {set #:variable=$value} syntax though. If I leave the loop-sections unnamed, it works, but I would rather do it "the right way".

Thanks for any help,

Kjerand...