Forums / Developer / Help with fetching custom class

Help with fetching custom class

Author Message

Lian Kwee Ang

Thursday 02 October 2008 2:10:06 am

Hi,

I've taken over work utilising ezpublish 3.8.4

I have a folder that stores a bunch of articles. Since I needed more fields for the articles to come, I created a custom article class.

I used the code below to fetch the articles

{def $page_limit=20}
{def $list_items=fetch('content','list',hash('parent_node_id',1947,
		'sort_by', array('published', false()), 'limit', $page_limit, 
		'class_filter_type',  'include', 'class_filter_array', array( '43' ), 'class_filter_array', array( '2' )
))}	

Array 2 refers to the article class

Array 43 refers to my customised article class.

Node 1947 is the folder I am storing my articles in.

However when listing, only the Article class ones show and not the new customised class (43) I made.

Can there be something else that is blocking my listing?

Thanks in advance for the help!

Ivo Lukac

Thursday 02 October 2008 3:15:31 am

Hello Lian,

You only need one class_filter_array like this:

{def $page_limit=20}
{def $list_items=fetch('content','list',hash('parent_node_id',1947,
                'sort_by', array('published', false()), 'limit', $page_limit, 
                'class_filter_type', 'include', 'class_filter_array', array( '43','2' ) ))}  

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

Lian Kwee Ang

Thursday 02 October 2008 7:54:44 pm

Hi!

And thanks for the reply.

I've tried your method but unfortunately, the customised article class still does not get listed.

Is there somewhere that the previous coder could have specified that only Article class (2) can be fetched on that page? I've checked the override.ini.append.php, it looks fine there.

I'm really stuck on this.

Also, using

{$node.children|attribute(show,1)}

It shows all only 10 of the supposedly 13 children of the node.

In the admin panel, I see 10 article class and 3 customised article class. However, even without using the fetch command and just by using the node.children above, it seems somehow the node is not acknowledging non-article class as its children.

How do I fix that?

I will be thankful for any help!

Ivo Lukac

Friday 03 October 2008 1:47:13 am

It sound weird.
If they are not listed in $node.children then only rational explanation is that you have no privileges to see them. Either they are hidden or maybe in some non standard section or they are edited in language which is disabled in your siteaccess.
Can't remember anything else.

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

eZ debug

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

Main resources:

Total runtime0.1535 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.0055 588.8281180.8359
Module start 'content' 0.00550.0046 769.664197.9922
Module end 'content' 0.01010.1433 867.6563526.7734
Script end 0.1535  1,394.4297 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00342.2091200.0002
Check MTime0.00140.9200200.0001
Mysql Total
Database connection0.00080.540010.0008
Mysqli_queries0.115074.90271410.0008
Looping result0.00120.75961390.0000
Template Total0.143093.110.1430
Template load0.00080.488610.0008
Template processing0.142292.640210.1422
Override
Cache load0.00050.344010.0005
Sytem overhead
Fetch class attribute can translate value0.00070.485910.0007
XML
Image XML parsing0.00030.174610.0003
General
dbfile0.00150.9501200.0001
String conversion0.00000.002630.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