Complicated fetch...

Author Message

Christian Johansen

Wednesday 05 July 2006 7:08:31 am

I'm trying to do a fetch that I'm not sure is possible. I don't know how to do it anyways, so I was hoping for some input. This is my situation:

Content structure
- Articles
- Cat 1
- article 1
- article 2
- ...
- Cat 2
- article 1

and so on.

These use images stored in the media library through it's related objects. There's no custom image input on the article class, just related objects to store the images. Now what I want to do is to display all images from Category 1 and so on. That is - objects of type "image" related to the children and grandchildren of the current node. Is this possible? I can see a few ways to hack it, but not without generating (literally) a thousand sql queries... Has anyone done anything like it?

Pål Jostein Didriksen

Saturday 08 July 2006 10:28:38 am

Well, I'm thinking that it should be possible to do it like this:

- fetch content tree, set the class_filter_array to 'article'

- loop through the contents and display the related object by using {attribute_view_gui attribute=$node.something}

Another possibility could be to create a line view template override for the class article, that will only display the image. Check the line view template you already have for displaying articles, it should give you the code needed to display the images.

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 18 2025 19:39:39
Script start
Timing: Jan 18 2025 19:39:39
Module start 'layout'
Timing: Jan 18 2025 19:39:39
Module start 'content'
Timing: Jan 18 2025 19:39:40
Module end 'content'
Timing: Jan 18 2025 19:39:40
Script end

Main resources:

Total runtime0.7311 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0049 587.8125152.6094
Module start 'layout' 0.00490.0030 740.421939.4141
Module start 'content' 0.00790.7218 779.8359458.8516
Module end 'content' 0.72970.0013 1,238.68758.1875
Script end 0.7310  1,246.8750 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.4433160.0002
Check MTime0.00130.1840160.0001
Mysql Total
Database connection0.00060.087810.0006
Mysqli_queries0.690594.4453540.0128
Looping result0.00050.0698520.0000
Template Total0.701896.020.3509
Template load0.00200.270820.0010
Template processing0.699895.729120.3499
Template load and register function0.00020.031210.0002
states
state_id_array0.00070.101010.0007
state_identifier_array0.00180.244620.0009
Override
Cache load0.00160.2251190.0001
Sytem overhead
Fetch class attribute can translate value0.00090.116820.0004
Fetch class attribute name0.00120.162620.0006
XML
Image XML parsing0.00030.036720.0001
class_abstraction
Instantiating content class attribute0.00000.001320.0000
General
dbfile0.00130.1774100.0001
String conversion0.00000.001440.0000
Note: percentages do not add up to 100% because some accumulators overlap

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
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 8
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs