Changing 'Create A Group' page, setting and hiding options

Hi, I'm looking for help on setting some default options in the 'Create a Group' page, specifically the options for:

Enable group activity

Enable group discussion

 

Enable group events

Enable group files

 

Enable group pages

I'm thinking I need to create a plugin for this, but currently my only lead is that "elgg_get_config" has something to do with getting the values from the DB, and that I'll need to set those values my self and override the view so that the options are hidden, or not rendered at all.  Any ideas?

  • If you just want to make the options hidden, then use css to set their visibility or display as hidden.

  • I've not tried this myself but it should be possible with the function remove_group_tool_option() (see http://reference.elgg.org/group_8php.html#a397a9d3822cb603f4c3910d6fae17b7e). The group options are added by add_group_tool_option() by the corresponding plugins and using remove_group_tool_option() within the init function of your own plugin should disable these options again.

    You would have to find out what names the group options are registered as (first parameter used in add_group_tool_option()). For example for the pages group option the name would be 'pages', so removing the group pages should work with

    remove_group_tool_option('pages');

    The plugins might also extend the 'groups/tool_latest' view using elgg_extend_view(). You can unextend these views again with elgg_unextend_view(), e.g.

    elgg_unextend_view('groups/tool_latest', 'pages/group_module');

    For activity and the group discussion the tool options are registered in the groups plugin with names 'activity' and 'forum' respectively. For the other group tool options check out the init functions of the corresponding plugins.

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking