Support » Plugin: Events Manager » [Plugin: Events Manager] buddyPress group event avatar in event-list.php

  • Resolved headworm


    Is it possible to show the group avatar of an events associated group in the main event lists?

    I can easily show the group avatar on the groups event page (group-events.php) using
    <?php bp_group_avatar( 'type=thumb&width=60&height=60' ) ?>

    but this seems to be the only list I can show the group avatar in.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thanks agelonwl that seems to be exactly what I have been looking for, specifically the code offered by jazbek but, alas, I have no idea how to implement it as I only have a very basic knowledge of php; any pointers would be most helpful if anyone has the time and inclination to assist. 🙂

    you can try this steps:

    1. create a folder/file in your theme /plugins/events-manager/buddypress/group-events.php

    2. add this snippet <th><?php _e ( 'Group', 'dbem' ); ?></th> below <th><?php _e ( 'Location', 'dbem' ); ?></th>

    3. add this snippet

    <td><?php $event_group = groups_get_group( array( 'group_id' => $event->group_id )); ?>
    <?php if ($event->group_id > 0) : ?>
    <a href="<?php echo bp_get_group_permalink($event_group) ?>"><?php echo bp_core_fetch_avatar('object=group&item_id='.$event_group->id) ?><br/>
    <small><?php echo $event_group->name ?></small></a>
    <?php endif; ?></td>

    <td><?php echo $location_summary; ?>.............</td>

    Thank you so much agelonwl, that works perfectly and is exactly what I need but would really like this in the main events list and search results which I am currently trying to figure out how to do, any advice on this would be most welcome. It seems like the best thing would be a placeholder for this though reading through the tutorials has so far only frazzled my brain. Really appreciate your time helping out.

    I now have group info showing in my main events list. I did this by creating a new placeholder file called groupinfo.php and saving it to my-theme/plugins/events-manager/placeholders/ containing the snippet of code agelonwl kindly pasted above. I also changed both instances of $event to $EM_Event

    I added my placeholder #_GROUPINFO to the core file plugins/events-manager/classes/em-event.php like this:

    case '#_GROUPCOLUMN':
    	$template = em_locate_template('placeholders/groupcolumn.php', true, array('EM_Event'=>$this));
    	$replace = ob_get_clean();

    Then put my place holder in the correct place in Default event list format in the back end and all is tickety boo.. well nearly.

    I am sure this is far from ideal as I don’t really know what I am doing with php or the core files and of course this will need replacing after every update but aside from this, the only issue now for me is not being able to search groups via the search form. If I can do that then at least I’ll have my site working as intended even if it is a bit weird.

    Any comments, advice or pointers appreciated as always.


    please see this tutorials for creating placeholders –

    also, searching group inside the events search form might not be possible.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: Events Manager] buddyPress group event avatar in event-list.php’ is closed to new replies.