![]() |
2008-08-13 -- This functionality was probably created for MediaWiki 1.3 or 1.4 and uses only the most simple of templating technologies. It's quite easy to understand, and I hope I made instructions simple enough for others. BUT, the newer MediaWiki versions have vastly "improved" functionality such as allowing math or logic in templating. This would open up newer/simpler possibilities, but this oldschool method is probably faster-running than them.
See also:
Introduction ∞
So the problem of MediaWiki as a weblog has been partly solved.
Now I want to be able to create a fancy archive of weblog entries. This is a fairly complex problem.
desired features ∞
- I want to see this month's calendar.
- Within it, any page which has a weblog entry will be highlighted.
- Clicking on one of those links will generate a backlinks list indicating any entry for that day.
- I want to be able to click to view last month's or the next month's calendar.
-
Each calendar will be different, depending upon the month. The first day of the month can begin on a different calendar day (Monday, Tuesday, ...) for each month.
when am i? ∞
https://meta.wikimedia.org/wiki/Variable
I want to append the appropriate text to a number, nomatter the number. I want to do this by passing any number as a switch to a template, like: {{template:12345}}
which will output 12345th. This would be possible if I could analyze the last character of that variable, but I don't presently see a way to do this.
Actually, I'd also love to have a template add commas intelligently. Hrm..
A basic calendar ∞
A calendar template ∞
This is a template which is fed parameters. These parameters become the days of the week. We must also be careful to display the appropriate blank spaces.
So we just take the template above, and feed it properly:
{{calendar||1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31}}
Where [[Template:Calendar]]
is:
A 31 day calendar starting on Monday ∞
A few issues exist here. First, it requires the passing of a massive amount of parameters. It's not "friendly". Really, we should just be able to say something like "a 31 day calendar starting on Monday".
This is two problems in one.
- How many days are in the month?
-
What day does the month begin on?
Additionally, we have the problem that we may want to display days from the previous or next month.
I'm going to avoid these problems for the simple reason that tackling them makes things a whole LOT more complicated. You'll find out why below ...
Making dates pull up a backlink list of certain pages made on those dates ∞
This is again a compound problem. We could manually do something like this:
{{calendar|[[link]]|[[link]]|...}}
Which would generate something like:
This would work ok. And of course the links could be anything. The content of any of those links would be #REDIRECT [[Special:Whatlinkshere/the date]]
.
I could even make it more generically #REDIRECT [[Special:Whatlinkshere/{{PAGENAME}}]]
if I set it up right. Then every weblog entry would have to have a link to that page. This is an adequate solution.
- What about fancy things like changing the background colour of a cell?
-
Is there a more automated solution to all of this mess?
Certain cells are coloured ∞
(content missing)
Interesting thoughts ∞
If all blog entries had a category which is their date of creation, then the calendar could very easily automatically reference all of those links.
Now the unfortunate thing is there's no real way to pull up a simple listing of items of a certain category without first making that page.
Backlinks are a smarter solution I think. I would manually tag every page somehow, to indicate their date.. and then I would have the calendar templating engine reference those links.
Again, this doesn't seem like the proper solution to me.
Categories would work, because each blog page would just reference the date as a category. However, this doesn't solve the problem that all of those categories would have to be created one after the other. The good thing is that they'll show up as red when they don't exist in the calendar. [[:Category:Nonexistant|1]]
Resources/links ∞
-
https://meta.wikimedia.org/wiki/Template:Mlc-0512 -- This is a variation..
- If that breaks, see Template:Mlc-0512
- Which uses
[[User:Sj/ml/December {{{1}}}, 2005|{{{1}}}]]
- https://www.mediawiki.org/wiki/Extension:Calendar_%28Cdamian%29
-
https://web.archive.org/web/20081120193247/http://riff.bwerp.net/
ported