My Calendar’s PHP templates are context sensitive, allowing you to display the title differently in different contexts. There are five different templates targeting title display:
calendar-title.php
- Structure the title as shown in the Grid view of the calendar. Equivalent to the settings field at My Calendar > Settings > Display > Event title (Grid).
card-title.php
- Structure the title as shown in the Card view of the calendar. Equivalent to the settings field at My Calendar > Settings > Display > Event title (Card).
list-title.php
- Structure the title as shown in the List view of the calendar. Equivalent to the settings field at My Calendar > Settings > Display > Event title (List).
mini-title.php
- Structure the title as shown in the Mini view of the calendar. Equivalent to the settings field at My Calendar > Settings > Display > Event title (Grid), but allows you to customize the mini calendar separately from the main view.
single-title.php
- Structure the title as shown in Single event views of the calendar. Equivalent to the settings field at My Calendar > Settings > Display > Event title (Single).
All default {type}-title.php
templates render the template tags in the related settings field if they have been modified using mc_draw_template()
. Any event template tag is available for use in the title templates.
Example custom template
<div class="mc-title-container">
<div class="mc-image-container">
<?php mc_template_image( $data, 'calendar', 'thumbnail' ); ?>
</div>
<div class="mc-title-container">
<div class="mc-badge-date">
<?php mc_template_tag( $data, 'datebadge' ); ?>
</div>
<div class="mc-title">
<?php mc_template_tag( $data, 'title' ); ?>
</div>
</div>
</div>
This template would output the event image as a thumbnail, the current date in a badge format, and a title, while also adding structural elements for layout purposes.