Upcoming Events Lists - any display if no events?


(Stuart W) #1

I’ve created an Upcoming Events List on our website to show forthcoming meetings - see this page.


As you will see, under the heading (h2) ‘Forthcoming meetings’, there are no meetings listed. This is because there are no future dates booked.



Can anyone suggest how I can add text to that effect when there are no future meetings booked, i.e. no results. I notice there is not a NoResultsBodyCopy or similar, but surely it must be possible?



Alternatively, could I achieve the same effect using a Calendar Page or anything else?



Many thanks



Stuart







Stuart Willis

Website Officer



Yorkshire Dales National Park Authority,

Colvend, Hebden Road, Grassington, Skipton,

North Yorkshire BD23 5LB.



Direct line: 01756 751640

Email: stuart.willis@yorkshiredales.org.uk

Website: this page


(Nic Hubbard) #2

[quote]
Can anyone suggest how I can add text to that effect when there are no future meetings booked, i.e. no results. I notice there is not a NoResultsBodyCopy or similar, but surely it must be possible?



Alternatively, could I achieve the same effect using a Calendar Page or anything else?

[/quote]



We had had to use javascript to check to see if it is listing any items, if not then we print some text.



Could you use a rolling calendar page? In 4.12.0 it has a No Results Bodycopy.


(Stuart W) #3

Thanks Nic - unfortunately we are on version 4.8.0, so a rolling calendar page isn't an option.


I've had a look and the javascript route will work fine for me - many thanks for the thought!



Cheers

Stu


(Dkevey) #4

Hi Nic and Stuart,

 

Just wondered if you would be able to paste an example of the javascript that you are using to print the "no results" please. We are still using v4.0.3 and my JS is not great. Thanks,


(Nic Hubbard) #5

Hi Nic and Stuart,

 

Just wondered if you would be able to paste an example of the javascript that you are using to print the "no results" please. We are still using v4.0.3 and my JS is not great. Thanks,

 

You need to wrap your listing keyword in a div and then use js to check it is has contents:

 

http://jsfiddle.net/MPXp8/


(Dkevey) #6

Thanks so much Nic, worked perfectly :-)