Forums / Setup & design / Problems fetching custom content class

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

eZ debug

Timing: Jan 19 2025 04:44:27
Script start
Timing: Jan 19 2025 04:44:27
Module start 'content'
Timing: Jan 19 2025 04:44:27
Module end 'content'
Timing: Jan 19 2025 04:44:27
Script end

Main resources:

Total runtime0.1776 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.0103 590.2031180.8281
Module start 'content' 0.01030.0102 771.031397.8984
Module end 'content' 0.02040.1570 868.9297526.5781
Script end 0.1775  1,395.5078 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00492.7571200.0002
Check MTime0.00170.9469200.0001
Mysql Total
Database connection0.00080.429710.0008
Mysqli_queries0.120567.86181410.0009
Looping result0.00170.95401390.0000
Template Total0.156388.010.1563
Template load0.00130.751410.0013
Template processing0.155087.293410.1550
Override
Cache load0.00100.554210.0010
Sytem overhead
Fetch class attribute can translate value0.00090.489310.0009
XML
Image XML parsing0.00050.308610.0005
General
dbfile0.00241.3543200.0001
String conversion0.00000.007330.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