Displayed group gallery shortcode

Hi

I need to insert a shortcode in the buddypress groups profile to show the displayed group gallery. I am not sure what is the context_id should be,. I remember for sure once I used something like context_id=current or something else to get members images on there profile in the sidebar but can’t how i used the shortcode or where i found the solution.

Please note that i tried things like:

<?php rtmedia_gallery( ) ?> <?php rtmedia_gallery( array( 'context' => 'group', 'context_id' => bp_the_group() ) ); ?>

Hope to get some help as i have been searching for the past couple of hours with no luck!

Thanks for the help

Would be really nice to get a reply on this.

Thanks

Hello @mironomadic,

If we understood correctly, you want to have one custom page where you want to display media uploaded by displayed user into that group.

There is not any direct option available to do the same. However, that can be done by writing custom code.

We are having a filter named rtmedia-model-where-query which you can use to modify the query and add media_author using get_current_user_id().

Thank you.

Hi,

Thanks for the reply!

Please I did not mention displayed user rather displayed group. Here is what is need more simplified explanation:

The buddypress group has an rtmedia tab to show the group uploaded photo gallery, I need to display that gallery there activity tab. So meaning not just any custom page but the actual group page but on another tab.

So if you could provide me a snippet that i can use to display the group gallery would be great.

Hope to have a quick reply this time as i am already 3 days behind on this project.

Thank you very much

Hello @mironomadic,

The buddypress group has an rtmedia tab to show the group uploaded photo gallery, I need to display that gallery there activity tab. So meaning not just any custom page but the actual group page but on another tab.

We are not clear with your requirement. Could you please elaborate a little more so we can better understand?

If it is possible to attach some screenshots, it will help us to get a quick idea.

Thank you.

Super thanks for the quick reply :slight_smile:

Ok when I mentioned bp_the_group() it should pretty much explain it all.

So you have the shortcode to show a certain buddypress group like this example [rtmedia_gallery context=group context_id=3]

Ok great the above shortcode displays the images from buddypress group_id 3. Now i want the id to be dynamic, therefore i am trying to use bp_group_id() which in buddypress prints out the group id. So when using a snippet as the one bellow for example:

<?php $gallery_id = bp_group_id(); ?> <?php rtmedia_gallery(array('context'=> "group", 'context_id'=> $gallery_id )); ?>

It should add the buddypress group id to the context_id! But what is happening is that i am getting some thing like this instead: http://awesomescreenshot.com/02c6128o20

Something similar to what i am trying to do is this but for profiles you can take a look here: Context within buddypress profile page

I want the same thing but for groups. Hope it is clear now!

Thanks

Ok never mind! I got this to work

I used bp_get_current_group_id(); if anyone interested :slight_smile:

Thanks

Hello @mironomadic,

We are happy to hear that your issue has been solved!

We would like to ask some more details on this like - Where exactly you have added this code in buddyPress ( using which BuddyPress filter )?

Could you please provide the complete code snippet so that we can create a general document for the same that could help many other users having the same requirement like you.

Thank you, Pranali