Forum

Thread tagged as: Question, Events, Comments

Comments on Events App

Hello

Is it possible to add the comments app onto an event in events app?

I have a unique eventID to use to show comments, just not sure how to implement it to show on the event page.

Would it work like the blog comments?

perch_events_custom(array(
    'filter' => 'eventID',
    'match'    => 'eq',
    'value'    => $membersEventId,
    'template' => 'events/listing/event-detail.html'
));

Denise

Denise Courtney

Denise Courtney 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, that should work. Is it not working?

No It isn't.

I am not sure how to group comments for specific event.

Trying this ... bit don't even get a past to go into the system.

<?php

// get the event ref for the logged in user $membersEventRef = perch_member_get('eventRef'); // get the id of the event matching the eventRef $membersEventId = faroffice_epic_get_event_id_for_event_ref($membersEventRef); perch_events_custom(array( 'filter' => 'eventID', 'match' => 'eq', 'value' => $membersEventId, 'template' => 'events/listing/event-detail.html' ));
?>

<?php perch_comments_count(perch_get('eventID')); ?> comments.

        <?php
            perch_comments(perch_get('eventID'));
            perch_comments_form(perch_get('eventID'));
        ?>

I can get the comments working if I just do this to show comments but filtering with the eventID doesn't then work.?

<?php perch_comments('eventID'); perch_comments_form('exentID, ''); ?>

Drew McLellan

Drew McLellan 2638 points
Perch Support

You're using perch_get('eventID') to get eventID from the URL. Does eventID exist on the URL?

No it doesn't. The eventID is pulled from the event info and member. So I only want comments assigned to one event

Tried something like this but the comment just appears on all events and is not unique.

<?php if (perch_member_logged_in()) {

// get the event ref for the logged in user
$membersEventRef = perch_member_get('eventRef');

// get the id of the event matching the eventRef $membersEventId = faroffice_epic_get_event_id_for_event_ref($membersEventRef);

// get the details for the events, currently the default template perch_events_custom(array( 'filter' => 'eventID', 'match' => 'eq', 'value' => $membersEventId, 'template' => 'events/listing/event-detail.html' ));

} ?>

<div class="primary-content">

<?php

perch_comments('eventID'); perch_comments_form('exentID', 'eventTitle'); ?>

    </div>
Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, so if you're not reading something off the URL (the GET request) don't use perch_get().

I think you probably want

perch_comments($membersEventRef);