MTSomeDays

This container tag must is used to create a container which will encompass all of the other content that you wish to display. You will use it similar to the way that you use an MTEntries block (in fact, you will probably use an MTEntries block inside!), and make use of other tags inside to display other content. You must will probably add one or more attributes to the container to indicate how to retrieve your data.

Context is an important concept in MT-SomeDays, because it refers to the date that is being used during processing. If you don't know which date is in context, then you may not understand which date is being processed during a given loop. Template tags are provided that will allow you to troubleshoot your output and help determine what you are getting (those will be discussed later). If you don't understand what's happening, make sure you understand context, because that's where it all starts.

The first attribute is to adjust the current date. If not included, the current date context is used. This means that if you are building an individual archive, that entry's date is the one used. If a weekly or monthly archive, then the first date of that archive is the one that will be used. If there is no date in context, then the current system date will be used. To override this behavior, choose from this list: date, day, week, month or year.

The date attribute allows a value of first (first date with published entries), last (last date with published entries), today (current system date) or a specific date (YYYYMMDD).

The day attribute allows a value of last (the day prior to the one in context), next (the day after the one in context), -A (A days before the one in context) or +A (A days after the one in context).

The week attribute allows a value of last (seven days prior to the day in context), next (seven days after the day in context), -B (Bx7 days before the day in context) or +B (Bx7 days after the day in context).

The month attribute allows a value of last (one month prior to the day in context), next (one month after the day in context), -C (C months before the day in context) or +C (C months after the day in context).

The year attribute allows a value of last (one year prior to the day in context), next (one year after the day in context), -D (D years before the day in context) or +D (D months after the day in context).

Each of these options manipulates the starting date context. For instance, if the context of your template is Friday, February 16, 2007, and you specify week="last", the context of your container shifts to one week prior - in other words, Friday, February 9, 2007. So processing will begin at that point.

Now that we have selected the date that will be used for our starting point, we need to tell the container which other dates we would like to include. For that, enter the select attribute.

This attribute can accept a value of since (everything since the first date with published entries through the evaluated date), until (everything from the evaluated date until the last date with published entries), week (a calendar week), month (a calendar month), year (a calendar year), -E (the prior E days, inclusive) or +E (the next E days, inclusive).

Going back to our last example, if we add select="until" to the container, we will get everything from Friday, February 9, 2007 until the last date that contains published entries (whenever that date happens to be). But using the two attributes together, you can adjust the date and select a range of just about anything!

There are also some attributes that you can add to the container that will affect your output, but don't directly apply to adjusting the date or selecting a range.

The limit attribute may come in useful if you want to ony include a certain number of entries. Because MT-Somedays overrides the standard MTEntries container, you can't use normal tags there, so you need to use it here. The value should be the number that you would like to limit (for instance, limit="12").

The nocats attribute will override the default behavior of MT-SomeDays, which is to look at the current category context. This simply turns off that behavior and allows you to view content from all categories. The value should be "1".

The padding attrbute works much like the regular calendar tags, and allows you to create table-like calendars, with blank cells at the beginning and end, with columns lining up correctly. The value should be "1".

The reverse attribute allows you to list your dates in reverse order. The value should be "1".

The yearly attribute allows you to select all months from the range you are building by extending the date range so that it nicludes the first date of the year (January 1) and the last date of the year (December 31). If your date range is only in a single year, you can get the same results by specifying select="year", but if your range spans more than one year, you'll need to use this attribute. The value should be "1".

MTSomeDays (Advanced)

There are also some advanced features that you may wish to take advantage of, but you should be fairly familiar with the way that the container tag is working prior to embarking on any of these subjects. This isn't because they are especially difficult, but because there are plenty of options before you even get to this area, and adding even more options just makes things more confusing. Don't say you haven't been warned!

Multiple Blogs: You can include content from multiple blogs by including the blogs attribute. Simply include each blog that you would like to see, separated by colons. For instance, to include blogs 1, 2 and 3, you would specify blogs="1:2:3" and the content within the container would allow you to make use of entries from all three blogs.

Multiple Categories: In a similar vein, you can include the content from multiple categories by including the categories attribute. The specification is the same, but instead of a category ID, you use a category label, separated by colons. For instance, you might specify categories="Talk:Gossip:News". Case is important, as is spacing. If you use colons in your category names, then this function won't work for you. Sorry. There is also no "advanced" selection here, such as the AND/NOT/OR logic that is present in standard category selectors. This is because this category logic also works across the multiple blog selector, so if you have the same categories in multiple blogs, you can pull in that content here. The standard logic won't do that.

Grouping: While displaying some date-based informatoin (such as archives), you may not want all that individual content. Because of that, another attribue allows you to group your dates by week, month, year or range (the selected range). This may speed up your processing somewhat, and allow you to list totals by that group, rather than indivdual totals.

MTSDEvalDate
MTSDEvalDayOfWeek
MTSDWorkDate
MTSDDayOfWeek
MTSDSatDate
MTSDStartDate
MTSDEndDate
MTSDEntryCount

The first date is the date after it is adjusted for your selections. The second is the day of week (0-6). Then you have the current date being processed and the day of week for that day. The next date is the date of the Saturday following the processing date, which you can use to help create calendars. Then there are the start date of the range and the ending date of the range. The "date" tags can be formatted with standard formatting tags. The final template tag is the count of entries on the day. If using the "group" attribute, this will reflect the grouped value instead of an indivdual day.

MTSDIfEval
MTSDIfEvalDOM
MTSDIfEvalDOW
MTSDIfEvalDOY
MTSDIfEvalEOM
MTSDIfEvalEOM
MTSDIfEvalSOM
MTSDIfToday

These conditional tags can be used to test the evaluated date for a number of conditions related to the date being processed. If the processing date is equal to the evaluated date, day of month (DD), day of week (0-6), day of year (MMDD), end of month (MMDD), start of month (MMDD) or today (YYYYMMDD), the conditions will evaluate to true and the contents within will display.

MTSDIfSun
MTSDIfMon
MTSDIfTue
MTSDIfWed
MTSDIfThu
MTSDIfFri
MTSDIfSat

These conditional tags can be used to test the date being processed to see if it matches a particular day of week (0-6, respectively). If the processing date is equal to the corresponding value, the respective condition will evaluate to true and the contents within will display.

MTSDIfJan
MTSDIfFeb
MTSDIfMar
MTSDIfApr
MTSDIfMay
MTSDIfJun
MTSDIfJul
MTSDIfAug
MTSDIfSep
MTSDIfOct
MTSDIfNov
MTSDIfDec

These conditional tags can be used to test the date being processed to see if it matches a particular month of the year (1-12, respectively). If the processing date is equal to the corresponding value, the respective condition will evaluate to true and the contents within will display.

MTSDIfEvenMonth
MTSDIfOddMonth
MTSDIfMonthStart
MTSDIfMonthEnd

These conditional tags are closely related to the monthly tags above, but represent slightly different values. The even and odd month conditions should be self-explanatory. The MonthStart and MonthEnd compare the processing date to the first day of the month (MM01) and the last day of the month (MMDD), and if there is a match, the respective condition will evaluate to true and the contents within will display.

MTSDIfBlogRange
MTSDIfBlogRangeMonth
MTSDIfRangeStart
MTSDIfRangeEnd

These conditional tags will show the content that they encapsulate if the date falls within the range of entries that are in your blog. The blog range month indicates if you blogged during that month, while the other tag indicates if you blogged within that window. The RangeStart and RangeEnd tags are similar to the MonthStart and MonthEnd tags above, but instead of relating to the month, they are compared with the selected range. If the condition evaluates to true, the contents within will display.

MTSDIfYearStart
MTSDIfYearEnd

These conditional tags are similar to the MonthStart, MonthEnd, RangeStart and RangeEnd options above, but correspond instead to the beginning and end of the year (YY01 and YY31). If the processing date should fall on one of these dates, the condition evaluates to true, and the contents within will display.

MTSDIfEntries
MTSDIfPadding

These conditional tags only display their content if the condition is true.

Negative Tags

Since this plugin was created prior to the advent of the MTElse tag, there are indeed negative versions of each in MT-SomeDays, but they are not listed here because they should work fine with MTElse, so the suggestion is that you should try that first. If that doesn't work, or you would just prefer to use the negative version, go ahead and try it by inserting a "No" or "Not" as appropriate - for instance, MTSDIfNoEntries or MTSDIfNotSun. A little experimentation and you should get it in no time.

Putting it all Together

Your template might look something like:

<table border="0" cellspacing="4" cellpadding="0">
<tr>
<th align="center">Sun</th>
<th align="center">Mon</th>
<th align="center">Tue</th>
<th align="center">Wed</th>
<th align="center">Thu</th>
<th align="center">Fri</th>
<th align="center">Sat</th>
</tr>
<MTSomeDays padding="1" select="month">
<MTSDIfSun><tr></MTSDIfSun>
<td align="center">
<MTSDIfPadding> </MTSDIfPadding>
<MTSDIfNotPadding>
<MTSDIfEntries>
<MTEntries lastn="1">
<a href="<$MTEntryPermalink$>"><$MTSDWorkDate format="%d"$></a>
</MTEntries>
</MTSDIfEntries>
<MTSDIfNoEntries>
<$MTSDWorkDate format="%d"$>
</MTSDIfNoEntries>
</MTSDIfNotPadding>
</td>
<MTSDIfSat></tr></MTSDIfSat>
</MTSomeDays>
</table>
                              

This construct would be used in a template in order to create a table that displays a calendar for the current month, perhaps as a replacement for the tags used within Movable Type. Why would you do it this way, rather than with the default tags? That's up to you. This is just to show you how you might go about it. Enjoy!