Forums / Developer / Classes from given class group

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.