Forums / Developer / Extracting the class name from a node

Extracting the class name from a node

Author Message

Randeep Walia

Wednesday 01 September 2004 11:09:51 pm

I swear this seems like it should be the most basic thing in the world but I can't seem to find it documented anywhere!

In my template I want to extract the class name from the current node. That's all, but I don't know how its done.

It doesn't seem to be a default attribute or in data_map or anything. Can anyone point me in the right direction?

Randeep

__________________________________
Randeep Walia is http://www.rundeep.net powered by EZ Publish

Hans Melis

Thursday 02 September 2004 6:23:59 am

Hi,

A node doesn't have a class name, but the contentobject inside the node has it. Translated into template language:

{$node.object.class_name}

Hans
http://blog.hansmelis.be

Randeep Walia

Thursday 02 September 2004 10:19:36 am

Thanks,

You know I <i>was</i> messing around with the object of the node figuring the answer lay there but I was trying to use class_id or something.

Also I was trying to use the attribute operator which I couldn't get to work last night but is working now, for some reason and would have solved my dilemma. One thing that isn't working however, is when I try to do

{$node.object|attribute("show_values")}

I've tried with and without quotes around the 'show_values' but to no avail- I just get the listing of attributes and not their values.

Also I wonder why I couldn't find the answer to my solution in existing documentation or forums: are the properties of objects documented somewhere on this website?

__________________________________
Randeep Walia is http://www.rundeep.net powered by EZ Publish

Hans Melis

Thursday 02 September 2004 12:28:15 pm

"show_values" doesn't exist as a valid option. That seems to be quite misleading in the documentation, but the explanation does mention the correct value for the first parameter. The most common form is:

{$node.object|attribute(show)}

I don't know if a list of properties of objects is documented. I know the most important ones by heart because I started back when there was no documentation at all (at least not for developers). If I want to know the properties of objects, I just look the PHP file of the class.

Hans
http://blog.hansmelis.be

Andrew Vorobyov

Sunday 13 February 2005 3:41:21 am

Thank you!!! Now I've got what I needed

eZ debug

Timing: Jan 31 2025 01:24:59
Script start
Timing: Jan 31 2025 01:24:59
Module start 'content'
Timing: Jan 31 2025 01:24:59
Module end 'content'
Timing: Jan 31 2025 01:24:59
Script end

Main resources:

Total runtime0.1697 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 587.9531370.2891
Module start 'content' 0.00610.0122 958.24221,005.5625
Module end 'content' 0.01830.1513 1,963.80473,893.7109
Script end 0.1697  5,857.5156 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00412.4044200.0002
Check MTime0.00130.7558200.0001
Mysql Total
Database connection0.00060.364110.0006
Mysqli_queries0.086050.67161410.0006
Looping result0.00110.66561390.0000
Template Total0.151088.910.1510
Template load0.00060.376510.0006
Template processing0.150388.570610.1503
Override
Cache load0.00040.255810.0004
Sytem overhead
Fetch class attribute can translate value0.00150.867310.0015
XML
Image XML parsing0.00020.146210.0002
General
dbfile0.00553.2253200.0003
String conversion0.00000.001830.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