User:Aristeas/Credits/Implementation
Jump to navigation
Jump to search
This template provides the internal implementation for my personal credits template.
It should not be called directly, but is just called from the concrete credits templates: User:Aristeas/Credits/CC BY-SA 4.0, User:Aristeas/Credits/CC BY-SA 3.0 GFDL 1.2 etc.
Therefore please see these templates for the documention of the public parameters.
Some minor hints about the implementation
[edit]- In earlier versions I used (like in the code for the original {{Information}} template) a
<div>
around the complete<table>
element:<div class="hproduct commons-file-information-table"> ... </div>
. But the {{Location}} template does not use that<div>
at all, so we can omit it. - Seems that for the
<table>
the singleclass="toccolours"
is sufficient. But the {{Information}} and {{Location}} templates add more classes, so I add all the classes used by the {{Location}} template, too. - The
<table>
element in the standard {{Information}} still uses the attributesdir
,lang
andcellpadding
, so we use them, too (but I wonder if this is really good 21st-century HTML?). - In order to get the spacing right and to allow several information supplement tables to be merged visually with the {{Information}} template, we must avoid empty lines and even some line breaks in our template code. For example, there must be no newline between
</includeonly>
and<noinclude>
, and it seems that we must even avoid line breaks between the various included category definitions. Else the MediaWiki software thinks that we want a break after our table and adds a nasty<p><br/></p>
(or similar) after it. - The localization for the ‘Attribution’ field uses the same code as the {{Credit line}} template; so look out if that line in the {{Credit line}} template or if any of the subtemplates used there changes, because this may force us to update this template, too.
- Earlier versions of this template added ‘/ Wikimedia Commons /’ right in the middle of the credit line. I have dropped this part in May 2024 for several reasons. Mentioning the platform is not required by the CC licenses themselves; leaving it out makes it easier for re-users to use the credit line; and this also avoids the wrong idea that the files are owned by the Wikimedia Foundation.
Template preview
[edit]Attribution (required by the license) | © Roman Eisele / {{{linkedattrlicense}}} |
Using this picture | {{{explanation}}} In particular, this means:
|
Editing this picture | If you want to edit this picture for Commons, please upload your edited version using a new file name. My own version of this picture should be preserved and must be easily accessible. Please add the template {{Derived from}} or {{Extracted from}} to your version and use it to link to my original version of the picture. Thank you very much! |