Template talk:UserTemplate

From The Urban Dead Wiki
Revision as of 05:35, 7 August 2009 by Lariat2301 (talk | contribs) (Works. Great!)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Thanks!!! ----Secruss|Yak|Brahnz!|CGR|PKA|800px-Flag of the United States.svg.png|EMLN|Templates|RRF|RFTM|Crap|WHOZ|Evil3.gif|MU|GN|C2008|Chippy.gif|00:03, 17 December 2007 (UTC)

Requested for addtion of alignment

I've tweaked the code for the UserTemplate (here) so it permits a userbox to be aligned left, right or center.

My code only has a few trivial additions. First,

align="{{{align|left}}}"

Is placed ahead of the

style=

in the table's header.

Second, the necessary changes to the explanations of usage and defaults.

The last edit is to repair a likely fault:

<br clear=both />

is added after the template. The previous default was left aligned, and normally had no text immediately to the right of the box. As it is now, in both left and right alignment text is alongside the box, so many pages would suddenly have their appearance broken. I think this fixes it, but I must admit I'm not certain whether it would break situations where the template had been in use in parallel with another floating table.

With the original UserTemplate, the code

''This is test text immediately preceding the template.''
{{UserTemplate
|bordercolor=#008888|headerbackground=#008888|image=Chill-pill.jpg|headertext=Original Lazy|
maintext=This user would love to have a nicer wiki page, but is too lazy to design it her or himself.}}
''This is test text immediately following the template.''

produces

This is test text immediately preceding the template.

Chill-pill.jpg Original Lazy
This user would love to have a nicer wiki page, but is too lazy to design it her or himself.

This is test text immediately following the template.

With my alteration, the equivalent code

''This is test text immediately preceding the template.''
{{User:Lariat2301/UserTemplate
|bordercolor=#008888|headerbackground=#008888|image=Chill-pill.jpg|headertext=New Lazy|
maintext=This user would love to have a nicer wiki page, but is too lazy to design it her or himself.}}
''This is test text immediately following the template.''

produces

This is test text immediately preceding the template.

Chill-pill.jpg New Lazy
This user would love to have a nicer wiki page, but is too lazy to design it her or himself.


This is test text immediately following the template.

And with alignment center

''This is test text immediately preceding the template.''
{{User:Lariat2301/UserTemplate
|align=center
|bordercolor=#008888|headerbackground=#008888|image=Chill-pill.jpg|headertext=Central Lazy|
maintext=This user would love to have a nicer wiki page, but is too lazy to design it her or himself.}}
''This is test text immediately following the template.''

produces

This is test text immediately preceding the template.

Chill-pill.jpg Central Lazy
This user would love to have a nicer wiki page, but is too lazy to design it her or himself.


This is test text immediately following the template.

And with alignment right

''This is test text immediately preceding the template.''
{{User:Lariat2301/UserTemplate
|align=right
|bordercolor=#008888|headerbackground=#008888|image=Chill-pill.jpg|headertext=Right Lazy|
maintext=This user would love to have a nicer wiki page, but is too lazy to design it her or himself.}}
''This is test text immediately following the template.''

produces

This is test text immediately preceding the template.

Chill-pill.jpg Right Lazy
This user would love to have a nicer wiki page, but is too lazy to design it her or himself.


This is test text immediately following the template.


If this breaks usage where the previous template was in use next to, for example, a right-aligned box (such as Suburb or Locationblock template would create), then is there any other way of accomplishing this? Or should I resign myself to creating a parallel UserTemplateFloat or something? --Lariat2301 03:54, 7 August 2009 (BST)

To center
marginleftright=auto|
To right align:
margintopbottom=auto 0|
marginleftright=auto auto|
Okay so the right align is a bit hacky, but that's not my fault. -- User:The Rooster RoosterDragon User talk:The Rooster 04:41, 7 August 2009 (BST)
That's a pretty ugly kluge, but it does have the big advantage of not adding the <br> nonsense. Let's test:
Center...
Chill-pill.jpg Center Original Lazy
This user would love to have a nicer wiki page, but is too lazy to design it her or himself.
and right...
Chill-pill.jpg Right Original Lazy
This user would love to have a nicer wiki page, but is too lazy to design it her or himself.
Yup. Works. Golly gee, Professor RoosterDragon, you're a wonder! --Lariat2301 06:35, 7 August 2009 (BST)