Template:Main page/doc: Difference between revisions

from https://cytooxien.wiki.gg/de/wiki/Vorlage:Main_page/doc?action=edit
https://support.wiki.gg>Thejoppyloppy
(added some documentation that was missing)
(from https://cytooxien.wiki.gg/de/wiki/Vorlage:Main_page/doc?action=edit)
Line 24: Line 24:
| style="background-color:rgba(255,255,0, 0.15)" | contribute
| style="background-color:rgba(255,255,0, 0.15)" | contribute
|}
|}
Where <code>welcome</code> is the contents of [[{{MediaWiki:Mainpage}}/welcome]], <code>about</code> is the contents of [[{{MediaWiki:Mainpage}}/about]], and so on. See [[Template:Main page box]] for more information about creating your own boxes.
Where <code>welcome</code> is the contents of [[Template:Main page/welcome]], <code>about</code> is the contents of [[Template:Main page/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 enter a keyword that does not have a corresponding template 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.
For additional hints and information, see the comments that came on your main page or ask a wiki.gg staff member for help.
Line 35: Line 33:
For the CSS savvy, this section explains how it works a bit under the hood.
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.
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 id of the boxes should be equal to the 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.
 
==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]].
{{gad|mpEditLinks}} is also highly recommended. Its code can be found at {{gad|mpEditLinks.css}} and {{gad|mpEditLinks.js}}.


==TemplateData==
==TemplateData==
Line 72: Line 63:
</templatedata>
</templatedata>
<noinclude>[[Category:Template documentation]]</noinclude>
<noinclude>[[Category:Template documentation]]</noinclude>
==Documentation for the tech savvy==
{| class="wikitable mw-collapsible mw-collapsed"
|-
! colspan=2 | Parameters !! Description !! Type !! Status
|-
| rootpage || <code>rootpage</code> || Changes the page from which boxes are subpages of (default: current page) || String || Optional
|-
| desktop columns || <code>desktop-columns</code> || Overrides column width for the desktop layout (default: 2fr 1fr 2fr) || String || Optional
|-
| tablet columns || <code>tablet-columns</code> || Overrides column width for the tablet layout (default: 1fr 1fr) || String || Optional
|-
| mobile columns || <code>mobile-columns</code> || Overrides column width for the mobile layout (default: 100%) || String || Optional
|}