Home › Forums › Calendar Products › Events Calendar PRO › Navigation/Scroll Functionality
- This topic has 5 replies, 2 voices, and was last updated 9 years, 7 months ago by Barry.
-
AuthorPosts
-
September 17, 2014 at 9:10 pm #749831TomParticipant
What I have noticed was an inability to browse/scroll through the calendar unless there are events in the past or future. Without some event in or beyond a month you may wish to view, there is no way to navigate to said month other than via the date picker function of the search bar. I understand that this functionality may have been in the product at some point and subsequently removed for those wishing to maximize their SEO.
I was wondering, if you would be able to assist with a snippet of code that would restore this functionality via a template override and if it proves useful to the community to have this ability, maybe add it back as a feature that could be enabled/disabled via Events -> Settings. This will allow the calendar to function like most default calendars
Thanks for your assistance.
September 18, 2014 at 11:45 am #751240BarryMemberHi Tom,
We did indeed make that change as part of a response to a number of customer concerns: it’s possible to restore the previous behaviour, though, and if you want to give that a try please add the following code to your theme’s functions.php file:
/** * Allows visitors to page forward/backwards in any direction within month view * an "infinite" number of times (ie, outwith the populated range of months). */ class ContinualMonthViewPagination { public function __construct() { add_filter( 'tribe_events_the_next_month_link', array( $this, 'next_month' ) ); add_filter( 'tribe_events_the_previous_month_link', array( $this, 'previous_month' ) ); } public function next_month() { $url = tribe_get_next_month_link(); $text = tribe_get_next_month_text(); $date = TribeEvents::instance()->nextMonth( tribe_get_month_view_date() ); return '<a data-month="' . $date . '" href="' . $url . '" rel="next">' . $text . ' <span>»</span></a>'; } public function previous_month() { $url = tribe_get_previous_month_link(); $text = tribe_get_previous_month_text(); $date = TribeEvents::instance()->previousMonth( tribe_get_month_view_date() ); return '<a data-month="' . $date . '" href="' . $url . '" rel="prev"><span>«</span> ' . $text . ' </a>'; } } new ContinualMonthViewPagination;
Does that work for you?
September 18, 2014 at 7:57 pm #751987TomParticipantThis reply is private.
September 18, 2014 at 7:59 pm #751991TomParticipant*** Sorry didn’t mean to mark the answer as private ***
Hi Barry,This is awesome and does exactly what I need it to do. Thank you very much.
If you don’t mind my asking. Is there a simple way to move it to the top of the calendar? If its a big deal don’t sweat it, the functionality I need is here. I just think it would serve better at the top of the calendar to assist user’s with laptops from having to scroll down.
Thanks again, this was awesome.
September 18, 2014 at 8:36 pm #752033TomParticipantThe answer to my followup question can be found here:
https://tri.be/support/forums/topic/next-month-navigation-at-top/
Thanks again for your assistance.September 19, 2014 at 6:59 am #752899BarryMemberSorry Tom, I’d wrapped up my round of support work for the day when you posted your follow ups – glad you found that link in any case 🙂
Thanks again!
-
AuthorPosts
- The topic ‘Navigation/Scroll Functionality’ is closed to new replies.