1

A client's site using the Calendar add-on is generating loads of date urls, apparently infinite. Here's a sample taken from a Screaming Frog crawl:

/calendar/month/2081/05/ /calendar/month/1899/02/ /calendar/month/2121/10/ /calendar/month/1764/05/ /calendar/month/2637/03/ /calendar/month/1676/09/ /calendar/month/2308/06/ /calendar/month/1658/01/ /calendar/month/2549/08/ /calendar/month/1852/01/ /calendar/month/2362/12/ /calendar/month/1870/09/ /calendar/month/2502/06/ /calendar/month/2168/12/ /calendar/month/2081/06/ /calendar/month/1899/01/ /calendar/month/1764/04/ /calendar/month/2637/02/

I've been poking around in the code to try to figure out where this is coming from and my best guess is here (excerpt from the index template). Can you see anything here that looks like it would be creating the error, or could you point me in the right direction if you have other ideas where it might be coming from? Thank you!

 {exp:calendar:cal
        {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}
    first_day_of_week="1" first_day_of_week="0"}
        <div id="mc_calendar" class="table-responsive">
            {display_each_month}
            <table>
                <thead>
                    <tr id="top_month">
                        <th colspan="1">
                            <a
                                id="mc_prev_month"
                                class="icon left"
                                href="{path='calendar/month'}/{prev_month format="%Y/%m"}/">&laquo;</a>
                        </th>
                        <th colspan="5">
                            <a href="{path='calendar/month'}/{month format="%Y/%m"}/">
                                {date format="%F %Y"}
                            </a>
                        </th>
                        <th colspan="1">
                            <a
                                id="mc_next_month"
                                class="icon right"
                                href="{path='calendar/month'}/{next_month format="%Y/%m"}/">
                                &raquo;
                            </a>
                        </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_short}
                        </th>
                    {/display_each_day_of_week}
                </tr>
            </thead>
            <tbody>
                {display_each_week}
                <tr>
                    {display_each_day}
                    <td cellpadding="0" cellspacing="0" 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'}/{date format="%Y/%m/%d"}/">{/if}
                    {day}
                    {if day_event_total}</a>{/if}
                    {if:else}
                       {day}
                    {/if}</div></td>
                    {/display_each_day}
                </tr>
                {/display_each_week}
            </tbody>
        </table>
        {/display_each_month}


        </div>
    {/exp:calendar:cal}

Your Answer

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

Browse other questions tagged or ask your own question.