List of available user groups

Author Message

Lo' F.

Thursday 21 April 2011 9:59:55 am

Hi guys,

Is there a way I can fecth a list of the available user_group under a user_group parent of the Users's section?

Something like this ... which sadly doesn't work! - where 199 is the id node of the user group under which there are the groups I need to list

{def $groups=fetch( 'content', 'list', hash( 'parent_node_id', 199) )}
 
{foreach $groups as $group}
   {$group.name} <br />
{/foreach}

Thanks!

loredanaebook.it

Marko Žmak

Thursday 21 April 2011 11:38:58 pm

Yes Lo, the example you gave is exactly how you should do it, but it would also be usefull to use class filter, take a look at the documentation for the content/list fetch function:

  • http://doc.ez.no/eZ-Publish/Technical-manual/4.x/Reference/Modules/content/Fetch-functions/list

And your example should work, I don't see any reason why it shouldn't. But here are some ideas:

  • maybe the node id (199) is wrong
  • does the anonymous user have the permission to read "User group" class?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Lo' F.

Friday 22 April 2011 3:14:49 am

Hi Marko,

Right, it was a matter of permission. Thanks!

loredanaebook.it

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 04:19:05
Script start
Timing: Jan 18 2025 04:19:05
Module start 'layout'
Timing: Jan 18 2025 04:19:05
Module start 'content'
Timing: Jan 18 2025 04:19:06
Module end 'content'
Timing: Jan 18 2025 04:19:06
Script end

Main resources:

Total runtime0.8895 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0090 589.0469152.6250
Module start 'layout' 0.00900.0026 741.671939.4531
Module start 'content' 0.01160.8763 781.1250547.9609
Module end 'content' 0.88790.0016 1,329.085912.1641
Script end 0.8895  1,341.2500 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.4584160.0003
Check MTime0.00130.1515160.0001
Mysql Total
Database connection0.00140.157410.0014
Mysqli_queries0.835193.8877570.0147
Looping result0.00050.0600550.0000
Template Total0.859396.620.4296
Template load0.00280.313820.0014
Template processing0.856596.285020.4282
Template load and register function0.00010.011510.0001
states
state_id_array0.00080.087110.0008
state_identifier_array0.00120.131820.0006
Override
Cache load0.00240.2709230.0001
Sytem overhead
Fetch class attribute can translate value0.00060.068820.0003
Fetch class attribute name0.00190.218050.0004
XML
Image XML parsing0.00110.122220.0005
class_abstraction
Instantiating content class attribute0.00000.001560.0000
General
dbfile0.00180.1987240.0001
String conversion0.00000.001440.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
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/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
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezxmltags/li.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/li.tplEdit templateOverride template
2content/datatype/view/ezxmltags/ul.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/ul.tplEdit templateOverride template
1content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 19
 Number of unique templates used: 9

Time used to render debug report: 0.0001 secs