Template:MainPage: Difference between revisions

From Geometry Dash Expanded Wiki
Jump to navigation Jump to search
geometrydash.wiki.gg>Jamasto
mNo edit summary
m 12 revisions imported: Copied from Official Wiki https://geometrydash.wiki.gg/index.php?title=Template%3AMainPage&oldid=232932 ; contributors: https://geometrydash.wiki.gg/index.php?title=Template%3AMainPage&action=history
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>{{#invoke:Main page|main}}</includeonly><noinclude>
<includeonly>{{#invoke:MainPage|main}}</includeonly>__NOTOC__<noinclude>
;Description
;Description
:This template is used to create an IMP Main Page. It uses [[Module:Main page]] to arrange a series of [[Template:Main page box]]es in a [https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_grid_layout CSS grid].
:This template is used to create a dynamic [https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_grid_layout grid layout] on the main page using wiki.gg's Improved Main Page (IMP) framework, initiated with [[Module:MainPage]] to then display with [[Template:MP-Box]] header-body content containers.  
:The layout is made using keywords arranged in a grid. This grid has 3 columns on desktop-width screens, 2 columns on tablet, and 1 on mobile. Each can have as many rows as you want. Each keyword represents the same section and can span multiple rows and/or columns, but ''must'' form a contiguous rectangle of any dimension (1x1, 1x2, 2x2, 2x3, etc.).
:The layout is constructed using keywords arranged in a grid. This grid is comprised of 3 columns on desktop-width displays (>=1350px), 2 columns on tablet-width displays (990px - 1350px), and 1 column on mobile displays (<=990px), and there is no limit for number of rows. Each keyword represents a grid section and can be assigned to cells to span multiple rows and/or columns, but must form dimensions of a contiguous rectangle (1x1, 2x1, 3x1, 1x2, 2x2, 1x3, 2x3). The table below gives a visual representation of how main page boxes can be arranged (using 3x1, 2x1, 1x2 allocations). The keyword <code>welcome</code> loads the contents of [[{{SITENAME}}/welcome]], for example. Keywords are not required to be used in all layouts for each screen dimension.
 
:Using a keyword without an existing main page box will insert a placeholder containing a page-create input, which can be used to create a new main page box page from the specified keyword.
 
:
For example, the following input to desktop would produce a grid resembling the table following.
:{| class="wikitable"
 
{| class="wikitable"
  | style="background-color:#0F03;" |welcome
  | style="background-color:#0F03;" |welcome
  | style="background-color:#0F03;" |welcome
  | style="background-color:#0F03;" |welcome
  | style="background-color:#0F03;" |welcome
  | style="background-color:#0F03;" |welcome
  |-
  |-
  | style="background-color:#F0F3;" |about  
  | style="background-color:#F0F3;" |about
  | style="background-color:#00F3;" |external
  | style="background-color:#F0F3;" |about
  | style="background-color:#00F3;" |external
  | style="background-color:#00F3;" |external
  |-
  |-
| style="background-color:#F0F3;" |about
  | style="background-color:#FF03;" |contribute
  | style="background-color:#FF03;" |contribute
  | style="background-color:#FF03;" |contribute
  | style="background-color:#FF03;" |contribute
| style="background-color:#00F3;" |external
|}
|}
:Where <code>welcome</code> is the contents of [[{{SITENAME}}/welcome]], <code>about</code> is the contents of [[{{SITENAME}}/about]], and so on. See [[Template:Main page box]] for more information about creating your own boxes.
If you enter a keyword that does not have a corresponding box already, you'll be prompted to create one when saving or previewing the page.
If you leave a keyword out of a certain layout, it will not be displayed on that layout. A warning will be given at the top of the edit preview in case this was an accident, but can be safely ignored if intentional.
For additional hints and information, see the comments that came on your main page or ask a wiki.gg staff member for help.
==Technical explanation==
For the CSS savvy, this section explains how it works a bit under the hood.
The input to desktop, tablet, and mobile create [https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties CSS variables] which are then used as the value of [https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-areas grid-template-areas] in media queries for screen widths >=1350px, >=990px, and <990px. The boxes are given an id based on their subpage name, which is then used by the module to find the template, as well as by the box templates to assign them a CSS id of <code>mp-box-<keyword></code>. Since these keywords are used directly in the grid layout, they must follow the rules of [https://developer.mozilla.org/en-US/docs/Web/CSS/custom-ident <custom-ident>] naming.
;Syntax
;Syntax
<pre>
<pre>
{{Main page
{{MainPage
  |desktop = (required) [requires 3 main page box titles per line]
  |desktop = (required) [requires 3 main page box title specifications per line]
  |tablet  = (required) [requires 2 main page box titles per line]
  |tablet  = (required) [requires 2 main page box title specifications per line]
  |mobile  = (required) [requires 1 main page box titles per line]
  |mobile  = (required) [requires 1 main page box title specification per line]
}}
}}
</pre>
</pre>
;Sample
;Sample
<pre>
<pre>
{{Main page
{{MainPage
  |desktop =
  |desktop =
welcome welcome welcome
welcome welcome welcome
about about links
about about external
contribute contribute links
contribute contribute external
  |tablet =
  |tablet =
welcome welcome
welcome welcome
about links
about external
contribute contribute
contribute contribute
  |mobile =
  |mobile =
welcome
welcome
about
about
contribute
contribute
links
external
}}
}}
</pre>
</pre>
;Sample output
;Sample output
{{Main page
{{MainPage
  |desktop =
  |desktop =
welcome welcome welcome
welcome welcome welcome
Line 75: Line 60:
external
external
}}
}}
==Dependencies==
For this template to work properly, you need the following:
*[[Module:Main page]]
*All templates in [[:Category:Main page templates]].
*All CSS within the "Main page layout" section found in [[MediaWiki:Common.css]].
[[Category:Container templates]]</noinclude>
[[Category:Container templates]]</noinclude>

Latest revision as of 19:03, 10 October 2026

Description
This template is used to create a dynamic grid layout on the main page using wiki.gg's Improved Main Page (IMP) framework, initiated with Module:MainPage to then display with Template:MP-Box header-body content containers.
The layout is constructed using keywords arranged in a grid. This grid is comprised of 3 columns on desktop-width displays (>=1350px), 2 columns on tablet-width displays (990px - 1350px), and 1 column on mobile displays (<=990px), and there is no limit for number of rows. Each keyword represents a grid section and can be assigned to cells to span multiple rows and/or columns, but must form dimensions of a contiguous rectangle (1x1, 2x1, 3x1, 1x2, 2x2, 1x3, 2x3). The table below gives a visual representation of how main page boxes can be arranged (using 3x1, 2x1, 1x2 allocations). The keyword welcome loads the contents of Geometry Dash Expanded Wiki/welcome, for example. Keywords are not required to be used in all layouts for each screen dimension.
Using a keyword without an existing main page box will insert a placeholder containing a page-create input, which can be used to create a new main page box page from the specified keyword.
welcome welcome welcome
about about external
contribute contribute external
Syntax
{{MainPage
 |desktop = (required) [requires 3 main page box title specifications per line]
 |tablet  = (required) [requires 2 main page box title specifications per line]
 |mobile  = (required) [requires 1 main page box title specification per line]
}}
Sample
{{MainPage
 |desktop =
welcome welcome welcome
about about external
contribute contribute external
 |tablet  =
welcome welcome
about external
contribute contribute
 |mobile  =
welcome
about
contribute
external
}}
Sample output
welcome

The welcome main page box does not exist. Check your spelling or create it here.
<inputbox> type = create width = 25 placeholder = name (no spaces, cannot start with a number) buttonlabel = Create this main page box default = welcome prefix = Geometry Dash Expanded Wiki/ preload = Template:MP-Box--Preload summary = Created using preload </inputbox> See Template:MP-Box for more information.
For inherent technical restrictions on valid names, see <custom-ident>.

about

The about main page box does not exist. Check your spelling or create it here.
<inputbox> type = create width = 25 placeholder = name (no spaces, cannot start with a number) buttonlabel = Create this main page box default = about prefix = Geometry Dash Expanded Wiki/ preload = Template:MP-Box--Preload summary = Created using preload </inputbox> See Template:MP-Box for more information.
For inherent technical restrictions on valid names, see <custom-ident>.

external

The external main page box does not exist. Check your spelling or create it here.
<inputbox> type = create width = 25 placeholder = name (no spaces, cannot start with a number) buttonlabel = Create this main page box default = external prefix = Geometry Dash Expanded Wiki/ preload = Template:MP-Box--Preload summary = Created using preload </inputbox> See Template:MP-Box for more information.
For inherent technical restrictions on valid names, see <custom-ident>.

contribute

The contribute main page box does not exist. Check your spelling or create it here.
<inputbox> type = create width = 25 placeholder = name (no spaces, cannot start with a number) buttonlabel = Create this main page box default = contribute prefix = Geometry Dash Expanded Wiki/ preload = Template:MP-Box--Preload summary = Created using preload </inputbox> See Template:MP-Box for more information.
For inherent technical restrictions on valid names, see <custom-ident>.