Forums / General / Pls explain namespace concept in sections

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

eZ debug

Timing: Jan 18 2025 16:02:04
Script start
Timing: Jan 18 2025 16:02:04
Module start 'content'
Timing: Jan 18 2025 16:02:04
Module end 'content'
Timing: Jan 18 2025 16:02:04
Script end

Main resources:

Total runtime0.1307 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0046 587.8359180.8203
Module start 'content' 0.00460.0062 768.656398.0234
Module end 'content' 0.01090.1197 866.6797526.0000
Script end 0.1306  1,392.6797 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00332.5503200.0002
Check MTime0.00141.0654200.0001
Mysql Total
Database connection0.00050.410110.0005
Mysqli_queries0.090869.49401410.0006
Looping result0.00110.86141390.0000
Template Total0.119291.210.1192
Template load0.00100.734610.0010
Template processing0.118290.469310.1182
Override
Cache load0.00060.494410.0006
Sytem overhead
Fetch class attribute can translate value0.00060.465410.0006
XML
Image XML parsing0.00020.184410.0002
General
dbfile0.00332.4946200.0002
String conversion0.00000.002930.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs