Template:Main page

From Hearthstone Wiki
Jump to: navigation, search

This template is used to format the main page. Its purpose is to reduce error in maintaining the main page, which is otherwise easy because there is separate markup for the desktop and mobile main pages. This template helps guarantee both main pages get required updates because most information can be sent just once to the parameters of this template, and the template takes care of the necessary duplication and differences in layout.

Usage

{{Main page
|featureheading=
|feature=
|expansions=
|classesandheroes=
|videoservice=
|videoid=
|mechanics=
|gameplay1header=
|gameplay1list=
|gameplay2header=
|gameplay2list=
|gameplay3header=
|gameplay3list=
|gameplay4header=
|gameplay4list=
}}

Parameters

  • featureheading: The heading for the feature section. This only shows up on the mobile main page. The feature box on the desktop main page does not use a heading.
  • feature: The content to show in the feature box. On the desktop main page, this is the upper left box. It is usually used for the most recently announced or released expansion.
    • Updating the feature background must be done separately as explained below.
  • expansions: Links to the pages for expansions in order from most to least recently released. Include only one link per line.
    • On the desktop main page, only the first five are used, and this does not affect the backgrounds, which must be separately updated as explained below.
    • Game modes in this section are currently hardcoded into the template and must be updated separately for both desktop and mobile pages. This is because updating these is particularly complex if more need to be linked here, and this only needs to be done on rare occasions.
  • classesandheroes: This section takes a special format:
    • Each class section, which identifies the class and the heroes of that class, are separated by a blank line. The blank line must be empty; it can't have spaces, tabs, or other whitespace.
    • The first line of each class section is for the class itself. It has two parts separated by a ~ (and uses {{Main page class link}} for some of the formatting):
      1. A partial CSS class name for the class section to allow for unique styling in MediaWiki:Hydra.css and MediaWiki:Mobile.css. (Note that two CSS classes are created from this, one with linkgroup appended that is for styling the whole section for that class, and one with link appended for styling only the class link itself.) It should not have spaces, special characters should be avoided, and lowercase is preferred.
      2. The name of the class page.
    • The following lines identify each hero. They have four parts separated by ~ (and use {{Main page hero link}} for their formatting):
      1. A partial CSS class name for the hero link. link is automatically appended to this name. It should not have spaces, special characters should be avoided, and lowercase is preferred.
      2. The name of the hero page.
      3. The text to display for the link. This can be left blank to just use the name of the hero page for this text.
      4. Either an ID recognized by {{Heroportrait}} or the name of the hero card image without the File: or .png portion. (This uses the Heroportrait template to display the image behind the link on the desktop main page.)
  • videoservice: The service from which to get the main page video from. This will most commonly be youtube or twitchvod.
  • videoid: The id of the specific video to fetch from the given service. See EmbedVideo docuemntation on the Gamepedia Help Wiki for more information on these video parameters, as they coorespond to the service and id parameters used with the #ev parser function it provides.
  • mechanics: A list of links to the various card mechanics, one link per line. On the desktop main page, this is automatically divided into three columns. On the mobile main page, it is divided into two.
  • gameplay1header: The heading text for the first list of links in the Gameplay box. This list is in the left column on both the desktop and mobile main pages.
  • gameplay1links: The list of links, with one link per line, to show under gameplay1header.
  • gameplay2header: The heading text for the first list of links in the Gameplay box. This list is in the left column on both the desktop and mobile main pages.
  • gameplay2links: The list of links, with one link per line, to show under gameplay2header.
  • gameplay3header: The heading text for the first list of links in the Gameplay box. This list is in the middle column on the desktop main page and the right column on the mobile main page.
  • gameplay3links: The list of links, with one link per line, to show under gameplay3header.
  • gameplay4header: The heading text for the first list of links in the Gameplay box. This list is in the right column on both the desktop and mobile main pages.
  • gameplay4links: The list of links, with one link per line, to show under gameplay4header.

Updating the feature background

Desktop main page

  • Note: Administrative rights are normally required for either method.
  • Note: There's a transparent brown automatically applied over the image to darken it.
  • Note: The typical size used for this is 450 × 599 pixels.

The easy but slow way:

  • Uploading over the currently used image, usually named something like File:Main page feature background 2.jpg, is the minimum needed, but won't update immediately due to the image cache. The only way to speed is to use the alternate method below.
  • These images should be in Category:Desktop main page images if you need to find the current one.

Alternative longer method, but updates much faster:

  1. Upload the image, using a filename not currently used on the wiki.
  2. Find the direct URL by clicking on the image on its file page.
    • The part of the url needed looks like this: /6/6b/Main_page_feature_background.jpg
    • The characters before the filename change with the filename, so they won't always be /6/6b/, which is why looking them up like this is required.
  3. (Probably in another tab) Open MediaWiki:Hydra.css for editing.
    • Find #rmpfeature .rmpblockinner
    • On the second line below that, replace the current URL inside url("") with the partial URL from step 2, leaving /media in front.
  4. Optionally, it's possible to adjust the positioning.
    • The background-position is defined between "no-repeat" and " / cover" and may be something like "center top".
    • "left top", "right bottom", and other combinations of left, right, top, bottom can be specified to adjust the background alignment. (Look up CSS background-position for even more options.)
  5. Save MediaWiki:Hydra.css and refresh the main page. Usually, you should see the change immediately.
    • Rarely, it may take minutes for the CSS cache to update, but usually only if the CSS page is edited more than once in a brief time.

Mobile main page

  • Note: Administrative rights are normally required for either method.
  • Note: There's a transparent brown automatically applied over the image to darken it.
  • Note: The typical size used for this is 700 × 200 pixels.

The easy but slow way:

  • Uploading over the currently used image, usually named something like File:Mobile Main Page Feature header.jpg, is the minimum needed, but won't update immediately due to the image cache. The only way to speed is to use the alternate method below.
  • These images should be in Category:Mobile main page images if you need to find the current one.

Alternative longer method, but updates much faster:

  1. Upload the image, using a filename not currently used on the wiki.
  2. Find the direct URL by clicking on the image on its file page.
    • The part of the url needed looks like this: /0/09/Mobile_Main_Page_Feature_header.jpg
    • The characters before the filename change with the filename, so they won't always be /0/09/, which is why looking them up like this is required.
  3. (Probably in another tab) Open MediaWiki:Mobile.css for editing.
    • Find #mmpfeature .imageheading
    • On the second line below that, replace the current URL inside url("") with the partial URL from step 2, leaving /media in front.
  4. Save MediaWiki:Mobile.css and refresh the main page. Usually, you should see the change immediately.
    • Rarely, it may take minutes for the CSS cache to update, but usually only if the CSS page is edited more than once in a brief time.

Updating the expansion backgrounds

  • Note: Administrative rights are required to fully complete this.
  • Note: There's a transparent brown automatically applied over the image to darken it.
  • Note: The typical size used for this is 185 × 150 pixels.

This usually only needs to be done when a new expansion is announced. At this point, the feature should be updated to include the basic info on the upcoming expansion, while the most recently released expansion now needs to be moved into the first expansion slot. The procedure for doing this is as follows:

  1. Upload the background for the new expansion background. Usually, you can make this cutting out an appropriately-sized portion of the feature background.
    • The usual filename convention is File:Main page expansion name link.jpg.
    • Adding the file to Category:Desktop main page images is recommended.
    • Protecting the file is strongly recommended.
  2. (Probably in another tab) Open MediaWiki:Hydra.css for editing.
  3. Find #rmpexpansions #expansionlink4 a and the image url inside the url("") part on the line after the background-image line. Cut that and paste it over the URL below in #rmpexpansions #expansionlink5 a
  4. Work upwards and repeat this for #rmpexpansions #expansionlink3 a, #rmpexpansions #expansionlink2 a, and #rmpexpansions #expansionlink1 a, always pasting into the next one down.
  5. Find the direct URL of the recent uploaded expansion background by clicking on the image on its file page.
    • The part of the url needed looks like this: /e/eb/Main_page_Descent_of_Dragons_link.jpg
    • The characters before the filename change with the filename, so they won't always be /e/eb/, which is why looking them up like this is required.
  6. Place the partial URL from the previous step in the url("") underneath #rmpexpansions #expansionlink1 a, adding /media in front.
  7. Save MediaWiki:Hydra.css and refresh the main page. Usually, you should see the change immediately.