Forums / Developer / Custom class based on another class

Custom class based on another class

Author Message

Noicokuna Niemoge

Monday 12 January 2009 3:32:46 am

Hello;

I would like to create a class based on image class, that would be:

- just an image class with added custom fields displaying data (I need also other fields (text lines), not only "caption".)
- it could use gallery as a a container, or a gallery-based class.

What's the easiest way to achieve this? I'm pretty confused... especially as I wonder which template should I override and how... or should I? I remember I added a field once, but the results didn't show up in an image viewed in a gallery. I'd also like to change the caption and image view order. How should I do this?

In addition, the design->template section seems to have errors (pagination and filter don't work), but it's a sidenote... is it a known bug or maybe my installation went bad at some point?

Shiki soku ze ku...

kracker (the)

Monday 12 January 2009 4:25:38 am

Hello,

I would create a copy of the image class
named differently. ie: image -> summerimage
using the class editor built into eZ Publish. <i>/class/list</i>

This allows you to customize the class.
(I agree it would be kinda cool to be
able to say summerimage was based
on image and only customize what was needed)

Then create a template override for the class in your
primary design folder's templates as needed.

I would recommend learning to create templates, settings, etc
files by hand instead .... of the RAD tools currently built into eZ or
current extension compatibility.

Still I recommend trying the extension providing "smooth gallery" functionality,
<i>http://ez.no/developer/contribs/applications/ez_smoothgallery
http://smoothgallery.jondesign.net/what/</i>

<i>
//kracker

Em : The Recovery : Gone Again Pt. 2, Mix'em up ...</i>

Member since: 2001.07.13 || http://ezpedia.se7enx.com/

Noicokuna Niemoge

Monday 12 January 2009 4:51:30 am

Thanks, kraker :)

The most irritating is the bug in design->templates which doesn't allow me to browse all system templates... do you have the same problem? (I'm using eZ 4.0.1, both pagination and filter don't work.)

So I think my best bet would be manual copying and editing template files and overriding them in INI settings... right?

Yep, I already created a copy of image class and set the additional fields, just the template overrides seem pretty time-consuming for me... too bad the system doesn't copy the template overrides as well. :) It would be easier to edit them. OK, I'll be back if I stumble upon next problems. (Hopefully not)

Shiki soku ze ku...

kracker (the)

Monday 12 January 2009 5:20:57 am

<i>The most irritating is the bug in design->templates which doesn't allow me to browse all system templates... do you have the same problem? (I'm using eZ 4.0.1, both pagination and filter don't work.)</i>

Those tools never worked very well for me, always causing other negative issues to come up as well. Short answer yes, those have not worked for me in the past and I stoped using them. Sorry ...

<i>So I think my best bet would be manual copying and editing template files and overriding them in INI settings... right?</i>

It is your best bet to getting things working more quickly. Remember to enable ShowUsedTemplates debug to help you while troubleshooting template override problems.

<i>Yep, I already created a copy of image class and set the additional fields, just the template overrides seem pretty time-consuming for me... too bad the system doesn't copy the template overrides as well. :) It would be easier to edit them. OK, I'll be back if I stumble upon next problems. (Hopefully not) </i>

You get faster at it and it has a why to it. But yes too bad a system to copy classes and default templates into a design folder does not yet exist. It might be useful to fully customize an eZ Publish design more quickly.

Cheers,
<i>//kracker

Em : The.Recovery : Bonus Track 15</i>

Member since: 2001.07.13 || http://ezpedia.se7enx.com/

eZ debug

Timing: Jan 18 2025 11:32:17
Script start
Timing: Jan 18 2025 11:32:17
Module start 'content'
Timing: Jan 18 2025 11:32:19
Module end 'content'
Timing: Jan 18 2025 11:32:19
Script end

Main resources:

Total runtime1.5177 sec
Peak memory usage4,096.0000 KB
Database Queries197

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0113 588.8672180.8281
Module start 'content' 0.01131.2576 769.6953567.6484
Module end 'content' 1.26880.2488 1,337.3438336.7422
Script end 1.5176  1,674.0859 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00430.2866210.0002
Check MTime0.00150.0987210.0001
Mysql Total
Database connection0.00420.277510.0042
Mysqli_queries1.408092.77011970.0071
Looping result0.00240.15791950.0000
Template Total1.434994.520.7175
Template load0.00230.149220.0011
Template processing1.432694.393120.7163
Template load and register function0.00070.047610.0007
states
state_id_array0.00370.240910.0037
state_identifier_array0.00430.284320.0022
Override
Cache load0.00200.1309460.0000
Sytem overhead
Fetch class attribute can translate value0.00120.082230.0004
Fetch class attribute name0.00260.171050.0005
XML
Image XML parsing0.00100.063330.0003
class_abstraction
Instantiating content class attribute0.00000.000960.0000
General
dbfile0.00450.2980290.0002
String conversion0.00000.000530.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
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
12content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
8content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 28
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs