Home › Forums › Calendar Products › Events Calendar PRO › How to Display Main Events Page as Month but All Categories as List
- This topic has 7 replies, 3 voices, and was last updated 10 years, 10 months ago by
Support Droid.
-
AuthorPosts
-
November 4, 2013 at 9:13 am #74520
centrerpc
ParticipantHi,
I’ve Googled and searched here but not finding a solution to what I thoink should be easy:
I would like to have the main events page display a monthly calendar (I set month as the default view in TECP’s settings) but I would like all categories pages to display as lists, not a monthly calendar.
I have the Events Template set to “Default Page Template” as that is the only way I can get TEC to display correctly in the site’s theme (WooThemes Definition).
I’ve tried the solutions here:
but that thread seems to assume “Default Events Template” so I’m not sure what I need to do to get this to work. Any pointers would be much appreciated.
Thank you!
November 5, 2013 at 2:26 pm #74852centrerpc
ParticipantHate to bump but, anyone has any idea how to do this? Thanks!
November 6, 2013 at 1:24 pm #74995Barry
MemberHi centrerpc,
Sorry for the delay first of all: can you try adding this snippet to your theme’s functions.php file and let me know if that helps you accomplish your goals here?
Thanks!
November 6, 2013 at 8:18 pm #75091centrerpc
ParticipantHi Barry,
My name is actually Stéphane 😉 Sorry for the confusion.Thank you VERY much for the code! It works great to show the main calendar page in month/calendar view and categories as list view. But if a user clicks on “Previous Event”, the AJAX loading icon shows and stays there. Nothing happens. It works normally without the code.
Looking at your code I saw this line:
if (tribe_is_view(‘upcoming’)) return;…so I tried adding this:
if (tribe_is_view(‘past’)) return;…but that is not helping. I actually tested with 2 events per page after trying the above to force the Upcoming events link (not many event yet on the site so default 10 events per page didn’t make the link show) and the next page won’t load either.
Is there something I should change in the settings or the code?
THank you very much again!
November 7, 2013 at 9:57 am #75161Barry
MemberApologies Stéphane – I didn’t actually think to test that. Can you try this modified version instead?
The only other complication is that switching to week, day, photo view etc when the visitor is already viewing a list of events for a particular category basically takes them straight back to the same page – there are different ways one might deal with that, such as making the views link to non-category versions of the view or perhaps removing them from the list of available selections – but since there are different approaches you might follow there we’ll leave that side of things to you 🙂
Hope that helps!
November 7, 2013 at 5:18 pm #75307centrerpc
ParticipantHi Barry,
Thank you so much again for your help. The new version of the code works flawlessly! Regarding switching to other types of views, I just removed the selector from view (display: none) and that will do for this site for now.
Last thing regarding that, I would love if you could point me to what I would need to check for in the code to catch a user selecting another view. As I said above, for now I removed the selector altogether but would like to be able to give users flexibility in the future or for other projects. Just a pointer to the right docs pages would help. I will myself try to spend a little time there as I plan on using TEC and TECP on all my client sites that require such a plugin. I tried all your competitors and am really impressed with TEC… and your company’s support! As a dev working with many clients, I love mastering specific products so I can use them on client sites and tweak them as I need without having to relearn a new system every time. I’ll be happy to bring you more business!
Thank you so much again and you can consider this resolved.
November 12, 2013 at 10:42 am #75811Barry
MemberHi Stéphane,
Happy to help!
I would love if you could point me to what I would need to check for in the code to catch a user selecting another view
In the snippet I provided you can see the following piece of code:
if (tribe_is_view('upcoming'))So what you could do is add a set of tests to check if the requested view is something else (photo, week … etc) then set a variable to record that fact and display an appropriate message to the visitor to help them understand what’s happening (if that’s the reason you want to do this).
If you actually want to catch it before the request even hits the server you would have to do something with Javascript to listen for change or click events and take things from there – it’s difficult to be more specific than that because I’m not sure what the end goal would be in this particular scenario, but there are definitely lots of avenues to explore 🙂
Thank you so much again and you can consider this resolved.
Fantastic – good luck and have fun with this!
July 7, 2015 at 6:29 am #981935Support Droid
KeymasterThis 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 ‘How to Display Main Events Page as Month but All Categories as List’ is closed to new replies.
