So too dumb a question ?
Just wondering if there is an easy way than, for instance, using group extension api.
Group api is the proper and easy way. Once you understand it it is not too difficult.
Thx modemlooper.
I’ve used that api many times and it’s great.
Just being lazy. Funny how that often takes longer.
@modemlooper
Ok, tried using the Group Extension Api.
But it seems to only apply to single groups… ?
Which is what this does… https://gist.github.com/4531952
Any suggestions on how to point a li tab created in bp-default/groups/index.php to a function ?
I hope it doesn’t involve creation of a new component.
Those tabs are not added with code they are written into the html /bp-default/groups/index.php
if you want to add a tab you use this and echo html for a tab:
`add_action( ‘bp_groups_directory_group_filter’ );`
then you use to display a page based on the slug
`if ( $bp->current_component == BP_GROUPS_SLUG && $bp->current_action == ‘name-of-tab’ ) {
//create functions to show content
add_action( ‘bp_template_title’, ‘bp_example_screen_one_title’ );
add_action( ‘bp_template_content’, ‘bp_example_screen_one_content’ );
//this loads a special template file to show content
bp_core_load_template( apply_filters( ‘bp_core_template_plugin’, ‘plugin-file-location’ ) );
}`
Thx modemlooper, but I know all that and have used it before.
>then you use to display a page based on the slug
Hmmm, the whole point is not to load a new page but to use the same approach as
All Groups and My Groups.
So, load some content based on an ajax call – which I’ve also done before but not in this context, without using bp_core_new_subnav_item or bp_core_new_nav_item.
I was hoping there was some way to just add a new li id and handle it from there.
I’ll keep digging and post updates here.
Thanks for your input.
I posted something in regards to this on trac. The directory is really specific in it’s content. The entire tab system is hard handed in controlling the display via javascript. The javascript only knows how to process a loop. if you add a tab and click it the js only knows how to reload the loop. There is no logic for displaying other content, yet.
I say yet because I think it can be improved to allow non-loop content to be shown when a tab is clicked.
stay tuned….
That would be a very handy improvement.
I assume / hope it would apply to all theme directory index files, like /groups/, /members/
Let me know if I can help to test or try to break a patch.