0

I have a mini Solspace calendar that shows correctly here, but does not display all days of the month here.

Here is the code:

   <div id="mc_wrap">
{exp:calendar:cal
{if segment_2 == "calendars"}
date_range_start="year-month-01" date_range_end="year-month-last"
{/if}
{if segment_2 == "edit"}
date_range_start="year-month-01" date_range_end="year-month-last"
{/if}
{if segment_2 == "create"}
date_range_start="year-month-01" date_range_end="year-month-last"
{/if}
{if segment_2 == "event"}
date_range_start="year-month-01" date_range_end="year-month-last"
{/if}
{if segment_2 == ""}
date_range_start="year-month-01" date_range_end="year-month-last"
{/if}
{if segment_2 == "month"}
{if segment_3 == ''}date_range_start="year-month-01" date_range_end="year-month-last"{/if}
{if segment_3 != ''}date_range_start="{segment_3}-{segment_4}-01" date_range_end="{segment_3}-{segment_4}-last"{/if}
{/if}
{if segment_2 == "week"}
{if segment_3 == ''}date_range_start="year-month-01" date_range_end="year-month-last"{/if}
{if segment_3 != ''}date_range_start="{segment_3}-{segment_4}-01" date_range_end="{segment_3}-{segment_4}-last"{/if}
{/if}
{if segment_2 == "day"}
{if segment_3 == ''}date_range_start="year-month-01" date_range_end="year-month-last"{/if}
{if segment_3 != ''}date_range_start="{segment_3}-{segment_4}-01" date_range_end="{segment_3}-{segment_4}-last"{/if}
{/if}
dynamic="off"
}
<div id="mc_calendar">
{display_each_month}
<table id="mini-cal">
<thead>
<tr  id="mc_head">
<th colspan="1">{if segment_2 != "calendars"}<a id="mc_prev_month" class="icon left" href="{path=''}mini-cal/month/{prev_month format="%Y/%m"}/">&laquo;</a>{/if}</th>

<th colspan="5"><a href="{path='calendar'}/{month format="%Y/%m"}/">{month format="%F %Y"}</a></th>

<th colspan="1">{if segment_2 != "calendars"}<a id="mc_next_month" class="icon right" href="{path=''}mini-cal/month/{next_month format="%Y/%m"}/"> &raquo;</a>{/if}</th>
</tr>
<tr id="mc_days">
{display_each_day_of_week}
<th class="{if day_of_week_is_weekend}weekend{/if} {if day_of_week_is_current}current{/if}">{day_of_week_one}</th>
{/display_each_day_of_week}
</tr>
</thead>
<tbody>
{display_each_week}
<tr>
{display_each_day}
<td class="
{if !day_in_current_month == FALSE}mc_pad{/if}
{if day_event_total > 0}has_events{/if}
{if count == 7}selected{/if}
{if day_is_today}today{/if}
"><div class="mc_date">{if day_in_current_month}
{if day_event_total}<a href="{path='calendar/day'}/{day format="%Y/%m/%d"}/">{/if}
{day}
{if day_event_total}</a>{/if}
{if:else}
<strong class="middot">&middot;</strong>
{/if}</div></td>
{/display_each_day}
</tr>
{/display_each_week}
</tbody>
</table>
{/display_each_month}
</div>
{/exp:calendar:cal}
</div>

Not sure what I am missing here but I am open to suggestions.

1

You need a check for the "search-results" segment:

{if segment_2 == "search-results"}
   date_range_start="year-month-01" date_range_end="year-month-last"
{/if}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.