Classes from given class group

Author Message

Andrey Astakhov

Friday 04 August 2006 2:52:52 pm

Hi,
i need to display class names list in a template.
All I know is class group id.

I didn't found appropriate parameter in the fetch function 'list' from the module 'class'.
Could you advice me please what should I do then?
Should I create my own template function?
Is it possible to write new fetch function?

Kristof Coomans

Saturday 05 August 2006 1:50:37 am

Hello Andre

Are these the classes the user is allowed to instantiate (under a specific node)? Then you can use the content/can_instantiate_class_list fetch function: http://ez.no/doc/ez_publish/technical_manual/3_8/reference/modules/content/fetch_functions/can_instantiate_class_list

If that's not the case, you can request an enhancement (http://ez.no/community/bugs ) for the class/list fetch function, or try to hack it yourself. You can find the code of the fetch function in kernel/class/function_definition.php and kernel/class/ezclassfunctioncollection.php. Good luck!

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Andrey Astakhov

Saturday 05 August 2006 2:49:57 am

Thank you, Kristof.

<i>Then you can use the content/can_instantiate_class_list fetch function</i>
Unfortunately it's not my case.

<i>...or try to hack it yourself.</i>

I wondered, is hack the best solution to implement specific functionality?
Are there another ways to build such class list: e.g. template fuction?

Kristof Coomans

Sunday 06 August 2006 2:36:00 am

 is hack the best solution to implement specific functionality? 

No it isn't :-) Normally you would create an extension with a new module and fetch functions. But I wouldn't call this "specific functionality", it concerns the default class module and the needed function can be useful for others too, so I think it should be part of the kernel.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Andrey Astakhov

Monday 07 August 2006 8:36:09 am

Thank you, Kristof.
Your advices are very helpful.
I will not request an enhancement, but i will create a new template function in my extension.

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 06:17:48
Script start
Timing: Jan 31 2025 06:17:48
Module start 'layout'
Timing: Jan 31 2025 06:17:48
Module start 'content'
Timing: Jan 31 2025 06:17:48
Module end 'content'
Timing: Jan 31 2025 06:17:48
Script end

Main resources:

Total runtime0.0169 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.0061 588.1328151.2109
Module start 'layout' 0.00610.0033 739.343836.6484
Module start 'content' 0.00930.0055 775.992294.2656
Module end 'content' 0.01480.0020 870.257833.9922
Script end 0.0168  904.2500 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002615.3407140.0002
Check MTime0.00127.1089140.0001
Mysql Total
Database connection0.00074.389910.0007
Mysqli_queries0.003219.138930.0011
Looping result0.00000.207110.0000
Template Total0.00158.810.0015
Template load0.00105.779010.0010
Template processing0.00052.996610.0005
Override
Cache load0.00073.982810.0007
General
dbfile0.00116.676480.0001
String conversion0.00000.064840.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