Time Display

Home Forums Calendar Products Events Calendar PRO Time Display

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #25424
    Kelly
    Participant

    Forgive 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?

    #25427
    Barry
    Member

    Hi 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)?

    #25530
    Kelly
    Participant

    Hi 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?

    #25532
    Barry
    Member

    So 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?

    #25535
    Kelly
    Participant

    Almost, 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 🙂

    #25541
    Barry
    Member

    OK, 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!

    #25543
    Kelly
    Participant

    Got it! Works exactly how I was hoping 🙂

    #25545
    Barry
    Member

    So 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).

    #25548
    Kelly
    Participant

    Perfect!! 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:00

    Hamlet
    Tomorrow at 2:00

    Romeo and Juliet
    Tomorrow at 8:00

    (or)

    WHAT’S PLAYING:
    ————–
    No shows tonight

    Romeo and Juliet
    Tomorrow at 8:00

    #25558
    Barry
    Member

    Hi 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 🙂

    #25560
    Kelly
    Participant

    I 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! 🙂

    #25647
    Barry
    Member

    So 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.

    #25657
    Kelly
    Participant

    Thanks 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!

    #25663
    Barry
    Member

    No problem – sorry I can’t do more on this occasion and if you get something going here it would be great to hear back 🙂

Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘Time Display’ is closed to new replies.