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

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 31 2025 04:33:44
Script start
Timing: Jan 31 2025 04:33:44
Module start 'layout'
Timing: Jan 31 2025 04:33:44
Module start 'content'
Timing: Jan 31 2025 04:33:44
Module end 'content'
Timing: Jan 31 2025 04:33:44
Script end

Main resources:

Total runtime0.0148 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0057 588.1328151.2109
Module start 'layout' 0.00570.0037 739.343836.6484
Module start 'content' 0.00940.0042 775.992294.2656
Module end 'content' 0.01350.0013 870.257833.9922
Script end 0.0148  904.2500 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002315.3422140.0002
Check MTime0.00107.0274140.0001
Mysql Total
Database connection0.00085.400710.0008
Mysqli_queries0.003825.868830.0013
Looping result0.00000.101310.0000
Template Total0.00096.310.0009
Template load0.00074.632410.0007
Template processing0.00021.617010.0002
Override
Cache load0.00053.262910.0005
General
dbfile0.00021.644380.0000
String conversion0.00000.054740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_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