Problems fetching custom content class

Author Message

Gintautas S.

Saturday 26 July 2008 9:44:44 am

Hi, first time poster :)

I have no problem using overriden (by me) templates to generate HTML for built in classes and classes, which I made from built-in classes (by copying and then editing the definitions from admin interface). But when I tried to fetch some nodes which happen to be of class defined by me from scratch, it doesn't work. I have ruled out the posibility of bogus template code, because once I created a built in class object under the same node under which my custom class objects reside, it showed in the result.

I use template function { fetch( content, list, hash( parent_node_id, $node.node_id ) ) }.

When I tried turning debugging on, I saw that there was no template calls for those objects at all! So I guess I might need to register my new class with the ezPublish system perhaps?

Ivo Lukac

Saturday 26 July 2008 10:27:53 am

Hi Gintautas

Reed this:
http://ez.no/doc/ez_publish/technical_manual/3_9/templates/the_template_override_system

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

Gintautas S.

Saturday 26 July 2008 11:06:56 am

I know overrides are working for me, because I have used them for some classes successfuly. It's some kind of fetching problem, because once I 'have' the array of fetched objects, there should be a call to appropriate template which is not the case. I saw this by inspecting debug info ("show used templates"). I don't reach the override point so to speak, because the default template (node/view/full.tpl) isn't getting called for my class objects, but again override works fine for predefined classes (I can see it in debug info: source template and then the template with which it is overriden are listed). I know this is confusing, but I need to get it solved somehow.

SO maybe I have to 'register' my newly defined class somewhere, for instance in an .INI file?

Ivo Lukac

Saturday 26 July 2008 12:14:13 pm

When you create objects from your custom class they should show up with node/view/full.tpl and node/view/line.tpl . Then with override system you use your templates. It is simple. You either:
- didn't configured your override.ini well
- placed your templates in wrong location
- didn't cleared the override cache

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 18 2025 21:01:37
Script start
Timing: Jan 18 2025 21:01:37
Module start 'layout'
Timing: Jan 18 2025 21:01:37
Module start 'content'
Timing: Jan 18 2025 21:01:38
Module end 'content'
Timing: Jan 18 2025 21:01:38
Script end

Main resources:

Total runtime0.5700 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 588.0313152.6406
Module start 'layout' 0.00540.0021 740.671939.4766
Module start 'content' 0.00750.5611 780.1484549.7266
Module end 'content' 0.56850.0014 1,329.875012.1406
Script end 0.5699  1,342.0156 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.5451160.0002
Check MTime0.00130.2236160.0001
Mysql Total
Database connection0.00090.152110.0009
Mysqli_queries0.523191.7779600.0087
Looping result0.00060.1006580.0000
Template Total0.542595.220.2712
Template load0.00190.329820.0009
Template processing0.540694.842420.2703
Template load and register function0.00030.044010.0003
states
state_id_array0.00070.118410.0007
state_identifier_array0.00080.141320.0004
Override
Cache load0.00160.2795210.0001
Sytem overhead
Fetch class attribute can translate value0.00070.120520.0003
Fetch class attribute name0.00090.151150.0002
XML
Image XML parsing0.00080.146720.0004
class_abstraction
Instantiating content class attribute0.00000.001960.0000
General
dbfile0.00170.2960170.0001
String conversion0.00000.001040.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
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/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: 15
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs