Adding calendar to a template

This topic contains 9 replies, has 2 voices, and was last updated by  Stephen Harris 8 years, 12 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #21926

    Hi there,

    I need to insert a full calendar into our home page template. I used <?php echo eo_get_event_fullcalendar();?>
    but I am unsure how to achieve the same setup as with the shortcode I used on another page. The shortcode I used is
    [eo_fullcalendar headerLeft=’prev,next today’ headerCenter=’title’ headerRight=’venue,month,agenda Week’].

    How can I achieve the same when inserting PHP into the template as with the shortcode?

    Currently the calendar shows as per the follwing screenshot when using PHP: http://glui.me/?i=z0b4eny8x5star3/2016-03-15_at_22.13.png/

    With the shortcode the calendar shows as follows: http://glui.me/?i=lncz1bxat60evra/2016-03-15_at_22.14.png/

    Would it be possible for you to assist?

    Kind regards
    Francois Wessels

    Francois Wessels
    #21929

    Hi Francois,

    You can pass an array as an argument. The array contains the same key-value pairs as the shortcode’s attribute-value pairs, except the keys are lowercased. See the codex for more details..

    Stephen Harris
    #21948

    Hi there,

    Thanks for the reply, as a non-programmer this is very confusing — would it be possible to give me an aexample of usage to achieve this?

    Any help will be greatly appreciated.

    Kind regards
    Francois Wessels

    Francois Wessels
    #21952

    Try:

    <?php
    echo eo_get_event_fullcalendar( array(
        'headerleft' => 'prev,next today',
        'headercenter' => 'title',
        'headerright' => 'venue,month,agendaWeek',
    ) );
    ?>
    
    Stephen Harris
    #21967

    Hi Stephen,

    Thank you very much, that worked perfectly. Just one more question if I may — if i were to disable tooltips on this calendar in the template would I pass that as part of the array?

    ‘tooltip’ => ‘false’

    Thanks in advance.

    Francois Wessels

    Francois Wessels
    #21970

    Yes, that’s correct

    Stephen Harris
    #21995

    Hi Stephen,

    Thanks for your assistance sofar — I have now placed the suggested code below in our template:

    <?php echo eo_get_event_fullcalendar( array(
    ‘headerleft’ => ‘prev,next today’,
    ‘headercenter’ => ‘title’,
    ‘headerright’ => ‘venue,month,agendaWeek’,
    ‘tooltip’ => ‘false’,
    ) );

    Unfortunately tooltips are still showing. Could you possibly just advise what we are doing wrong.

    Also, the calendar does not resize at all for mobile devices — is there something specific that we need to eanble to ensure that the calendar is responsive?

    Kind regards
    Francois Wessels

    Francois Wessels
    #22002

    It should be automatically responsive for Event Organiser 3.0.0 (or later).

    Do you have a link to the page?

    Stephen Harris
    #22003

    Hi Stephen,

    Thanks for all your help on this — we are still on version 2 but on a page where the calendar is embedded via shortcode it does resize although not fully responsive.

    We did upgrade to version 3 earlier but had to revert to version 2 as some of the layout broke with our theme…

    The tooltip that is still showing is also something that I am unsure how to handle.

    URL is http://andrekocklimpopo.co.za.

    Kind regards
    Francois

    Francois Wessels
    #22010

    Sorry, when used in the function, 'false' must be a boolean, not a string. So false (without the quotation marks). I’ve just tried the following on a test site with 2.13.7 enabled, it works for me:

    <?php
    echo eo_get_event_fullcalendar( array(
        'headerleft' => 'prev,next today',
        'headercenter' => 'title',
        'headerright' => 'venue,month,agendaWeek',
        'tooltip' => false,
    ) );
    ?>
    

    Also I noticed in the above you have what look like backtics rather than single quotation marks.

    Yes, the calendar is not particular responsive on versions older than 3.0.0 (it resizes, to a point).

    Stephen Harris
Viewing 10 posts - 1 through 10 (of 10 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.