Results 1 to 2 of 2

Thread: Altering Mini-Calendar format cal_mini.tpl [SOLVED]

  1. #1
    User
    Join Date
    01-22-10.
    Location
    Trowbridge, UK
    Posts
    61

    Default Altering Mini-Calendar format cal_mini.tpl [SOLVED]

    Hi
    I would like to make a change to the mini-calendar but after experimenting with the cal_mini.tpl file have not been successful, so help would be appreciated. I'm sure it's simple if you know how

    At the moment when the event list is initially displayed then all the events are displayed in the month. Clicking on any date in the month display the events on that day - fine. But to see all the events for the month again then the user has to click on ">" to go to the next month and then on "<" to go back:
    < January 2010 >

    I would like to click on the Month/Year to re-list all the events.

    The current cal_mini.tpl code is:
    Code:
        <th class="head previous">prevTitle; ?>"><?php echo $this->prevLabel; ?></th>
        <th colspan="5" class="head current"><?php echo $this->current; ?></th>
        <th class="head next">nextTitle; ?>"><?php echo $this->nextLabel; ?></th>
    where $this->prevHref; gives the url to the previous month and $this->nextHref; to the next

    I changed the 2nd line to:
    Code:
        <th colspan="5" class="head current">current;   ?>"><?php echo $this->current;    ?></th>
    I need the code to change xxxxxxxxxxx to give the url for the current month as in:
    _http://websiteurl/index.php/Event_List.html?month=yyyymm

    Thanks for reading

  2. #2
    User
    Join Date
    01-22-10.
    Location
    Trowbridge, UK
    Posts
    61

    Default Re: Altering Mini-Calendar format cal_mini.tpl [SOLVED]

    Solution

    In ModuleCalendar.php change the // Current month code (line 150 and 2 lines) to:
    Code:
    // Current month
    		$objTemplate->current = $GLOBALS['TL_LANG']['MONTHS'][(date('m', $this->Date->tstamp) - 1)] .  ' ' . date('Y', $this->Date->tstamp);
    		$objTemplate->currentHref = $this->strUrl . ($GLOBALS['TL_CONFIG']['disableAlias'] ? '?id=' . $this->Input->get('id') . '&amp;' : '?') . 'month=' . $intYear .  str_pad($intMonth, 2, 0, STR_PAD_LEFT);
    i.e. add the 3rd line.

    In cal_mini.tpl change line 6 from
    Code:
        <th colspan="5" class="head current"><?php echo $this->current; ?></th>
    to
    Code:
    <th colspan="5" class="head current">current;   ?>"><?php echo $this->current;    ?></th>
    Looks like cal_default.tpl (which I think is the large calendar) will need the same change.

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
  •