[SOLVED] hash/array manipulation

Author Message

Nicolas OTTAVI

Thursday 22 September 2005 9:04:18 am

Hi,

I want to retrieve the value of MetaDataArray[keywords] and I can't find how !

This is what I did, but this doesn't seem to work:

{def $tab=ezini('SiteSettings','MetaDataArray')}
{$tab.keywords}
{/def}

Your help is welcomed,

K.

Kristof Coomans

Thursday 22 September 2005 11:35:15 pm

What do you get with:

{$tab|attribute(show)}

?

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Nicolas OTTAVI

Friday 23 September 2005 1:50:42 am

No that's not the good solution as it returns all the attribute of an array and other details like attribute name and type.

Thanks for your help,
K.

Frederik Holljen

Friday 23 September 2005 2:12:36 am

Kristof wants to know what output you get when you run

{$tab|attribute(show)}

That way it is possible to determine what the correct call would be to get MetaDataArray[keywords] directly.

Nicolas OTTAVI

Friday 23 September 2005 3:11:26 am

Ok, sorry, made a long time I did not use my English :)

So with the following code

{let $meta_data=ezini( 'SiteSettings','MetaDataArray' ) }
 {$meta_data|attribute(show)}		
{/let}

I get the following result

Attribute / type / Value
author string 'author'
copyright string 'gpl
description string 'Ez Publish cms'
keywords string 'cms, publish, ez Publish, ezpublish'

Then I did :

{$meta_data.keywords}

And it works now ... I might have done something wrong ...

Thanks for your help

Kristof Coomans

Friday 23 September 2005 6:14:57 am

I suddenly see what you did wrong: you must not close the </i>def</i> function with <b>{/def}</b>.

To destroy the variable you've created, you can use <i>undef</i> (see http://ez.no/doc/ez_publish/technical_manual/3_6/reference/template_functions/variables/undef).

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 19 2025 00:21:04
Script start
Timing: Jan 19 2025 00:21:04
Module start 'layout'
Timing: Jan 19 2025 00:21:04
Module start 'content'
Timing: Jan 19 2025 00:21:06
Module end 'content'
Timing: Jan 19 2025 00:21:06
Script end

Main resources:

Total runtime1.3726 sec
Peak memory usage4,096.0000 KB
Database Queries68

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 587.9141152.6250
Module start 'layout' 0.00540.0035 740.539139.4609
Module start 'content' 0.00891.3622 780.0000613.6563
Module end 'content' 1.37120.0014 1,393.656316.1563
Script end 1.3726  1,409.8125 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.2260160.0002
Check MTime0.00130.0921160.0001
Mysql Total
Database connection0.00060.042310.0006
Mysqli_queries1.305395.0966680.0192
Looping result0.00080.0562660.0000
Template Total1.332097.020.6660
Template load0.00210.150920.0010
Template processing1.330096.890320.6650
Template load and register function0.00020.014610.0002
states
state_id_array0.00200.145410.0020
state_identifier_array0.00270.194520.0013
Override
Cache load0.00180.1289410.0000
Sytem overhead
Fetch class attribute can translate value0.00100.074630.0003
Fetch class attribute name0.00130.096280.0002
XML
Image XML parsing0.00100.075930.0003
class_abstraction
Instantiating content class attribute0.00000.001690.0000
General
dbfile0.00170.1225220.0001
String conversion0.00000.000640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
13content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 31
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs