Forums / Setup & design / hash, classID or className?

hash, classID or className?

Author Message

nigel dodd

Friday 05 November 2004 10:08:33 am

Using classIDs, i.e. numbers, in the hash function for Fetch evidently works. However the documentation sometimes uses classNames, eg:

{* Loop through all sub-folders within the "Links" folder. *}
{section loop=fetch( content,
                     list,
                     hash( parent_node_id,     __NODE_ID_OF_LINKS__,
                           class_filter_type,  include,
                           class_filter_array, array( 'folder' ),
                           sort_by,            $node.sort_array ) ) }

which uses the className 'folder' instead of numeral 1 classID. Can we use our homegrown classes here by name?

There seems scope for confusion here since using 'article' returns nodes with classes only of type article whereas using 'Article' seems to return ALL nodes regardless of class. Likewise, using my own homegrown classes by name seems to return all nodes regardless of class.

I cannot find the definition of this function in the php code to see how it works. Could someone more knowledgeable please comment.

nigeldodd AT blueyonder.co.uk

Hans Melis

Saturday 06 November 2004 1:14:55 am

Hi Nigel,

The content/list fetch function is documented here:
http://ez.no/ez_publish/documentation/reference/data_fetching/content/list

There's a heading "Class filtering" (they forgot to put it in bold though, but it's the paragraph after Filtering). There you'll see that you can use numerical IDs or class <b>identifiers</b>. So there's the reason for the difference between 'article' and 'Article'. An identifier is a stripped version of a name. The identifier is reliable for fetching, the name isn't.

'Article' is not an identifier, so the class filtering fails and returns everything. 'article' is the correct identifier of the Article class, so the filtering works.

You can see the identifiers in the class list in the admin interface. And yes, you can use your custom made classes in the same way. There's no difference for eZ publish.

hth

Hans
http://blog.hansmelis.be

nigel dodd

Saturday 06 November 2004 11:57:13 am

Thanks Hans,

I failed to follow the documentation down to the leaves of the tree.

It is still slightly counter-intuitive that the function returns ALL nodes if you ask for those belonging to a non-existant class. I would expect it to return no nodes at all.

Grateful for your help.

Nigel

Paul Borgermans

Sunday 07 November 2004 7:10:46 am

Nigel,

Please file a bug report on this (returning all nodes with invalid class id's).

-paul

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

eZ debug

Timing: Jan 20 2025 05:53:17
Script start
Timing: Jan 20 2025 05:53:17
Module start 'content'
Timing: Jan 20 2025 05:53:19
Module end 'content'
Timing: Jan 20 2025 05:53:19
Script end

Main resources:

Total runtime1.9341 sec
Peak memory usage4,096.0000 KB
Database Queries199

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0080 588.9531180.8359
Module start 'content' 0.00801.7652 769.7891602.4063
Module end 'content' 1.77320.1608 1,372.1953337.3750
Script end 1.9340  1,709.5703 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00460.2392210.0002
Check MTime0.00170.0902210.0001
Mysql Total
Database connection0.00080.042010.0008
Mysqli_queries1.833794.80711990.0092
Looping result0.00260.13491970.0000
Template Total1.891497.820.9457
Template load0.00190.099620.0010
Template processing1.889597.692620.9447
Template load and register function0.00010.005110.0001
states
state_id_array0.00300.153410.0030
state_identifier_array0.00420.215920.0021
Override
Cache load0.00160.0842310.0001
Sytem overhead
Fetch class attribute can translate value0.00170.089640.0004
Fetch class attribute name0.00090.046070.0001
XML
Image XML parsing0.00240.121840.0006
class_abstraction
Instantiating content class attribute0.00000.000780.0000
General
dbfile0.01270.6553390.0003
String conversion0.00000.000330.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
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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