FANDOM


Wikia Templates is a repository of templates meant to be used by other wikis on Wikia. Like the majority of Wikia wikis, content is licensed under a Creative Commons Attribution license, which is normally a good thing: it allows the content to be freely reused while ensuring that the original creators are attributed, and giving them (or Wikia on their behalf) recourse to pursue reusers who do not properly attribute them. In the particular case of the Templates Wiki, however, this requirement for attribution is at odds with the wiki's express purpose: by requiring attribution, it introduces a hurdle to reusers (and so probably discourages some reusers from bothering at all), and it is not clear that even a significant fraction of reusers bother with the attribution requirement. So basically, requiring attribution on copied templates is likely to prevent some copying, while copying that does happen may frequently disregard the attribution requirement.

For that reason, I think the current template collection should be replaced with one explicitly in the public domain, written from the ground up to have no licensing or attribution requirements, and the wiki relicensed so that all contributions to the Template namespace (and potentially in other areas) are automatically released in the public domain. It is possible that in some (potentially many) cases, templates themselves would not actually meet the threshold of creativity required for copyright protection (and therefore be eligible for coverage by the CC licenses) and could be explicitly released to the public domain as-is, but I am not a lawyer by any means; this is something that would have to be discussed with staff to see whether it's worth pursuing or if it would be better to just rewrite templates. In any case, template documentation would have to be rewritten regardless.

Templates Edit

A number of templates should be rewritten to start with, to form a core set of functionality: template documentation, template metadata, template linking, navbox, set of infoboxes, file description/fair use rationale box, set of file licensing templates. All templates found on Starter should be represented here (ideally, Starter templates should be replaced with this set of templates, since Starter content suffers from the same attribution problems as this wiki, only magnified across all wikis created since Starter started to be used).

General requirements Edit

Naming Edit

PD templates should have names matching their currently-used non-PD versions (e.g. the documentation template should be named Template:Documentation). There is room to allow for some renaming where the new name is more logical, and reasonable/common alternate names should be supported via redirects, but generally names should match editors' expectations, and editors' expectations arise from the current collections of templates added to new wikis via Starter, currently collected here, available on Wikipedia, and present at other locations around Wikia and the wider internet.

Metatemplates and dependencies Edit

Templates and their documentation should not require unnecessary dependencies, and any dependencies which are used should be clearly declared in the template's documentation. Any template which is currently available on Starter may be used without restriction or declaration. Non-template dependencies will generally be files, whose use should be minimized but is often unavoidable (if simply out of editor expectation if nothing else). CSS dependencies should be limited only to functionality that cannot be done inline, either because inline CSS cannot achieve it, or because the necessary CSS would be stripped by the parser. JS dependencies, where possible, should be limited to scripts that are maintained on Dev and can therefore be added by adding a single statement to MediaWiki:ImportJS or a simple loader to MediaWiki:Common.js or MediaWiki:Wikia.js. Functionality which relies on extensions should be limited to those extensions which are globally enabled by default on Wikia, and when a template must use functionality added by an extension which is not enabled by default, that dependency should be clearly documented in the template's documentation, with brief instructions for how reusers should request the extension be enabled on their wiki.

File and extension dependencies may be made optional by checking if the necessary file(s) are present on the wiki, or the necessary extension(s) are enabled, and providing suitable fallback behavior, even if that behavior is to do nothing and output nothing. Care must be taken when using #ifexist and similar expensive functions for this purpose, and it should be avoided altogether for templates which are meant to be used more than a handful of times on a page.

In all cases, in addition to the basic template which avoids dependencies where possible, alternate versions may be presented which have a greater number of dependencies in exchange for greater range of functions or flexibility, smaller template weight, etc.; these versions should be clearly linked from the base template's documentation, with a clear explanation of their requirements and advantages.

Markup and CSS Edit

"Markup" refers to HTML tags such as <span>, and wikitext such as '''; parser functions such as #if are not included in this. Templates should use semantic markup where allowed by the parser: for general "boxy" templates, divs should be used; for inline templates, spans should be used, etc. Tables should specifically be avoided as a layout method, and font tags are absolutely off-limits. The markup should be clean and simple, and CSS should be used to achieve layout effects where possible instead of the addition of more non-CSS markup; parser functions should be used to prevent markup from being output unless it is necessary (for example, hiding unused rows in an infobox).

Each template should have a unique class name, to allow readers and editors to easily style template output to their liking or simply hide it altogether. IDs should be avoided except in cases where a template can only be used once on a page, and even then, a class should be preferred over an ID. CSS should be kept simple where possible, with consistent order, spacing, color formats, units, etc. Vendor-prefixed rules should only be used when they add support to browsers or browser versions that are still widely used, and the non-prefixed CSS rule should be used together with them and should be placed after them (so for example, in a template with rounded corners, -moz-border-radius, -webkit-border-radius, and border-radius should all be given, with the non-prefixed rule following the vendor-prefixed rules). CSS rules which are only needed for browser compatibility should be clearly identified using <!-- HTML comments -->, so that they can be easily removed in the future when the compatibiity is no longer an issue; the exception to this is vendor-prefixed rules, which are self-evident.

Parser functions and functionality Edit

A template's functionality should be clearly defined, and its behavior should be unsurprising to anyone familiar with its functionality. Parser functions should be used to help enforce this. Unnecessary complexity in the template's code should be avoided, but if a tradeoff must be made between simpler code and simpler usage, it is preferred that usage be simplified.

Categories Edit

Unique or in-depth categorization schemes (such as per-month maintenance categories) should be avoided, as should categorization according to what type of markup or parser functions a template uses, or who wrote it, or where it came from. The general categorization scheme should feature a single Category:Templates containing a set of subcategories, with each subcategory covering a certain type of template (for example, a "Category:Infobox templates" for all infoboxes). Categorization should be aimed at helping editors find a template they are looking for more than anything else.

Wikia Templates-specific functionality Edit

In some cases it may be necessary to have functionality specific to this wiki. In these cases, the functionality should be wrapped in a parser function that checks whether the current wiki is Wikia Templates. This can be especially useful for adding notes specific to this wiki to a template's documentation and being sure that reusers will not have to delete the note to avoid having irrelevant or inaccurate information present on their wiki.

Templates Edit

This section contains a series of subsections for individual templates or template groups, and their documentation, laying out specific requirements or considerations that each must meet.

Documentation Edit

One of the most important and fundamental templates, since all templates should have documentation, and should therefore use Template:Documentation. Basic requirements are that it should clearly visually separate the template from its documentation and provide links allowing to quickly edit the documentation or view its history, as well as sandbox and testcases subpages (though an alternate version without explicit support for sandbox or testcases subpages should be provided for communities that have no interest in using them and don't want their entries cluttering Special:WantedPages and other special pages). When a subpage doesn't yet exist, the edit links should change to create links, which should automatically preload default text, and in the case of the documentation subpage not being created yet, it should display a message stating the documentation needs to be added and categorizing the template in a tracking category.

By default, documentation subpages should be located at "Template:Template name/doc", but a method for specifying a different-named subpage, or an entirely different page (e.g. the subpage of a different template; that is, allowing for shared documentation) should be provided. In addition, it should allow documentation to be provided directly on the template page itself, via the content parameter. Lastly, templates and template documentation not located in the Template namespace should be supported.

Template information Edit

This template (perhaps named Template:Template information or Template:Template metadata, or perhaps just located at Template:Documentation subpage) should be placed at the top of documentation, sandbox, and testcases subpages and should clearly state the purpose of that page and identify the template it belongs to, with a link back to that template. It should automatically categorize each of these page types.

It should require the name of the template be passed into it, and on other wikis this should be used to note that the template and its documentation originated from Wikia Templates, and that therefore there may be new versions of them here.

Wikia Templates functionality: it should allow noting whether a template is present on Starter (taking over the functionality of {{SPW}}), and it should have parameters to handle interwiki links to the other-language versions of Wikia Templates for the template and its documentation, so that the documentation can be copied directly to other wikis without adding incorrect interwiki links which may not even work.

Template linking template Edit

Template:T, with redirect from Template:Tl at minimum, should accept a template name and output a link to that template, surrounded by curly braces. It should support linking to names for pages that aren't in the Template namespace (including the main namespace, by adding a colon before the page's name in the input), as well as optional display of up to 20 parameters. It should also support a prefix parameter, to allow for such things as subst, safesubst, msgnw, and interwiki prefixes. Lastly, it should have a style parameter allowing the output to be monospaced. Optionally, it should allow some aspect of the styling of the displayed parameters to be customized, and it should detect single-character template names and change the link to make them more clickable.

Community content is available under CC-BY-SA unless otherwise noted.