Events Manager
[resolved] buddyPress group event avatar in event-list.php (7 posts)

  1. headworm
    Posted 4 years ago #

    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.


  2. agelonwl
    Posted 4 years ago #

  3. headworm
    Posted 4 years ago #

    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. :)

  4. agelonwl
    Posted 4 years ago #

    you can try this steps:

    1. create a folder/file in your theme /plugins/events-manager/buddypress/group-events.php - http://wp-events-plugin.com/documentation/using-template-files/

    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>

  5. headworm
    Posted 4 years ago #

    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.

  6. headworm
    Posted 4 years ago #

    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.

  7. agelonwl
    Posted 4 years ago #


    please see this tutorials for creating placeholders - http://wp-events-plugin.com/documentation/placeholders/

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Events Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic