Home › Forums › Calendar Products › Events Calendar PRO › Adding third-party plugin content to Events page (Revolution Slider)
- This topic has 7 replies, 2 voices, and was last updated 11 years, 10 months ago by
Casey.
-
AuthorPosts
-
May 22, 2014 at 11:46 am #170640
Bastien Bournet-Charrier
ParticipantHey guys,
We’re using Revolution Slider on our platform and we would like to see a slider right at the top of the Events page. I dug a bit in the documentation and forum but didn’t find anything to assist me. Revolution Slider provide a shortcode for each sliders, so I’m guessing something along the line of do_shortcode(…) would work.
Would appreciate some help!
Sincerely,
BBCEDIT : I managed to find a solution before even posting the thread. I’ll post it anyway to let others know about the solution. I simply created a folder “tribe-events” in our child theme, added the default template file “default-template.php” (found in “/Views”) and added the following line of code
<?php echo do_shortcode('[rev_slider events]');?>before the loop<div id="tribe-events-pg-template">
<?php tribe_events_before_html(); ?>
<?php tribe_get_view(); ?>
<?php tribe_events_after_html(); ?>
</div>May 22, 2014 at 7:49 pm #171163Bastien Bournet-Charrier
ParticipantWell I’ve spoken too fast!
The slider appears on every page (even single event page) and I wanted it to be displayed only on the events page!
Any ways to include only the main events page?
Sincerely,
BBCMay 23, 2014 at 7:02 am #171905Casey
ParticipantBBC,
Thanks for reaching out! Glad you to see that you were able to start down the path of template overrides, which is what I was going to suggest. If you only want this slider to appear on the main Events page, then you should be able to put some conditional logic around your ‘do_shortcode’ statement, in order to control what pages it displays on.Something like this should do the trick: https://gist.github.com/ckpicker/edbf98fdf109e797f26e
Give that a try and let me know if it gets you started in the right direction. Thanks! π
-Casey-
May 23, 2014 at 7:23 am #171945Bastien Bournet-Charrier
ParticipantHey Casey!
Thanks for the answer. I have tried your code snippet but apparently the output is always ‘False’, the slider doesn’t display on the events page or single event page. If I add a ‘!’ in front of ‘tribe_is_in_main_loop()’ the slider starts to display again everywhere.
I wanted to put a simpler logic using the page slug but it looks like since this is a dynamically generated page it won’t work. I don’t really know what options I have left!
Looking forward to hear from you π
Sincerely,
BBCMay 23, 2014 at 9:07 am #172085Casey
ParticipantBBC,
Take a look at our docs here: http://docs.tri.be/Events-Calendar/ You’ll notice that we have several conditional functions for determining what page the user is currently viewing. Look at all of the ‘tribe_is_*’ functions, which are used for conditional checks such as determining if you’re on the month view page, list page, etc.Give that a shot and let me know if that does the trick for you. Thanks! π
-Casey-
June 6, 2014 at 6:25 am #208941Casey
ParticipantI just wanted to follow up and see if youβre all set here or if you still have further questions. Just let me know if you have further questions or if I should go ahead and close out this thread. Thanks! π
-Casey-
June 6, 2014 at 6:57 am #209029Bastien Bournet-Charrier
ParticipantHey Casey!
Thanks for following up. I hadn’t find a solution until recently. I tried quite a lot of tests without success. I was either getting the slider on every pages or not at all. I finally managed to find a correct test to get the slider only on the main events listing page using the body class. Here is the snippet I’ve added inside our child-theme /tribe-events/default-template.php file :
<?php
$classes = get_body_class();
if (in_array(‘events-list’,$classes)) {
echo do_shortcode(‘[rev_slider home]’);
}
?>Added right before <div id=”tribe-events-pg-template”>
Works like a charm π
Thank you!
June 7, 2014 at 7:22 am #211353Casey
ParticipantThanks for confirming that this got you sorted. Since it looks like you’re all set, I’m going to mark this thread “Answered” and close it out.
By the way, if you have a minute or two, we would love it if you’d write a few words for us here: http://m.tri.be/jw
Thanks in advance. π
Cheers,
Casey -
AuthorPosts
- The topic ‘Adding third-party plugin content to Events page (Revolution Slider)’ is closed to new replies.
