Results 1 to 5 of 5

Thread: cal_mini.tpl adjustment

  1. #1
    New user
    Join Date
    10-03-10.
    Posts
    18

    Default cal_mini.tpl adjustment

    Below is the output source code from the cal_mini.tpl:

    <thead>
    80 <tr>
    81 <th class="head previous">&lt;</th>
    82 <th colspan="5" class="head current">July 2011</th>
    83 <th class="head next">&gt;</th>
    84 </tr>

    //

    <tr class="week_1">
    106 <td class="days active col_first">4</td>

    The question is how do I get the previous and next, at lines 81 & 83 above, to always link to the "global-list.html" as line at 106 (and other calendar days with events in) rather than the current page "today-list.html"?!

    I understand that this would involve editing "modulecalendar.php" too.

    Many Thanks

  2. #2
    Experienced user
    Join Date
    08-21-09.
    Posts
    563

    Default Re: cal_mini.tpl adjustment

    In the module settings for mini calendar, I thought the "Redirect page" setting controlled that.

    No?

    Maybe it just controls the details page when you click an event -- I forget. But try that first if you haven't already.

    If not (or if I'm misunderstanding your question), are you familiar with customizing Contao templates? Where to put them and how to make your edits?
    Brian

  3. #3
    New user
    Join Date
    10-03-10.
    Posts
    18

    Default Re: cal_mini.tpl adjustment

    Thanks for your reply.

    I think, unless I am missing something... the redirect page is the page that gets displayed when you click a day at line 106 filted by "?day=20110704", but not when you click previous/next month it seems to reference whatever the current page it is on:

    In modulecalendar.php
    Line 145 : $objTemplate->prevHref = $this->strUrl
    Line 159 : $objTemplate->nextHref = $this->strUrl
    ??

    Unfortunately my knowledge of php is fairly limited, I get the feeling I'm going to have to learn!!

    Many thanks.

  4. #4
    Experienced user
    Join Date
    08-21-09.
    Posts
    563

    Default Re: cal_mini.tpl adjustment

    OK -- if that's the case you'll just need to customize the template.

    Copy the "cal_mini.tpl" file into "/templates/yourThemeFolder/". Any changes you make here will override the default.

    Once you open the file, the PHP is pretty trivial -- mostly just copying and pasting code from one place into another and maybe changing a few values if you have to.

    If all else fails you can always hard code the page you want to go to into the template.

    If you put the following in any template, it will output all of the template variables that you can use in them:

    Code:
    <?php $this->showTemplateVars(); ?>
    Good luck!
    Brian

  5. #5
    New user
    Join Date
    10-03-10.
    Posts
    18

    Default Re: cal_mini.tpl adjustment

    Thanks for the help.

    I can't seem to make the adjustment by just customising the template partly because the template references modulecalendar.php I think. What I did was just replace "strUrl" with "strLink" in modulecalendar.php, which seems to work.

    Many thanks.

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
  •