Please remember to make use of the DML Wiki Manual of Style and Code of Conduct during your stay.

 Actions

Help

Help:Extension - TemplateStyles

From Dragon Mania Legends (DML) Wiki

TemplateStyles is a MediaWiki extension allowing those with template editing privileges to use CSS (sanitized for safety) for specific templates. The CSS is only called when the template is used, instead of loading it for every page. The use of TemplateStyles can also make styles easier to find, and templates easier to read and edit, since code not related to the template's functions can be moved elsewhere. Template editing is restricted on this wiki to those with template editing privileges, for careful curation of contents and due to the cascading effects some templates have.

Use

Styles must be created in the correct place, then linked to from the template itself, to function correctly.

Creating Styles

For pages that have template documentation, there's a blue "create styles" button at the top for quick style creation. The button creates a subpage (denoted by the "/") for the styles at the proper location: Template:TemplateName/styles.css (where "TemplateName" is the name of the template itself). Once opened, CSS styles can be freely added, though it is noteworthy to know that some styles are intentionally restricted for safety reasons. Most needed styles can be added without issue.

If no template documentation exists, manually create a subpage of your template, entitled "styles.css" noting the "s" in "styles" is lowercase. This means your page should be located at Template:TemplateName/styles.css (where "TemplateName" is the name of the template itself).

Applying Styles

Styles are not automatically applied to the template, rather they must be invoked/linked inside the template to be recognized. Documentation pages mention how to do this, and include the sample code with the correct name to copy and paste (e.g., <templatestyles src="TemplateName/styles.css" />). The code goes after the opening <includeonly> tag, as the template must also pass the styles to wherever it is used; therefore, they must be in the included contents section.

See Also

This Wiki is created by players for other players and is not maintained by, or affiliated with, the game maker (Gameloft).
Cookies help us deliver our services. By using our services, you agree to our use of cookies.