[Mediawiki-l] {{CURRENTMONTHNAME}} minus one

Christof Damian christof at damian.net
Thu Mar 16 08:18:16 UTC 2006


You could also use my calendar extension:
http://meta.wikimedia.org/wiki/User:Cdamian/calendar

It allows to include pages based on dates. For example:

== Last Month ==
<calendar>
view=today
date="-1 month"
format="Calendar/%n.%Y"
</calendar>

== On this day ==
<calendar>
view=today
date="-1 month"
format="Calendar/%j.%n"
</calendar>

It doesn't fit for every case, but have a look at the examples to see
what is possible.

christof


On Wed, 15 Mar 2006, Rick DeNatale wrote:
> On 3/15/06, Joshua Yeidel <yeidel at wsu.edu> wrote:
> > I just found a way to compute the correct string in PHP.  I don't know how
> > to make it available as a "magic word".  I looked at the "meta" site and the
> > code, but I didn't find an easy solution.
> >
> > It is possible that a solution could come from the world of templates -- I'm
> > not an expert, but it seems doable.  For example, you could have an array
> > that is indexed by {{CURRENTMONTH}} which gives the previous month's name.
> 
> I do something similar on my wiki to provide an on-this-date feature
> on the home page.  I've got a family of history templates with a
> master which has 366 template subpages for each day of the year.
> 
> Adapting what I do to get a last month template would look something like this:
> 
> 1st make a template called say LastMonth
> Template:LastMonth
> {{LastMonth/{{CURRENTMONTHNAME}}}}
> 
> Then make 12 templates
> 
> Template:LastMonth/January
> December
> 
> Template:LastMonth/February
> January
> 
> ...
> 
> Template:LastMonth/December
> November
> 
> voila!
> 
> 

-- 
Christof Damian         
christof at damian.net



More information about the MediaWiki-l mailing list