Results 1 to 3 of 3

Thread: [solved] Calendar in EFG

  1. #1
    User
    Join Date
    04-01-10.
    Posts
    289

    Default [solved] Calendar in EFG

    Hello,

    Is it possible for a date formatted text field to show the Contao calendar in FE ?

    Thanks.

  2. #2
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default Re: Caldendar in EFG

    Yes. I don't know if EFG has a specific method, but generally you need to add the 'plugins/calendar/js/calendar.js' and 'plugins/calendar/css/calendar.css' to the head of the page, and a javascript to instantiate a new calendar to the body of the page.

    Use the format ctrl_yourFieldName.
    eg - for a field called firstnight:


    Code:
    $GLOBALS['TL_JAVASCRIPT'][] = 'plugins/calendar/js/calendar.js';
    $GLOBALS['TL_CSS'][] = 'plugins/calendar/css/calendar.css';
    and

    Code:
    <script type="text/javascript">
    <![CDATA[//><!--
      window.addEvent('domready', function() { new Calendar({ ctrl_firstnight: '<?php echo 'd.m.Y'; ?>' }, { navigation: 2, days: ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'], months: ['January','February','March','April','May','June','July','August','September','October','November','December'], offset: 0, titleFormat: 'l, dS of F Y', direction: .5 }); });
    //--><!]]>
    </script>

  3. #3
    User
    Join Date
    04-01-10.
    Posts
    289

    Default [solved]Re: Caldendar in EFG

    Thanks for your answer.
    In facts, I've just found Calendarfield extension in Contao repository which is absolutely what I looked for.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •