Removing group's blog option

The group page has this yes/ no section:





 How to remove the last option (blog option) from the list, and which is the file concerned?

  • Find the add_group_tool_option() call in the plugin's start.php. It doesn't look like there is a remove_group_tool_option() function so you'll have to comment out the add function call.

  • @ Cash

    I was able to see only one add_group_tool_option() call, and that is specific to Forum.

  • blog plugin's start.php

  • Got it, Cash :)

    // Add group menu option

    add_group_tool_option('blog',elgg_echo('groups:enableblog'),true);
                    elgg_extend_view('groups/left_column', 'blog/groupprofile_blog');

    I removed the whole piece, and now 'Edit Group' doesn't contain "enable group blog".

    You have no idea how much this helped me. Much obliged.

  • I have a similar question: What if I need to add add_group_tool_option() but I am not sure what goes in the $name parameter? For example in the above example it can be either 'blog' or 'file' derived/dependant from those respective plug-ins. But in my particular example, I am trying to use it as a flag. Like if it is set to 'yes' then do something else not.

    Also, how one should read this setting?

    Thanks 

  • @ cash

    Thanks to you, I was able to remove the Blog option from groups. 'Edit Group' doesn't contain "enable group blog". But the newly crated groups show "Group Blogs" in the left side bar. Clicking it can start a blog session. I have no idea how it happens. It started recently.

     

  • @woodpecker, don't delete that code from the start.php file. Comment it out like this:

    // Add group menu option

    //add_group_tool_option('blog',elgg_echo('groups:enableblog'),true);
    //              elgg_extend_view('groups/left_column', 'blog/groupprofile_blog');

    Now you need to play with the following file:

    blog/views/default/blog/groupprofile_blog.php -> this deals with the blog widget/box on the group page. Delete this file from your server or comment all the code out.

    Good luck!

  • @Trajan

    Removing or commenting it out won't solve the problem. The problem is that the side bar of the Group page shows "Group Blogs" just below "Group Files".

    I found out the responsible code which is in mod/blog/languages/en.php

    'blog:nogroup' => 'This group does not have any blog posts yet',
    blog:more' => 'More quizzes',
    'blog:group' => 'Group Blogs',

    If you use // or delete the line, it will show 'blog:group' instead of 'Group Blogs'

    The only solution i found is to put 'blog:group' => '', so nothing will be displayed, but that empty space still works as link opening to blogs.

    P.S. This is on behalf of woodpecker, we are woring on it togther.

  • Guys, go to your blog/start.php find the following code:

    // Group submenu

    $page_owner = page_owner_entity();

    if ($page_owner instanceof ElggGroup && get_context() == 'groups') {

        if($page_owner->blog_enable != "no"){

       add_submenu_item(sprintf(elgg_echo("blog:group"),$page_owner->name), $CONFIG->wwwroot . "pg/blog/" . $page_owner->username );

       }

    }

    comment it out.