I’ve been working on a calendar using the built in functionality for making a calendar, along with the reepeat plug-in. I have a few obstacles to get past yet, and here’s the latest;
I want to display the current week of events. I found the code to display a day, a month, and year at a time, but can’t quite get it for a week.
There’s two different ways that I’ve tried. First, I took the code I was using to display a single day’s events, and was hoping to tweak it to show the week. When I looked at the syntax that can be used with calendar, I found that I should be able to add something along the lines of
display_by="week", as I did below, but that doesn’t seem to work.
{exp:repeet:parse date_header_interval="day"}
{repeet:no_results}
<h3>Sorry, no results.</h1>{/repeet:no_results}
{repeet:date_header}What's happening on %F %j, %Y:
{/repeet:date_header}
{exp:repeet:get_ids weblog="calendar" parse="inward"}
{exp:weblog:entries weblog="calendar" entry_id="{repeet:entry_ids}" display_by="week" show_expired="yes" show_future_entries="yes" dynamic="off"}
{repeet:item}
{repeet:entry_id}{entry_id}{/repeet:entry_id}
{repeet:entry_date}{entry_date format="%Y-%m-%d %H:%i"}{/repeet:entry_date}
{repeet:expiration_date}{expiration_date format="%Y-%m-%d %H:%i"}{/repeet:expiration_date}
{repeet:interval}{repeat_interval}{/repeet:interval}
{repeet:include_dates}{include_dates}{/repeet:include_dates}
{repeet:exclude_dates}{exclude_dates}{/repeet:exclude_dates}
{repeet:display}
{title}
{details}
{repeet:start_time format="%m-%d-%Y"} - {repeet:end_time format="%m-%d-%Y"}
{/repeet:display} {/repeet:item} {/exp:weblog:entries} {/exp:repeet:get_ids}
{/exp:repeet:parse}Giving up on that one, I tried the simple route and grabed this code;
<h2 class="sidetitle">Upcoming Events</h2>
<ul> {exp:weblog:entries weblog="calendar" show_future_entries="yes" show_expired="no" orderby="date" sort="asc" dynamic="on" limit="5"}
<li><a href="http://{title_permalink=calendar/details">{title}</a> ({entry_date format='%M %j'})</li>
{/exp:weblog:entries}
</ul>And that worked okay, except that it looks at expiration date and if an entry doesn’t have a an expiration date in place, it will display it, even if it’s past.
I really just want to show the current week’s entries(Mon-Sun). I likely won’t have any events that span days or weeks… if I do, they’ll be listed twice because of reepeat.