Extend View Priority

Hi, I'm making a simple plugin for the sidebar and using elgg_extend_view();

I want to display some stuff in the sidebar and choose where it shows up. If I set priority to 499, it displays at the very top and if I set it to 500, it goes to the very bottom. How can I make it display somewhere in the middle?

Thanks

EDIT: To be more specific, It's for the groups pages, so like I want my aside module to appear before the search one that shows up on the yoursite.com/groups/all page.

  • You can't using elgg_extend_view - you have the choice of before or after.

    If you want to insert something in the middle you have 2 additional options:

    1. overwrite the view - copy the original view and add your stuff to it

    2. use the 'view', <view> plugin hook and modify the html directly

     

    If you use the developer tools to wrap the views, you might find there's a more granular view in the sidebar you can extend instead to get the desired effect.

     

  • WOW! Amazing stuff.

    I wish I knew about the wrap views option in the developer tools before. I didn't even know developer tools panel existed haha :|

    But that is pretty awesome. I only had to change the view I was extending. Thanks a bunch, man!

     

    Before:

    if(elgg_get_context() == 'groups'){
    	elgg_extend_view('page/elements/sidebar', 'blah/blah', 1);
    }

    After:

    if(elgg_get_context() == 'groups'){
    	elgg_extend_view('groups/sidebar/find', 'blah/blah', 1);
    }
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