Pls explain namespace concept in sections

Author Message

SathishKumar Subramanian

Saturday 13 December 2003 2:06:34 am

Hi,

I am strucking in the namespace concept while using more than one "sections" and "let". I cant get the solution to findout the problem because of namespace. Pls explain the namespace concept in sections.

Thanx in Advance :)

Sathizh

Georg Franz

Saturday 13 December 2003 6:34:21 am

Hi Sathizh,

have a look at http://ez.no/developer/ez_publish_3/documentation/development/libraries/ez_template/basics/namespaces_

But using Namespaces give you more troubles than not using them. (I've wasted a lot of hours to find that out.)

The main problem of the Namespace-Feature: You can't set global variables in a nested namespace.

Expample:

{let name=myglobalnamespace
first=true()
}
{section name=mysection loop=7}
{section name=mysubsection show=$myglobalnamespace:first}
{set first=false()}
{/section}
{/section}
{/let}

-> Setting $first to "false" won't work, because the parser looks for the variable "$myglobalnamespace:mysection:mysubsection:first" which doesn't exist.

And - a main lack of ez - you can't using the set-function with Namespaces.

{set myglobalnamespace:first=false()} produces an error.

So, only use Namespaces, if you don't want to set variables in a Subnamespace.

Kind regards,
Emil.

Best wishes,
Georg.

--
http://www.schicksal.com Horoskop website which uses eZ Publish since 2004

Lazaro Ferreira

Sunday 25 January 2004 2:01:25 pm

Hi,

I have to agree with you, this namespaces features could be a real nigthmare for an ezpublish template beginner

What a pity for reading your post so late, after wasting lot of time thinking how to set a global or outer namespace variavel in a nested namespace

The bad thing about this, is that it doesn't appear docummented in namespace documentation

 

Lazaro
http://www.mzbusiness.com

Paul Borgermans

Monday 26 January 2004 4:20:27 am

Hi

You can set global variables, study the example below and try it out:

{let a=3
      b=array(1,2,3,4,5)}
{section name=test loop=$b}
{let a=$test:item}
<p>local a={$test:a}, global a={$a}</p>
{set-block scope=root variable=a}{$test:a}{/set-block}
<p>again after set-block, local a={$test:a}, global a={$a}</p>
{/let}
{/section}
{/let}

If you think this is useful, buy me a beer at the next summer conference and buy the book on ezp when it comes out

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

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 18 2025 19:34:27
Script start
Timing: Jan 18 2025 19:34:27
Module start 'layout'
Timing: Jan 18 2025 19:34:27
Module start 'content'
Timing: Jan 18 2025 19:34:28
Module end 'content'
Timing: Jan 18 2025 19:34:28
Script end

Main resources:

Total runtime0.9415 sec
Peak memory usage4,096.0000 KB
Database Queries64

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0049 588.0391152.6406
Module start 'layout' 0.00490.0024 740.679739.4766
Module start 'content' 0.00730.9326 780.1563625.7813
Module end 'content' 0.94000.0016 1,405.937512.1250
Script end 0.9415  1,418.0625 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.3365160.0002
Check MTime0.00130.1419160.0001
Mysql Total
Database connection0.00070.073310.0007
Mysqli_queries0.882693.7429640.0138
Looping result0.00080.0840620.0000
Template Total0.914597.120.4572
Template load0.00180.187820.0009
Template processing0.912796.936220.4563
Template load and register function0.00020.020910.0002
states
state_id_array0.00090.097710.0009
state_identifier_array0.00120.127020.0006
Override
Cache load0.00150.1585420.0000
Sytem overhead
Fetch class attribute can translate value0.00080.088840.0002
Fetch class attribute name0.00150.162760.0003
XML
Image XML parsing0.00140.147740.0003
class_abstraction
Instantiating content class attribute0.00000.001660.0000
General
dbfile0.00100.1089230.0000
String conversion0.00000.000740.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
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/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
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 18
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs