Template talk:Stars/old

From Wikipedia, the free encyclopedia

Contents

[edit] TfD nomination of Template:Stars

Template:Stars has been nominated for deletion. You are invited to comment on the discussion at Wikipedia:Templates for deletion#Template:Stars. Thank you.

[edit] Documentation

[edit] Purpose

To display 5 star ratings within the professional reviews section of Album infobox, and ensure that the alt-text is supplied.

[edit] Usage

Code Result
{{Stars|0}} Image:Star0.svg
{{Stars|0.5}} Image:Star0.5.svg
{{Stars|1}} Image:Star1.svg
{{Stars|1.5}} Image:Star1.5.svg
{{Stars|2}} Image:Star2.svg
{{Stars|2.5}} Image:Star2.5.svg
{{Stars|3}} Image:Star3.svg
{{Stars|3.5}} Image:Star3.5.svg
{{Stars|4}} Image:Star4.svg
{{Stars|4.5}} Image:Star4.5.svg
{{Stars|5}} Image:Star5.svg
{{Stars}}
(no parameter)

[edit] Discussion

Wouldn't the alt text read better as "X out of 5 stars" rather than the current "X stars out of 5"? Or am I just being pedantic? Slicing 00:22, 9 December 2005 (UTC)

Possibly, it's just that to me the one that sounds wrong is "X out of 5 stars". It seems odd to have to wait until the last word to assign a context for the first. I mean, consider the previous sentence, if I'd said "It seems odd to have to wait until the last to assign a context for the first word", that would be clearly wrong. It's more or less the same principle. "X out of 5 stars" just about gets away with it because it's so short, but I don't think it's necessarily the more correct form. Having said that, though, Google does support "out of 5 stars" as being more popular than "stars out of 5", so if you really want to change it... - Lee (talk) 17:07, 9 December 2005 (UTC)
Great work. Jkelly 19:12, 9 December 2005 (UTC)

[edit] Subst

I strongly suggest suggesting that this be subst-ed. It's a waste of resources if it isn't. gren グレン 13:12, 17 December 2005 (UTC)

This is the code that will be generated if this is subst-ed:

2 stars out of 5

(See source). I recommend against using subst with this template. - Lee (talk) 13:21, 17 December 2005 (UTC)
Wow, you're completely right. I have a biggg problem with this template as a whole then. Simply, it's a waste of resources. We need a bot to add the proper alt text to articles... but, we don't need switches needlessly taking up resources. Also, from an efficiency perspective wouldn't it be better to start with 5 as the first switch since it is more likely to be used than a 0. gren グレン 16:17, 20 December 2005 (UTC)
here is the code:
[[Image:{{switch
          |{{{1|}}}
          |case: 0.5=0hv
          |case: 1.5=1hv
          |case: 2.5=2hv
          |case: 3.5=3hv
          |case: 4.5=4hv
          |default={{{1|5}}}
        }}of5.png|{{{1|5}}} star{{switch
                                  |{{{1|5}}}
                                  |case: 1=
                                  |default=s
                                }} out of 5]]

Dread Lord CyberSkull ✎☠ 06:50, 21 December 2005 (UTC)

[edit] Switch-less version

My intention was to upload new images with transparent interiors and use a surrounding span tag to determine the color of the stars. This is the code (without any switches):

<span style="background:{{{color|orange}}}">[[Image:Transparent{{{1|5}}}of5.png|{{{1|5}}} out of 5 stars]]</span>

(The orange is an arbitrary choice, here). I've uploaded Image:Transparent3.5of5.png as an example,

  • {{Stars|3.5}} would generate
    • 3.5 out of 5 stars
  • {{Stars|3.5|color=#FC0FC0}} would generate
    • 3.5 out of 5 stars

Not only would this remove the switches, it gives greater control of the appearance of the stars, and significantly reduces the image file size (235 bytes compared to 1479 bytes for Image:3hv out of 5.png). - Lee (talk) 12:43, 21 December 2005 (UTC)

This displays correctly on IE, but not in Opera (8.5) - there are large bands in the background color above and below the image. I don't have Firefox installed to check. —Cryptic (talk) 15:05, 21 December 2005 (UTC)
Looks good in Firefox. —Ilmari Karonen (talk) 15:26, 21 December 2005 (UTC)
Breaks in Konqueror, though. Setting line-height: 10px; helps some, but not enough. —Ilmari Karonen (talk) 16:10, 21 December 2005 (UTC)

While the bugs with the transparent images are being worked out, as a temporary measure I have made the template switch-less using the current images. I have also moved the deletion notice back to the talk page to further reduce server load. —Ilmari Karonen (talk) 15:58, 21 December 2005 (UTC)

[edit] Alternative markup, please test

The following markup works in Firefox (1.0.4) and Konqueror (3.3.2). Could users of other browsers please comment?

  • {{Stars|3.5}}:
    3.5 out of 5 stars
  • {{Stars|3.5|color=#FC0FC0}}:
    3.5 out of 5 stars

Yes, it's a horrible brute force kluge. But does it work? —Ilmari Karonen (talk) 18:58, 21 December 2005 (UTC)

Nope. Bands visible in both IE and Opera (8.51), also IE doesn't display it inline. The following works in Opera and Firefox (1.5), but only displays the top half of the image in IE, and is still not inline:
  • {{Stars|3.5}}:
    3.5 out of 5 stars
  • {{Stars|3.5|color=#FC0FC0}}:
    3.5 out of 5 stars
and Konqueror? - Lee (talk) 02:03, 22 December 2005 (UTC)

[edit] TFD notice

Please don't remove the TFD notice, it allows people who may be interested in voting for/against this template a chance to know it's even been nominated. If there's some concern with server load, it may be possible to subst it. —Locke Cole 15:56, 21 December 2005 (UTC)

[edit] Experimental alternatives

I've drawn some single stars in SVG and set up some experimental templates for combining them. Right now I have two solutions on display at User:Ilmari Karonen/sandbox#Stars. Both solutions allow X out of Y stars, where 0 ≤ X ≤ Y ≤ 10, with X adjustable in steps of 0.25. The second one is more flexible, in that it allows the size of the stars to be adjusted, but involves an internal subtemplate. Both solutions put the alt. text (either custom or autogenerated) on the first star.

A difficulty I've bumped into, in trying to make the ultimate star template, is that it seems impossible to get all of the following features at the same time:

  1. Adjustable maximum star count.
  2. Adjustable image size.
  3. No subtemplates.
  4. No multiple main templates.

Any three out of four are easy, but I can't quite get them all together. The solutions I'm currently testing fail points 2 and 3 respectively. Yet another solution would be to ignore point 4 and create multiple templates named {{starsY}}, where Y is the maximum number of stars. That feels like an ugly hack, though. —Ilmari Karonen (talk)

I did come up with a trick that accomplishes all the goals above. It's a horrible abuse of HTML, CSS and wiki markup, but it seems to work. The results look like this:


*
**
***
****
*****

*
**
***
****

*
**
***

*
**

*
Image:Star.5.svg

Whaddaya think, folks? —Ilmari Karonen (talk) 21:54, 22 December 2005 (UTC)

It looks really good, but the markup is really difficult. Is there a way to simplify the markup? Nooby god 03:19, 25 December 2005 (UTC)
Hmm? For 3 out of 5 stars, you'd write {{starsx|*|*|*| | }}. For 2.5 out of 5 you need {{starsx|*|*|.5| | }}. (Of course, the name of the template is currently {{User:Ilmari Karonen/sandbox/starsx}}, not {{starsx}}, but that will change before it's actually put into use.) —Ilmari Karonen (talk) 10:21, 25 December 2005 (UTC)

[edit] Bot

Ahh! The bot has removed the image whilst removing the template. Let's try to put back the image... the issue was the template and the switch... not the image. Oh well... gren グレン 01:25, 27 December 2005 (UTC)

My read on the TFD vote was that the template was not desired and the same went for the images, which were created for this template. -- Netoholic @ 02:47, 27 December 2005 (UTC)
The images were not created for this template, they were already widely used in album articles (and still are) before this template was created. I see no consensus at Wikipedia:WikiProject Albums or Template:Album infobox that star images should not be used with the infobox. I see no consensus or even discussion at the TfD that suggests the images themselves should be obliterated altogether (the votes talking about "server strain" clearly refer to WP:AUM). I did see a user correctly noting that "Nobody's saying we should delete Album infobox. Or even get rid of the reviews section. Or even the images of stars. Just the template that, very inefficiently, puts the images there."—jiy (talk) 14:35, 2 January 2006 (UTC)