[Mediawiki-l] {{CURRENTMONTHNAME}} minus one
Joshua Yeidel
yeidel at wsu.edu
Wed Mar 15 22:45:44 UTC 2006
This is a nice straightforward solution, especially since the range is
limited to 12. That "array" template stuff I mentioned earlier in the
thread can be mind-boggling.
jj
On 3/15/06 2:27 PM, "Rick DeNatale" <rick.denatale at gmail.com> 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!
>
>
> --
> Rick DeNatale
>
> Visit the Project Mercury Wiki Site
> http://www.mercuryspacecraft.com/
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l at Wikimedia.org
> http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
More information about the MediaWiki-l
mailing list