Substitute edit

Should this be substituted by using

{{subst:Clear}}

I am often unsure when Wikipedia:Template substitution should be used. --Timeshifter 13:42, 23 October 2007 (UTC)Reply

It can be, but it makes little difference performance-wise and kinda ruins the point of the template—to be a shortcut, so I wouldn't. Rocket000(talk) 19:37, 7 September 2008 (UTC)Reply

Code edit

I changed it to

<br clear="all" />

instead of

<br style="clear:both" />

I did a search of Google, and it seems that

<br clear="all" />

is better supported. Also, this makes these 2 templates the same:

Template:{{Clear}}

{{Clear}}

Here is a Google search of the two code phrases, and one result:

Template not working as designed edit

{{Clear}} and Template:{{Clear}} are syntactically different templates from each other that do almost the same thing. Someone with editing privleges please change this template to the following version from en.wiki:

<div style="clear:both"></div><noinclude>{{documentation}}</noinclude>

For a technical explanation of the differences between the two syntaxes, please refer to w:Template talk:Clear. In a nutshell, the current version causes the MediaWiki software to add a paragraph with a <br> in it. This leads to excess spacing that is not always desirable. Actually, at the moment, the template is a redirect to Template:{{Clear}}. It needs to be corrected so that the {{Clear}} template uses an empty div with CSS formatting (the preferred current standard in Web design and now well supported by nearly all browsers in common use). That generally provides a little extra spacing, but not a whole paragraph plus a line break. Thanks in advance for fixing this! --Willscrlt (Talk) 09:35, 7 September 2008 (UTC)Reply

Well, you're assuming our templates should be exactly like en.wp's, but ok. Would it be better to make Template:{{Clear}} use <div style="clear:both" />? That one seems to be used more. Rocket000(talk) 19:29, 7 September 2008 (UTC)Reply
I fully understand that each project is unique and that just because en.wiki does something one way (and en.books and meta do it the same way) doesn't automatically make it the best or only way to do things on other projects. However, I have created several templates from scratch and I have copied over several templates from en.wiki to en.books and a few to Commons, an also to a non-Foundation wiki that I administer. It really helps when templates work as expected. In this case, having two different ways of saying "Hey, I need a little extra space between these two things." is helpful. Sometimes the <br> is the better choice, and sometimes the empty <div> is the way to go. The difference is subtle, but the MediaWiki software does render each slightly differently, and the browsers do, too. The reason it is even an issue is because of how the MediaWiki software renders the templates. By placing Template:{{Clear}} on a line of its own, it generates an empty paragraph with a line break inside (<p><br><\p>), which renders in a browser as a pretty large blank space. The {{Clear}} template doesn't suffer from the extra spacing, because MediaWiki doesn't wrap <div> tags inside an empty paragraph. The CSS inside the <div> or <br> tag (style="clear:both") isn't even a factor at this point, because it doesn't affect whether or not MW inserts the blank paragraph.
I'm sure there are some templates here that were copied over from en.wiki that make use of {{Clear}} that look a little funky as a result from the extra spacing. It's not a life or death thing, but having different options empowers template designers with the ability to make things look a little nicer and give the visitors a little bit better experience. It's like the difference between different bullet sizes ( · ∙ · •  ). You really only need one bullet, right? But it's nice to have different size options to get exactly the look that helps to give the best visual presentation to our visitors. Here at Commons, media is generally more important than written text, but that doesn't mean we can't strive to have good looking text, too.
As to changing Template:{{Clear}} to <div style="clear:both" /> instead of <br clear="all" />, I don't think that's a good idea, either, for the same reason. Each template has a particular purpose, and keeping them distinct is helpful to template developers. Other projects, like Meta, use <div style="clear:both" /> for Template:{{Clear}}, too. Standardization among popular templates is preferable to being unique. --Willscrlt (Talk) 23:26, 7 September 2008 (UTC)Reply

Height edit

@Tulsi Bhagat: Why? This template is to add place appropriate so that the following content is below any floating elements, not at least 1em below them. I know no precedent for a such change to this template’s equivalent on any wiki, and modifying fully protected templates without any edit summary is almost never a good idea—they’re protected for a reason, after all. —Tacsipacsi (talk) 15:58, 20 January 2020 (UTC)Reply

@Tacsipacsi: Hello! My bad. Sorry for the inconvenience. I've reverted it. Have fun! Kind regards, — Tulsi Bhagat (contribs | talk) 16:06, 20 January 2020 (UTC)Reply

Please also list/mention this template's shorthand: {{-}} in this documentation - or explain its absence. edit

I hereby suggest adding mention of this template's shorthand {{-}} – and if necessary, any additional commentary.

Respectfully, --GeeTeeBee (talk) 13:00, 14 February 2022 (UTC)Reply

@GeeTeeBee: Template:Clear/doc is not protected, you may edit that.   — Jeff G. please ping or talk to me 16:04, 14 February 2022 (UTC)Reply
@Jeff G.: O.K., thank you ! -- I have given it a try, but couldn't get it right. Too advanced for me... So the question remains open. Regards --GeeTeeBee (talk) 16:19, 14 February 2022 (UTC)Reply
@GeeTeeBee: I think this edit looks decent.   — Jeff G. please ping or talk to me 16:50, 14 February 2022 (UTC)Reply
@Jeff G.: OK, thanks, that's very fast ! -- But I was also (actually more so) thinking of somehow adding it to the main body of the doc. text – under the "Usage" header / Section ? -- Tried editing the " |shorthand= " parameter, but didn't manage to figure that out... GeeTeeBee (talk) 17:08, 14 February 2022 (UTC)Reply
Return to "Clear" page.