Template:Event banners

From Hololive Fan Wiki

Event banners is an Infobox-based template designed to supplant the conventional Infobox in displaying event banners on the Hololive Fan Wiki's Main Page. It offers several advantages over the traditional Infobox, such as making adding/removing events easier, automatically hiding/showing events as time passes, and offering a customizable limit to the number events that can be displayed at once. This template currently holds up to 10 events, but this can be expanded if needed.

Usage[edit]

Event banners
Upcoming Events
August 8Towa's Birthday 2021 Live

Events are added in sets of 3 unnamed parameters that follow this strict order:

  1. The expiration date/time. Any date/time object accepted by MediaWiki's time function. Omitting the time will result in that event expiring at 00:00 that day.
  2. The image (or any content, really) you want to display.
  3. The description of the event.

Example[edit]

{{Event banners
| August 8, 2021 21:00
| [[File:Towa Birthday Live 2021 Banner.png|400px]]
| [[Towa]]'s Birthday 2021 Live
}}

WARNING:[edit]

Make sure you add events in chronological order. Though this template automatically hides/shows events as time passes, it is NOT smart enough to sort events by time. If you add events out of order, they will not display when you want them to.

Optional Parameters[edit]

These parameters may be omitted, and if done so, will assume the following default values:

Default values
| enablescheduling = 
| maxevents        = 3
| above            = Event banners
| header1          = Upcoming Events
| below            = 
| headerstyle      = background:#CCF;
| labelstyle       = width:100px;background:#DDF;
| belowstyle       = 

Description:[edit]

  • enablescheduling: If this parameter is not blank, this turns the scheduling feature on.
  • maxevents: The maximum number of events that can be displayed at any given time. Must be a whole number from 1 to 10. Does nothing if scheduling is not enabled.
  • above: The text to display at the top of the Infobox
  • header1: The text to display in this Infobox's only header
  • below: The text to display in an optional row at the bottom of the Infobox
  • headerstyle: Styling for this Infobox's header
  • labelstyle: Styling for this Infobox's labels
  • belowstyle: Styling for this Infobox's below row

Advanced usage[edit]

These following "features" may require advanced knowledge of how Infoboxes and how this template works to be used properly. Explaining these goes beyond the scope of this documentation, and so only minimum documentation is provided – only intended to show that these features exist.

Overrides[edit]

Event banners
Upcoming Events
July 22 —
August 15
Yokosuka Umi no Anime Carnival

The following parameters may be overriden by defining them as named parameters. They work just like they do in regular Infoboxes.

  • image(n): Images to display at the top of the template
  • label(n): Text to use as a label in row n
  • data(n): Text to display as data in row n

Example[edit]

{{Event banners
| August 15, 2021 23:59:59
| [[File:Aqua UmiAni Banner.jpg|400px]]
| [https://umiani.net/ Yokosuka Umi no Anime Carnival]
| label2=July 22 — <br>August 15
}}

Warning[edit]

Named parameters always point to fixed positions. If you remove an event from this template, be sure to check and update the named parameters of any overrides that might be affected.

Intentionally putting an event out of order[edit]

If you want to intentionally put one event out of order, for whatever reason, and scheduling is enabled, you can safely do so provided that there are no more than maxevents - 1 events after the out-of-order event. This trick works by exploiting the template's logic and there's a high potential for messing this up, so don't do this unless you know what you're doing.

Considerations[edit]

  • Because the MediaWiki software uses extensive caching, your scheduled content will not update immediately upon reaching the scheduled time. If you're impatient, use Special:Purge on the target page to flush the server's cache and force the page to update.
  • During the middle of the year, it's generally fine to omit the year from dates, because MediaWiki will assume the current year. However, for the very same reason, when it's near the end of the year, don't omit the year from dates. If you have events both in this year and the next without specifying the year, this results in scheduling issues.