Home › Forums › Calendar Products › Events Calendar PRO › Calendar Widget day links
- This topic has 7 replies, 2 voices, and was last updated 14 years, 1 month ago by
Jonah.
-
AuthorPosts
-
March 18, 2012 at 8:51 am #16896
Lee
ParticipantHi folks,
Just purchased the Pro version and installed the Calendar widget. If I hover over a date it shows me an underline rollover effect, implying that the day is clickable. Intuitively I’d expect to be able to click that and be taken to the Daily View of events in the main window. It doesn’t seem to do this though.
Is this normal behaviour?
Currently to get to the daily view it seems I need to go to the full calendar and click on the date number. My default view is the event list view, so my visitors would have to know to click on the full calendar link, then click on the date….not intuitive.
How do I make the widget date numbers clickable to be taken to the full day view? Is this possible?
Thanks in advance
LeeMarch 19, 2012 at 10:33 am #16918Jonah
ParticipantHi Lee,
This is normal behavior but by all means not necessarily the best behavior. I never understood this one myself but it’s an easy modification.
First make a copy of /wp-content/plugins/the-events-calendar/views/table-mini.php and place in an ‘events’ folder in your theme. Next, find line 90 and change to: https://gist.github.com/f37635d0fd8fcd225566
That should do it. Let me know if you need anything else.
March 19, 2012 at 12:10 pm #16929Lee
ParticipantHi Jonah,
Thanks for the reply. I’m having issues with it however.
Here’s what I’ve done:
1) copied table-mini.php into a separate events folder (I presume as a backup, right?)
2) opened the original in TextWrangler on the Mac
3) my Line 90 is this one$return .= “”;
However when I changed that I got all sorts of weird stuff happening. the popup tooltips were now in the calendar date boxes and the date numbers were all 1254, 1055 and so on.
So, I looked again…line 89 seems to be the one I think I need to change
$return .= ( count($monthView[$day]) ) ? “$day” : $day;
4) changed line 89 to the one in your github link
$return .= ( count($monthView[$day]) ) ? “$day” : $day;
5) this now has the effect of making the number clickable, but it always seems to generate the same URL, that of what looks like the latest post that I’ve entered into WordPress, so doesn’t take me to the date view.
6) I thought it might be because I’ve got All in One SEO rewriting canonical URLs so have disabled that plugin…still the same issue.
I’m not sure what it’s doing…it’s like this bit <a href='". tribe_get_event_link($post) ."' is returning the incorrect value.
You can try it on the link below if you like, it's a WIP development site for a client of mine. I'm using a child theme for a WooThemes design, Delicious Magazine. This site is part of a WPMU installation.
http://79.170.44.93/skootkidz.com/edinburgh/
Have a look at 17th and 18th March on the sidebar calendar.
Any ideas what is it doing?
Thanks in advance
LeeMarch 19, 2012 at 12:11 pm #16930Lee
ParticipantSorry…the links in the code have been applied to $day above…
March 19, 2012 at 12:25 pm #16931Lee
ParticipantHi Jonah,
Updates for you! I’ve been looking through the documentation and found this piece of code
tribe_get_day_link(string $date)
I’ve put this one into the line instead of the tribe_get_event_list($post) part and it seems to be on the right lines, however I can’t seem to get it to generate the correct date.
What Iv’e done is this…
If I put this piece of code in
tribe_get_day_link($date)
it always returns the url /whats-on/1970-01-01/
If I put this piece of code in
tribe_get_day_link($year-$month-$day)
it always generates the url /whats-on/2012-03-20/ even though it’s not the 20th today and the dates I’m clicking on are the 17th and 18th. Both return the 20th.
We’re close!! i’m just not that much of a PHP guru to know what to use instead of $year-$month-$day to get it generate the correct URL, which should be
/whats-on/the date i’ve clicked on in year-month-day format/
Am I on the right lines?
Cheers again
LeeMarch 19, 2012 at 2:07 pm #16936Jonah
ParticipantHi Lee, sorry about that, yes it should be line 89 of table-mini.php
The reason you put the file in an ‘events’ folder in your themes folder is to override the stock template file while making customizations that will be preserved the next time you update the plugin.
I hope that helps but let me know if you need anything else with this.
March 19, 2012 at 2:51 pm #16940Lee
ParticipantJust a bit of help debugging why it always gives me the 20th March 2012 using the code…
tribe_get_day_link($year-$month-$day)
even though $day should be 17 or 18…
Which bit of code can I use to give me the correct URL format returned? The one you sent through originally was for a single event page, but it seemed to pick up the latest post I’d entered into WordPress, which wasn’t an event.
I tried using this one above instead, but the $day doesn’t seem to be calculating properly, it always gives me a 20, even though the dates I’m clicking on are the 17th March and 18th March
http://79.170.44.93/skootkidz.com/edinburgh/
Any ideas why it’s doing that please?
Cheers
LeeMarch 19, 2012 at 3:28 pm #16941Jonah
ParticipantHI Lee, I don’t think tribe_get_day_link can have those parameters passed in like that. It basically only takes in one argument – the date that you want to link to. You can see more here: https://theeventscalendar.com/support/documentation/the-events-calendar-template-tags-link-functions/#functiontribe_get_day_link
It’s difficult to get the current highlighted day on the mini calendar and unfortunately I cannot figure this out and customizations are not supported so there’s nothing else I can do for you here. Normally I would have one of our other devs take a look but they are very busy rolling out a new version this week and next so our hands are tied. You’ll need to figure it out on your own…
This might help – so you can pass in a specific date into the function like so:
tribe_get_day_link(date('n/j/Y', strtotime('7 days')))
That will link to a day 7 days out from today. You’ll want to somehow figure out how to get the highlighted day to be used as the link.
Good luck!
-
AuthorPosts
- The topic ‘Calendar Widget day links’ is closed to new replies.
