Adding third-party plugin content to Events page (Revolution Slider)

Home Forums Calendar Products Events Calendar PRO Adding third-party plugin content to Events page (Revolution Slider)

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #170640

    Hey 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,
    BBC

    EDIT : 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>

    #171163

    Well 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,
    BBC

    #171905
    Casey
    Participant

    BBC,
    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-

    #171945

    Hey 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,
    BBC

    #172085
    Casey
    Participant

    BBC,
    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-

    #208941
    Casey
    Participant

    I 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-

    #209029

    Hey 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!

    #211353
    Casey
    Participant

    Thanks 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

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Adding third-party plugin content to Events page (Revolution Slider)’ is closed to new replies.