Share » Forums » General » How to add more value to var in...

How to add more value to var in templates ?

How to add more value to var in templates ?

Saturday 29 December 2007 10:38:20 pm - 4 replies

Modified on Saturday 29 December 2007 10:38:51 pm by Marvix Marx

Author Message

André R.

Sunday 30 December 2007 7:13:27 pm

It's probably best to do this in php, but in templates you can do your example like this:

{def $arr = array()}
{foreach $some_array as $el}
{set $arr = $arr|append(  array(  $el.url, $el.path ) )}
{/foreach}

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Marvix Marx

Sunday 30 December 2007 10:30:34 pm

I have done it with php, but I don`t know to extract the values from XML :(

any clue ?

André R.

Monday 31 December 2007 3:43:03 am

If you use eZ Publish 4.0:
http://ez.no/developer/contribs/template_plugins/ez_template_dom

But how is the code working now?
* fetching data from some external db
* generating xml file
* showing some values from xml file instead of directly from db??
* xml file also used for flash??

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Marvix Marx

Monday 31 December 2007 4:37:15 am

The images under media node, from the sql debug I copied the query, and the result was I as I need, but as XML .. tried with xmldom and xmldocument but no result.

am using ezp 4.

I`ll test you template code when I go home.

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

36 542 Users on board!

Forums menu