User:Aristeas/Credits/Implementation

From Wikimedia Commons, the free media repository
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 and User:Aristeas/Credits/CC BY-SA 3.0 GFDL 1.2.

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 single class="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 attributes dir, lang and cellpadding, 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.

Template preview[edit]

Attribution
(required by the license)
InfoField
© Roman Eisele / Wikimedia Commons / {{{abbreviation}}}
Using this picture
Cc.logo.circle.svgCc-by new.svgCc-sa.svg
InfoField
{{{explanation}}} In particular, this means:
  • You must include the credit line (Attribution) given above in an appropriate place (next to the picture, or in your list of image sources, etc.), to establish a clear and reasonable link between the picture and the credit line. Please quote the credit line (Attribution) completely.
  • If you use this picture in projects not related to Wikimedia/Wikipedia (e.g., in a book, or on your website), please send me an Mail-closed.svg e-mail or leave me a message.
  • If you use this picture in printed media (e.g., in a book, for a postcard, etc.), please send me a sample copy. Thank you very much!
  • Mail-closed.svg Contact me if you need a special version of this picture, more information or any special permission.
Editing this picture
InfoField
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!