Creating a second Owner_Block

So I have been searching every where and kiling my site trying to get another version of the onwer_block to be created that would hold links to things that are pages.

 

Is there a simple way to create this?

  • What you meant: two owner's blocks, or an alternative of default?

  • One that is similar to the structurer of the original owner_block but with links that I populate it with and not elgg.

  • Just register plugin hook for it:

    elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'my_owner_block_menu');

    Then add a menu item to the user/group ownerblock:

    function my_owner_block_menu($hook, $type, $return, $params) {
        if (elgg_instanceof($params['entity'], 'user')) {
            $url = "your-url-here";
            $item = new ElggMenuItem('your-name', elgg_echo('your-name'), $url);
            $return[] = $item;
        }

        else {
                $url = "your-url-here-for-group";
               $item = new ElggMenuItem('your-name-for-group', elgg_echo('your-name-for-group'), $url);
                $return[] = $item;
        }

        return $return;
    }

     

    Read docs before

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