Home › Forums › Calendar Products › Events Calendar PRO › "Today" link
- This topic has 4 replies, 3 voices, and was last updated 8 years, 10 months ago by Support Droid.
-
AuthorPosts
-
August 27, 2013 at 11:52 am #63088Daniel VeanerParticipant
I am making a few additions to the template on my site, particularly in Month view. In my copy of nav.php I want to insert a “Today” link in between the previous and next months. Is there a call like “tribe_events_the_previous_month_link();” that I could use to make the calendar display the current month (or today’s date)? I can see where to insert it in nav.php, but not what to insert. How do I make a link that says “Today” or “This Month” and goes back to the current month when it is clicked?
Thanks!
August 28, 2013 at 7:52 am #63333BarryMemberHi dveaner, would tribe_get_day_link() be useful for you here?
August 28, 2013 at 8:38 am #63345Daniel VeanerParticipantBarry,
Thanks for this! It does get me the correct URL, but when I click the link I made with it, the calendar hangs on the turning gear. Because the site is live I can’t leave the link there for you to see, but here is a screenshot of what it looks like plus the code I used to make the link (since I am not sure what html will do in a post on this forum): http://ithacalendar.com/ithacalendar-hanging.pngAgain, I have this code in my template copy of /month/nav.php.
I tried creating the link two ways. One of them was just the simple a href= link and the other included target=_top — both approaches result in hanging on the gear.
If I mouse over my “Today” link, right click and tell it to open the link in a new browser tab or window it happily opens to the correct page with the right date showing, in this case: http://www.ithacalendar.com/events/2013-09/
So my question is, is there a special way links have to be laid out to work correctly within the calendar template?
I noticed in the page source when looking at my site that the link code for the next and prev links have extra arguments including data-month=yyyy-mm and rel=pref
Would adding them fix this? And the reason I am asking instead of just trying it is: what tribe function gets me the data-month?
Thanks!August 28, 2013 at 9:25 am #63359BarryMemberSome functions such as tribe_events_the_previous_month_link() add data-month and rel attributes (and it’s quite possible you need to add these to your link, best thing to do would be test the theory out with a manually crafted link first of all) – for what you’re trying to do here though you would probably need to do a little manipulation of your own to do this dynamically.
This is however very much in customization territory so we can’t really provide much more help – for which reason I’ll now close this thread – but we do wish you luck – it’s great to see interesting things being built with The Events Calendar 🙂
July 7, 2015 at 6:27 am #980431Support DroidKeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘"Today" link’ is closed to new replies.