Template talk:Legend

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Category:Map-related templates[edit]

{{Editprotected}}

Can an admin please categorize this template under this category?:

Done. /Lokal_Profil 16:47, 27 September 2008 (UTC)[reply]
Thanks! --Timeshifter (talk) 03:16, 28 September 2008 (UTC)[reply]

Maplegend[edit]

Template:Maplegend seems to have improved features. I plan to replace {{Legend}} with {{Maplegend}}, then replace all inclusions of Maplegend with Legend and then delete Maplegend. Any objections? --Slomox (talk) 01:17, 24 April 2009 (UTC)[reply]

I will not replace it with {{Maplegend}}, but with an improved version I developed. --Slomox (talk) 15:39, 24 April 2009 (UTC)[reply]
Done. --Slomox (talk) 16:10, 24 April 2009 (UTC)[reply]

Stripes[edit]

I created a striped svg (file:white stripes.svg) for use in this template to make it possible to indicate striped objects on a map. This could be used in the "file=" parameter if the parameter's display size was increased from the 15x15px that it currently is. I was wondering if someone could create a new "stripes" parameter where the image is automatically pulled up, though, as I am unable to figure out how to do that. This would be quite useful for many maps where there are striped entities. If someone wanted to really work on it, they could make it so that both stripe colours are customizable instead of just the one choice with white stripes which this svg allows. Lexicon (talk) 16:33, 20 December 2009 (UTC)[reply]

I added it. I also added three different widths for the stripes. See the examples in the documentation. Making customizable both colors would require files in every possible color. --Slomox (talk) 22:18, 20 December 2009 (UTC)[reply]
Customizable colors are possible with some Unicode, but the results so far are quite ugly:
╱╱╱╱╱╱╱╱
╱╱╱╱╱╱╱╱
╱╱╱╱╱╱╱╱
╱╱╱╱╱╱╱
Perhaps if we find some other Unicode character than ╱ we maybe can produce some better results. --Slomox (talk) 22:58, 20 December 2009 (UTC)[reply]

with White stripes2.svg

䷀䷀䷀ with I Ching U+4DC0

╱╱╱╱╱╱╱╱╱╱ with U+2571

Help[edit]

I am trying to make a hex colored line, but can not figure out the coding to make it work. Please look at User:Admrboltz/test, I want to make selected road be a 2px solid line in that hex color (yes I know its just Red, but other colors will need to be hex format). Any help would be appreciated! --Admrboltz (talk) 22:37, 19 November 2010 (UTC)[reply]

You mean like this?
Roads
 
Selected highway/road
--Slomox (talk) 22:52, 19 November 2010 (UTC)[reply]
Yes, thank you. I was having issues apparently deciphering the documentation. Thanks! --Admrboltz (talk) 22:58, 19 November 2010 (UTC)[reply]

I want the individual borders around the legend items to be transparent. Any way to do this? -- とある白い猫 ちぃ? 10:57, 18 December 2011 (UTC)

I found a solution. This should be an alternate word for border. IE {{{border|{{{outline}}}}}} -- とある白い猫 ちぃ? 10:59, 18 December 2011 (UTC)

Interwiki[edit]

{{Editprotected}}

This template is now connected to Wikidata. Can you remove the interwiki from the main template page? --tacsipacsi (talk) 15:17, 20 March 2014 (UTC)[reply]

✓ Done --Steinsplitter (talk) 22:19, 26 March 2014 (UTC)[reply]

Parameter "width"[edit]

Sometimes it it convenient to alter the width of the legend. This concerns the inner width containing the color and the outer width defining the occupied space.

If some skilled person could add for this purpose "width" parameters. Also a "height" parameter could be useful, at least for the inner height. Many thanks in advance Karlfk (talk) 08:43, 28 August 2014 (UTC)[reply]

An option for arranging several legends in one line instead of "one line, one legend" might also be good. Karlfk (talk) 09:17, 28 August 2014 (UTC)[reply]

Differences with en.wiki template[edit]

Why Mediawiki the 'legend' template is different from the Wikipedia one?

Wouldn't be better if we keep only the wikipedia version?

--Mikima (talk) 12:09, 22 February 2016 (UTC)[reply]

style parameter[edit]

{{Editprotected}} <div style="direction:{{Dir|{{{lang|}}}}}; {{{style|}}}">, please. Necessary to override default style, such as specify style=display:inline-block instead of the HTML default "display:block". Incnis Mrsi (talk) 22:05, 23 February 2018 (UTC)[reply]

✓ Done Sorry it took 5 months. --Majora (talk) 03:27, 5 October 2018 (UTC)[reply]

Stripes with background[edit]

Right now, stripes are in white and have a colored background. An added parameter could allow for stripe colors other than white. I tried myself with black stripes but I realized there needs to be multiple files for each color of stripes. Here is red and black stripes.

Thoughts?Manabimasu (talk) 18:00, 2 July 2020 (UTC)[reply]

This can be achieved using CSS, with fairly good browser support: (note that the vendor-prefixed rules list colors in different order than the standard one to get the same result). —Tacsipacsi (talk) 18:57, 2 July 2020 (UTC)[reply]
@Tacsipacsi: I did not know that. What are your thoughts on adding this to the Legend template?Manabimasu (talk) 16:33, 8 July 2020 (UTC)[reply]

Missing CSS class[edit]

There should be a CSS class for the template.

class="legend

Currently, the workaround is to use this trick in wiki pages when using the template:

{{Legend|#c81|style=" class="legend}}

-- ◄ David L • discuter ► 23:36, 31 January 2022 (UTC)[reply]

Can't see legend key with Media Viewer[edit]

This and other related templates do not display colored boxes (legend key) in Media Viewer, compared to Template:Legend inline, which leads to subpar experience viewing maps with a legend, both viewing from Wikipedia and on MediaWiki. IDK how easy it would be to fix or notice should be added.

can't see legend key
can see legend key

Svito3 (talk) 03:55, 25 March 2024 (UTC)[reply]

I found that last edit changing span to div breaks it. Reason for change is connected to stripes being a div inside span, and divs don't display anyway in Media Viewer. So that last edit should be reverted and stripes implemented as CSS(see (#Stripes with background)) to work inside Media Viewer.

Svito3 (talk) 13:57, 25 March 2024 (UTC)[reply]

Also Template:Legend/sandbox preloads old code for some reason, it has to be manually copied instead. Svito3 (talk) 14:09, 25 March 2024 (UTC)[reply]