Forum

Thread tagged as: Question, Events

Event detail not showing

I have a event listing page (based on nest demo) which correctly lists my events. https://www.pour.it/events/event-listing.php

However, when I click on an event, it takes me to a 404 page rather than the detail https://www.pour.it/events/2015-04-18-testing-event/

In the next demo the detail events display the detail ok https://xxx.perchlabs.net/events/2020-08-23-summer-bbq-social/

I have the template/event/event.html and event/listing.html based on the nest demo and the standard /event pages that come with the app.

Have I missed something out thats causing the event details not to show?

BTW - the events/index.php example didnt take me anywhere when I clicked on it

cow shed

cow shed 0 points

  • 6 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

Do you have .htaccess rewrite rules in place so that URL resolves to the correct location of your detail page?

Ah - I didnt. I can see a rewrite rule in the nest example - I thought the event.php was my detail page so I added RewriteRule ^events/([a-zA-Z0-9-]+)/$ /events/event.php?event=$1 [L]

Its a bit better than before but not right.

In the nest demo, what is the detail page behind the events?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Thanks - that made sense - but I'm still having problems.

My event/index.php page looks ok, but when I click on the even to see the detail, it takes it down a directory level and none of my links work (although I can see the event detail now).

In blog, I have an index.php and when I click on the blogs listed, it takes me to post.php?... (which has the right links) and all works fine (without the need to change the .htaccess file)

I assumed in event, the index.php listing would take me to event.php?... - again without having to change htaccess. However, since it goes to index.php/slug directly, the links dont work (as they are coded for the index.php level).

I realise the nest example may be different (with its if statement displaying either the listing or the event) but I cant get the event example pages to display the detail either so I must be missing something else?

Rachel Andrew

Rachel Andrew 394 points
Perch Support

Is your link formed correctly in your template? As in does it go to the page you expect it to go to?

Well https://www.pour.it/events/index.php takes me to https://www.pour.it/events/2015-04-18-testing-event/

which ties in with my template : <p><a href="/events/<perch:events id="eventSlug" />/" class="read-more">Read More »</a></p>

But I cant see what .php file the detail is displaying on - it isnt events/index.php as the links dont work on the detail page (the event info is correct, its just the css links etc that are at the wrong level)

BTW - the events/index.php example didnt take me anywhere when I clicked on it - it just seemed to reload the index.php file. As does my listing on my homepage :https://www.pour.it/

Drew McLellan

Drew McLellan 2638 points
Perch Support

Did you build the site?

Yes! Its not working yet (I ticked completed to this by mistake).

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, so where is your event detail page? Have you created one?

Hi Drew

I really appreciate you looking at this - its driving me mad! I dont have any problem with the gallery or blog apps, but although I can get the listings and calendars working, I cant see how to get them to link to a detail page.

I have 2 ways I've tried to create a detail page - the first is as per my understanding of the nest demo - ie event/index.php has an if statement to display either the event or the listing. The other is my specific event-detail.php page which is just meant to display the event.

The main problem I see is that the slug is not getting populated.

So I have reloaded the examples to see if I can get these working (overwriting my version of event/index.php).

As a general point, one thing I'm really struggling with is working out which event template goes with what - I cant see this anywhere in the documentation but maybe I'm missing it. I end up having to add headings to each template and see what turns up.For example basic-listing.php has perch_events_listing() which doesnt give much away - I know now it uses event-day.html but only from reading all the event entries in the forum - not the event documentation.

I would expect the events in basic-listing.php to use event-day.html to display events which can be clicked on to display event.php and display information using event-detail.html.

The example event-day.html has <a href="<perch:events id="eventURL" />"><perch:events id="eventTitle" /></a></span> but this doesnt take me anywhere.

So I have a new version of event-day.html with <a href="event.php?s=<perch:events id="eventURL" />"><perch:events id="eventTitle" /></a></span> but that gives me a blank slug : https://www.pour.it/events/event.php?s=

I have seen from other forum entries, that changing 'value'=>perch_get('s') to to perch_get('event') helps with a missing slug - but its not clear to me where I should change this on the example files which dont use custom templates.

Am I totally missing how this works?

BTW : what i had done in my version is set out below - the links wont work as I have now updated events directory with the example files again on the live server - In summary I have 3 instances of listings/calendars - This is what I have :

Home page - uses custom_listing_day.html

<?php perch_events_custom(array( 'filter'=>'eventDateTime', 'match'=>'gte', 'value'=>date('Y-m-d'), 'count'=>10, 'sort'=>'eventDateTime', 'sort-order'=>'desc', 'template'=>'listing/custom-listing-day.html' )); ?>

The custom_listing_day template that comes with the events app has the link : <a href="<perch:events id="eventURL" />"><perch:events id="eventTitle" /></a> I have updated it to : <a href="events/index.php?s=<perch:event id="eventSlug" />"><perch:events id="eventTitle" />NEW</a> but when I click on an event in the listing on the home page, it takes me to https://www.pour.it/events/index.php?s= ie the slug is empty.

I also have event/index.php

This is meant to work as a listing page and a detail page - as per nest example. <?php if (perch_get('event')) { perch_events_custom(array( 'template' => 'events/event.html', 'filter' => 'eventSlug', 'match' => 'eq', 'value' => perch_get('event'), )); }else{ perch_events_custom(array( 'template' => 'events/listing.html', 'sort' => 'eventDateTime', 'sort-order' => 'ASC', 'filter' => 'eventDateTime', 'match' => 'gte', 'value' => date('Y-m-d 23:59:59'), )); } ?> The listing.html and event.html are from the nest example. It works fine as a listing page, but when I click on a listing, it take me from https://www.pour.it/events/index.php to for example https://www.pour.it/events/2015-03-22-minis-and-munchkin-training/

I also have a calendar page : https://www.pour.it/pages-cfpc/event-diary.php This uses event-day.html. Again the default template doesnt take me anywhere. I have tried updating it to point to my event/index.php and also the event-detail.php pages but neither gets passed the slug.

Rachel Andrew

Rachel Andrew 394 points
Perch Support

I would suggest using the example files included with the events app as opposed to the Nest demo as they are going to make fewer assumptions about your environment.

Get those working first and then make your adaptations.

Yes I agree - and it is the Perch example files I have been using since last night (I overwrote my nest examples).

With the Perch example files I have remove the htaccess rewrite rule (added earlier in this thread) (still not sure why i need this when i dont for gallery and blog).

Now when I click on an event in https://www.pour.it/events/basic-listing.php it takes me to https://www.pour.it/events/event.php?s=

I thought the problem was that s= blank, so I manually added the event - ie https://www.pour.it/events/event.php?s=2015-03-22-minis-and-munchkin-training/ but that doesnt show anything either.

Have I set up the example incorrectly?

Drew McLellan

Drew McLellan 2638 points
Perch Support

I think the example files use event= don't they?

Yes sorry - I still had a custom event-day.html. I have removed it now and its all as per demo.

Now when I click on and event in https://www.pour.it/events/basic-listing.php it takes me to the same page : https://www.pour.it/events/basic-listing.php.

Event-day.html has <span class="event summary <perch:events id="category_slugs" />"><a href="<perch:events id="eventURL" />"><perch:events id="eventTitle" /></a></span>

BTW I'm using Perch Events 1.9.2 on Perch 2.8.2. I see it has just gone up to 2.8.3 so I will update incase that helps.

I'm on 2.8.3 now, but it didnt help!

Drew McLellan

Drew McLellan 2638 points
Perch Support

Put the following in your event listing template. What does it output?

<perch:showall />

I put it int event-day.html. There is output for each event. This is the first one :

ID Value perch_page_path /events/basic-listing.php image
eventID 10 eventTitle Test Fri Am eventSlug 2015-03-20-test-fri-am eventDateTime 2015-03-20 07:27:00 eventDescRaw Test eventDescHTML
Test

eventDynamicFields {"image":null} day 20 perch_image category_slugs
category_names
eventURL
perch_item_first true perch_item_last true perch_item_zero_index 0 perch_item_index 1 perch_item_rev_index 1 perch_item_rev_zero_index 0 perch_item_odd
perch_item_count 1

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, so you do have an eventSlug. That's good.

What value do you have set for the event URL on the Settings page in Perch?

Its working!! Hooray.
Not sure whats changed - but fab its all ok.

(The setting was /events/event.php?s={eventSlug} - i didnt change this)

Thanks so much.