Template:Imagefix: Difference between revisions

From Songs of Syx Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<div id="imagefix">{{{1}}}</div>
<div id="imagefix">{{{1}}}</div>
<noinclude>This is for fixing images that usually appear as icons at the very start of some articles. By default, if some templates are right above articles, it can mess up the alignment of said images. This template fixes that so the image appears properly aligned. Here's an example.
<noinclude><br>{{Imagefix/doc}}[[Category:Templates]][[Category:Article_management_templates]]</noinclude>
== Header #1 ==
{{stub}}
[[File:employment_counter.png|left]]Notice how the image is awkwardly aligned. It's not vertically matching up with the text as it should be. The stub template, in this specific case, is the cause of this. Most other similar templates will cause this exact same problem, though this can happen in certain headers with no templates at all. The reason for this is currently unknown, but at least there's a fix for this now. If you look at the next example header, you will see how this template can fix the alignment problem. Technology is an amazing thing. Where would we be without it? You guys ever ask yourselves that?
 
== Header #2 ==
{{stub}}
{{imagefix|[[File:employment_counter.png|left]]}}Now this time, the image is aligned properly. This can also be fixed by - in this exact case - typing <code><nowiki>{{clear}}</nowiki></code> right after the <code><nowiki>{{stub}}</nowiki></code> that makes the stub template. Note that using the "clear" thing doesn't always create the best results, and can add further issues to image and text alignment. Even if a template isn't above an article, using this "imagefix" template can still provide some help.
 
== Syntax ==
How this image-fixing template is used is as follows: <code><nowiki>{{imagefix|</nowiki><span style="color:lime;"><nowiki>[[File:filename.png|left/right]]</nowiki></span>}}</code><br />
Note that this template is meant for images that are aligned to the left or right, but can technically be used for any kind of image.<br />
The syntax of the template used exactly how it was in the ''second'' header above would be <code><nowiki>{{imagefix|</nowiki><span style="color:lime;"><nowiki>[[File:employment_counter.png|left]]</nowiki></span>}}</code>
[[Category:Templates]][[Category:Article_management_templates]]</noinclude>

Latest revision as of 02:18, 21 November 2021

{{{1}}}


Template Documentation

Description

As the name would imply, this template is used to fix the alignment for small images used at the very start of a paragraph or sentence. By default, MediaWiki misaligns some images when starting an article or section with them, by raising the image a few pixels above the text. This template fixes that and counters the misalignment by moving the image down a few pixels, aligning the image properly with the text. When certain templates are above the image, this can misalign images even more.

Syntax

{{imagefix|<IMAGE_FILE_LINK>|LEFT/RIGHT}} - Note that the left/right part of the syntax is technically not part of the template, but still required on this wiki for the image to be aligned to either side properly.

Examples

Header #1

 This page is a stub. You can help this page by adding more to it. Seriously, please do that.
Notice how the image is awkwardly aligned. The stub template is causing this, but this can occur even without templates above the image. It's not vertically matching up with the text as it should be. The reason for why and how MediaWiki causes this is currently unknown, but at least there's a fix for this. If you look at the next example header, you will see how this template can fix the alignment problem. Technology is an amazing thing. Where would we be without it? You guys ever ask yourselves that?

Header #2

 This page is a stub. You can help this page by adding more to it. Seriously, please do that.

Now this time, the image is aligned properly. The exact syntax used for this example is {{imagefix|[[File:employment_counter.png|left]]}}. This template can be used for any image, but its purpose is mainly to fix images at the very start of articles. Typing {{clear}} after the template can also fix the issue, but can cause unwanted results. The very text you're reading now is nothing more than just filler material, to give this paragraph a more "full" look - so that it somewhat matches the example above.