This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Setup & design » Problems with Set and namespaces
expandshrink

Problems with Set and namespaces

Problems with Set and namespaces

Saturday 19 July 2003 5:04:46 pm - 1 reply

Hi,

Can anyone tell me why this isn't working? confused.gif Emoticon

{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.

Modified on Saturday 19 July 2003 11:19:58 pm by Kjerand Pedersen

Sunday 20 July 2003 12:38:14 am

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 blunk.gif Emoticon

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

Modified on Sunday 20 July 2003 12:40:02 am by Kjerand Pedersen

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from