Forum

Thread tagged as: Configuration, Events

Having a problem displaying an event

I am trying to set up the events app. I installed the events folder into the root of my site. Listing the events displays fine, but when clicking through to the event I get the event.php page displaying, but not the content? I can see from the DEBUG report that eventSlug is blank, I would expect that to read eventSlug='[date]-[event]' I am missing something really basic, but I just can't see it.

Debug Message
SELECT * FROM perch2_pages WHERE pagePath='/events/event.php' LIMIT 1
SELECT * FROM perch2_events WHERE eventSlug = ''
SELECT * FROM perch2_pages WHERE pageNew=0 AND pageHidden=0 AND pageDepth >=0 AND pageDepth<=1 ORDER BY pageTreePosition ASC
SELECT pageTreePosition FROM perch2_pages WHERE pagePath='/events/event.php' LIMIT 1
Using template: \templates\navigation\item.html
SELECT DISTINCT e.* FROM perch2_events e WHERE eventSlug=''
SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
Using template: \templates\events\listing\event-detail.html
Fetching from cache: perch_events_event_categories9e158a0f6af6022286354fe52a539a46
Cache file not found: perch_events_event_categories9e158a0f6af6022286354fe52a539a46
SELECT * FROM perch2_events WHERE eventSlug = ''
Andy Clark

Andy Clark 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

What does the code on your page look like?

Thanks Drew, I wasn't expecting a reply on a Sunday.

The code is just the example pages that come with the app.

I had initially set the event pages up a couple of levels below root and was getting the same problem.

So I copied the events folder 'as is' into root and I am still having the same problem.

List of events is generated on the index.php page by


perch_events_listing();

The event.php page uses


<?php perch_events_custom(array( 'filter'=>'eventSlug', 'match'=>'eq', 'value'=>perch_get('s'), 'template'=>'listing/event-detail.html' )); ?>

The url generated looks right e.g.,


https://popp.local/en/conil/events/event.php?event=2015-02-17-photography-exhibition

I have also noticed that the categories do not display either, using


<!-- Category listing --> <?php perch_events_event_categories(perch_get('s')); ?>

I've tried reinstalling all this a couple of times, but same effect.

Drew McLellan

Drew McLellan 2638 points
Perch Support

You have ?event= in the URL, but you're using perch_get('s') to look for ?s=

Thanks Drew, I was using the templates that I downloaded with the app to get the hang of things? I have just checked, the sample templates use

'value'=>perch_get('s'),

But the output from perch_events_listing() is

<a href="event.php?event={date-title}">Photography Exhibition</a>

Was that an error that I have introduced somewhere?

Thanks , changed perch_get('s') to perch_get('event') and now it works as expected.

Drew McLellan

Drew McLellan 2638 points
Perch Support

That's great. Glad you got it sorted.