Home › Forums › Calendar Products › Events Calendar PRO › Time Display
- This topic has 13 replies, 2 voices, and was last updated 13 years, 6 months ago by
Barry.
-
AuthorPosts
-
September 19, 2012 at 11:40 am #25424
Kelly
ParticipantForgive me if the answer is right in front of my face, but I’d like to display a start time on both the calendar of events and in a tooltip on the mini calendar widget. Any ideas how I can do this?
September 19, 2012 at 3:59 pm #25427Barry
MemberHi Kelly, this is totally achievable. How comfortable are you working with PHP? Have you looked at our Themer’s Guide yet (link over in the sidebar under Useful Resources)?
September 21, 2012 at 9:12 am #25530Kelly
ParticipantHi Barry! Thanks for getting back to me.
I am new to PHP, but comfortable editing the code with a little bit of direction. I looked at the Themer’s Guide, but to be honest, was a bit overwhelmed. Would you be able to point me to where in the PHP files should be adding the customization?
September 21, 2012 at 9:36 am #25532Barry
MemberSo the start time should already be showing on the main calendar – am I right in thinking that what you want to do is duplicate this effect on the event calendar widget?
September 21, 2012 at 9:45 am #25535Kelly
ParticipantAlmost, but not quite. I’d like to add the start time (only start… no end time) to:
– the main calendar itself (right now it’s only on the main calendar tooltip).
– the tooltip of the event calendar widget (right now the tooltip only displays the event name, no start time).I am using the calendar for a theatre company, so I’d like the visitors to be able to see start times of each show at a quick glance.
Thanks Barry. I appreciate your help 🙂
September 21, 2012 at 11:42 am #25541Barry
MemberOK, so taking this one step at a time I’m going to assume you’ve set up your custom templates (ie, you’ve copied the views across to your theme and have placed them in a directory called “events”).
The first thing we’ll do is look at adding the time to the main calendar grid, independently of the tooltip content.
Please open up your copy of the table.php template and find the block of code that starts:
function display_day( $day, $monthView ) {We want to add some more code in there – try following the instructions here: http://pastebin.com/L0Lci4mn
Let me know how you get on!
September 21, 2012 at 12:43 pm #25543Kelly
ParticipantGot it! Works exactly how I was hoping 🙂
September 21, 2012 at 1:06 pm #25545Barry
MemberSo next we’ll look at the calendar widget. This time the change affects the table-mini.php template. Can you follow the instructions here: http://pastebin.com/j4UDJSHm (once again it’s a single line we are adding).
September 21, 2012 at 1:25 pm #25548Kelly
ParticipantPerfect!! Thanks Barry! 🙂
At the risk of overstaying my welcome, I have one more question that may or may not be possible. I’m also using the Events List Advanced Widget to list upcoming shows underneath the mini-table. Is there a way to limit the list today and tomorrow’s shows? (And also use the words today and tomorrow as opposed to the day of the week?) For example:
WHAT’S PLAYING:
————-
Romeo and Juliet
Tonight at 8:00Hamlet
Tomorrow at 2:00Romeo and Juliet
Tomorrow at 8:00(or)
WHAT’S PLAYING:
————–
No shows tonightRomeo and Juliet
Tomorrow at 8:00September 21, 2012 at 4:29 pm #25558Barry
MemberHi Kelly, pretty much anything like this is possible, but we can’t always guide people through bespoke customizations since the amount of bandwidth we have for forum support has limits – that said, if you can wait until next week (I’m out of time today) then I will take a look and see if there is a straightforward solution here.
Thanks – and have a good weekend 🙂
September 21, 2012 at 5:17 pm #25560Kelly
ParticipantI totally understand. I’ll do my best to dig a bit over the weekend to see if I can’t figure it out on my own. If, come next week, I still haven’t been able to figure it out and you have some time, I’d really appreciate it. If not, not to worry.
Thanks for your help this afternoon! 🙂
September 24, 2012 at 5:06 pm #25647Barry
MemberSo there are two ways you might tackle this.
The cleanest is probably to set up some filters to change the event query used by the widget. That’s fairly advanced though since in this particular case you’d need to set up and tear down your filter as there isn’t a widget-specific hook available here (unless I’m missing something).
… So, an alternative would be to set up a custom events-list-load-widget-display.php template and modify that.
You could inspect the start date of each event to see if it belongs to today or tomorrow and then either display that event or not. I hope that makes sense!
Unfortunately I’m rather out of time on this thread so I can’t progress it much further, but hopefully that’s provided some ideas of how you might tackle this.
September 24, 2012 at 8:17 pm #25657Kelly
ParticipantThanks Barry!
I think that might be a bit beyond my scope of knowledge. If I get really brave and try to figure it out, I’ll post back on here. Otherwise, thanks for your help!
September 25, 2012 at 5:50 am #25663Barry
MemberNo problem – sorry I can’t do more on this occasion and if you get something going here it would be great to hear back 🙂
-
AuthorPosts
- The topic ‘Time Display’ is closed to new replies.
