Help talk:Template

From Wikipedia, the free encyclopedia
Jump to: navigation, search
the Wikipedia Help Project (Rated C-class, High-importance)
WikiProject icon This page is within the scope of the Wikipedia Help Project, a collaborative effort to improve Wikipedia's help documentation for readers and contributors. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks. To browse help related resources see the Help Menu or Help Directory. Or ask for help on your talk page and a volunteer will visit you there.
C-Class article C  This page does not require a rating on the project's quality scale.
 High  This page has been rated as High-importance on the project's importance scale.
 
WikiProject Templates
WikiProject icon This page is within the scope of WikiProject Templates, a group dedicated to improving the maintenance of Wikipedia's templates. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
 

‹The template Has feedback page is being considered for deletion.› 

Problem with if scripts[edit]

I'm a user on the Danish version of Uncyclopedia ([1]). I've been trying to get this template to work in a few days, but somehow it just won't do as I want. It's meant to create a table with two rows and a picture to the right. In the upper row, there is going to be security marks for a product, while the lower row is going to have up to four columns with product descriptions.

The problem lies in the upper row, as the lower row already works. Se the result here: [2]

Here's the script (most of it is in English; only security mark descriptions are in Danish). You should look at the script of this page, as Wiki puts everything into one line here:

{| border="1" class="metadata" style="width:100%; background-color:rgb(255,102,0)" | {{ #ifeq: {{{picton|0}}} | 0 | colspan="2" | }} style="align:center;" | {{ #if: {{{1mark|}}} | {| | [[billede:{{ #switch: {{{1mark|}}} | ætsende | miljøfarlig | lokalirriterende | giftig | eksplosiv | brandnærende | brandfarlig = {{{1mark|}}}.gif | #default = {{{1mark|}}} }}]] |- ! <big>{{{1head|}}}</big> |- | {{{1text|}}} |} | }} {{ #if: {{{2mark}}} | {| | [[billede:{{ #switch: {{{2mark|}}} | ætsende | miljøfarlig | lokalirriterende | giftig | eksplosiv | brandnærende | brandfarlig = {{{2mark|}}}.gif | #default = {{{2mark|}}} }}]] |- ! <big>{{{2head|}}}</big> |- | {{{2text|}}} |} | }} {{ #if: {{{3mark}}} | {| | [[billede:{{ #switch: {{{3mark|}}} | ætsende | miljøfarlig | lokalirriterende | giftig | eksplosiv | brandnærende | brandfarlig = {{{3mark|}}}.gif | #default = {{{3mark|}}} }}]] |- ! <big>{{{3head|}}}</big> |- | {{{3text|}}} |} | }} {{ #if: {{{4mark}}} | {| | [[billede:{{ #switch: {{{4mark|}}} | ætsende | miljøfarlig | lokalirriterende | giftig | eksplosiv | brandnærende | brandfarlig = {{{4mark|}}}.gif | #default = {{{4mark|}}} }}]] |- ! <big>{{{4head|}}}</big> |- | {{{4text|}}} |} | }} {{ #if: {{{5mark}}} | {| | [[billede:{{ #switch: {{{5mark|}}} | ætsende | miljøfarlig | lokalirriterende | giftig | eksplosiv | brandnærende | brandfarlig = {{{5mark|}}}.gif | #default = {{{5mark|}}} }}]] |- ! <big>{{{5head|}}}</big> |- | {{{5text|}}} |} | }} {{ #if: {{{6mark}}} | {| | [[billede:{{ #switch: {{{6mark|}}} | ætsende | miljøfarlig | lokalirriterende | giftig | eksplosiv | brandnærende | brandfarlig = {{{6mark|}}}.gif | #default = {{{6mark|}}} }}]] |- ! <big>{{{6head|}}}</big> |- | {{{6text|}}} |} | }} {{ #if: {{{7mark}}} | {| | [[billede:{{ #switch: {{{7mark|}}} | ætsende | miljøfarlig | lokalirriterende | giftig | eksplosiv | brandnærende | brandfarlig = {{{7mark|}}}.gif | #default = {{{7mark|}}} }}]] |- ! <big>{{{7head|}}}</big> |- | {{{7text|}}} |} | }} {{ #if: {{{8mark}}} | {| | [[billede:{{ #switch: {{{8mark|}}} | ætsende | miljøfarlig | lokalirriterende | giftig | eksplosiv | brandnærende | brandfarlig = {{{8mark|}}}.gif | #default = {{{8mark|}}} }}]] |- ! <big>{{{8head|}}}</big> |- | {{{8text|}}} |}|}} | {{ #ifeq: {{{picton|0}}} | 1 | rowspan="2" width="{{{pictwidth|}}}" }} | {{ #ifeq: {{{picton|0}}} | 1 | [[billede:{{{pictaddr|}}}|{{{pictwidth|}}}]] }} |- | {{ #ifeq: {{{picton|0}}} | 0 | colspan="2" }} | {{ #ifexpr: {{{cols|1}}} >= 1 |<div style="width: {{ #expr: 100 /{{{cols|1}}} }}%; float: left;">{{{1col|}}}</div>}} {{ #ifexpr: {{{cols|1}}} >= 2 |<div style="width: {{ #expr: 100 /{{{cols|1}}} }}%; float: left;">{{{2col|}}}</div>}} {{ #ifexpr: {{{cols|1}}} >= 3 |<div style="width: {{ #expr: 100 /{{{cols|1}}} }}%; float: left;">{{{3col|}}}</div>}} {{ #ifexpr: {{{cols|1}}} >= 4 |<div style="width: {{ #expr: 100 /{{{cols|1}}} }}%; float: left;">{{{4col|}}}</div>}} |} — Preceding unsigned comment added by 90.185.27.224 (talk) 18:00, 16 November 2008

Template naming conventions[edit]

I've suggested standardizing template naming, at Wikipedia talk:Template namespace#Template naming conventions. If you're frustrated with typing template names and constantly guessing at the right capitalization and spacing, please chime in. Michael Z. 2009-01-10 17:46 z

{{Identity}}[edit]

template:Identity, a utility template for template safety, is up for deletion -- 70.51.202.113 (talk) 05:29, 1 September 2015 (UTC)

Trying to make a Mars time template in my sandbox...[edit]

Link is here, with all info: User:MSJapan/Marstime.

Short version: I was asked for help to make a template to do a running clock for articles on Mars. Mars actually has timezones, but the offset from UTC is not a round number. Therefore, the end result should be from the now template, but adjusted for UTC - 2:02:21, and a different timezone listing. I therefore figured I had to adjust the currenttime template to address that, but it's not playing nicely with fractional offset. Can someone help? MSJapan (talk) 00:44, 4 September 2015 (UTC)

Error in the NIE template[edit]

The following mistake results in a widely propagated inaccuracy to an out-of-copyright citation at Wikipedia.If it can be fixed, the correction will propagate widely, and result in improved information accuracy in the encyclopedia.

The template:

Wikisource-logo.svg This article incorporates text from a publication now in the public domainGilman, D. C.; Thurston, H. T.; Colby, F. M., eds. (1905). "article name needed". New International Encyclopedia (1st ed.). New York: Dodd, Mead. 

should reflect the fact that the editors of this first edition were: Daniel Coit Gilman, Harry Thurston Peck, and Frank Moore Colby (see Template:New_International_Encyclopedia).

Instead, it presents the the third editor as "F. Moore" (presenting the middle name, omitting the surname).

Please, indicate here how this might be fixed (or, if easily done, execute the correction yourselves)? Cheers. Le Prof Leprof 7272 (talk) 16:18, 12 September 2015 (UTC)

@Leprof 7272: Have you taken this up at Template talk:NIE? --Redrose64 (talk) 20:20, 12 September 2015 (UTC)

Constructing a URL from template parameters[edit]

Following a change to a government web site, the Template:cite QPN needs to be updated. The main problem relates to the new URL format to be constructed from the two main parameters, a place name and a reference number. My current version in the Template:Cite QPN/sandbox works fine if the place name involved is a single word e.g. "Kenmore", but if it's a multiple word place name like "Kenmore Hills", it doesn't work. The URL I correctly generate for Kenmore is:

https://www.dnrm.qld.gov.au/qld/environment/land/place-names/search#/search=Kenmore&types=0&place=Kenmore41505

but for Kenmore Hills I need it to be:

https://www.dnrm.qld.gov.au/qld/environment/land/place-names/search#/search=Kenmore%20Hills&types=0&place=Kenmore_Hills48322

That is, in one place, I must replace the space between Kenmore and Hills with a %20 and in the other place with an underscore. How do I do that? (Note some place names might have 3 or more words separated by spaces).

I have tried using urlencode and replace but could not get them to work for me (I have never used them before). Thanks for any advice anyone can offer? Kerry (talk) 02:36, 13 September 2015 (UTC)

@Kerry Raymond: urlencode has a couple of options that you could try; see Help:Magic words#Paths - {{urlencode:Kenmore Hills|PATH}} -> Kenmore%20Hills and {{urlencode:Kenmore Hills|WIKI}} -> Kenmore_Hills. -- John of Reading (talk) 04:18, 13 September 2015 (UTC)

Onlyinclude in nowiki[edit]

On mw:Transclusion, it says Note that unlike <noinclude> and <includeonly>, <onlyinclude> will take precedence over enclosing <nowiki> tags. In other words, <nowiki><onlyinclude>My content</onlyinclude></nowiki> produces only "My content" when transcluded.. However, in fact this is not true – onlyinclude tags within nowiki tags are treated like any other text inside nowiki tags. GeoffreyT2000 (talk) 18:45, 29 September 2015 (UTC)

The quote from mw:Transclusion is about transclusion behaviour and is correct. Transclusion of User:PrimeHunter/sandbox3 produces:
My content
"Before" and "After" are not transcluded so <onlyinclude>...</onlyinclude> works inside <nowiki>...</nowiki>. On the page itself it's treated like other tags but not when it's transcluded. PrimeHunter (talk) 19:59, 29 September 2015 (UTC)

Bug introduced Thursday Nov 12 - Please fix immediately[edit]

I don't know where to post this: several different Infobox templatea don't render correctly for an hour. Sections in the article do not float the infobox anymore, and as a result, the layout is disrupted (white area between lead/TOC and following sections). {{Infobox settlement}} {{Infobox planet}}. This is only notable when the lead is short. Example e.g. Eastern Finland Province. This bug should affect thousands of articles, mostly stubs. Thx for reposting this notice to a more appropriate location so it can reach the "culprit" Rfassbind – talk 18:18, 12 November 2015 (UTC)

User:Rfassbind, see this thread. Frietjes (talk) 18:22, 12 November 2015 (UTC)

Is this the best place to ask for Wikimedia contributor assistance regarding templates?[edit]

Can someone suggest a better place to ask for help using and developing templates? Blue Rasberry (talk) 20:04, 30 November 2015 (UTC)

There is Wikipedia talk:WikiProject Templates, but I don't think this is a bad place to ask. WP:VPT is a good place to ask as well. — Mr. Stradivarius ♪ talk ♪ 02:08, 1 December 2015 (UTC)

Template redesign - want to make horizontal infobox[edit]

Wikipedians know that standard infoboxes are horizontal. I am working with this experimental infobox - {{Medical condition classification and resources}}. Here is a nice instance of it:

{{Medical condition classification and resources 
 | DiseasesDB      = 29031
 | ICD10           = {{ICD10|M|10||m|05}}
 | ICD9            = {{ICD9|274.00}} {{ICD9|274.1}} {{ICD9|274.8}} {{ICD9|274.9}}
 | ICDO            =
 | OMIM            = 138900
 | OMIM_mult       = {{OMIM2|300323}}
 | MedlinePlus     = 000422
 | eMedicineSubj   = emerg
 | eMedicineTopic  = 221
 | eMedicine_mult  = {{eMedicine2|med|924}} {{eMedicine2|med|1112}} {{eMedicine2|oph|506}} {{eMedicine2|orthoped|124}} {{eMedicine2|radio|313}}
 | MeshID          = D006073
}}

Here is how that renders -

Classification
External resources

I would like to use code as seen above to produce a horizontal version of the infobox. Here is a mockup (archived as version 1) -

The base template here, {{Medical condition classification and resources}}, is actually from {{infobox}}. I am not sure there is such a thing as a "horizontal infobox", but for example, {{Authority control}} seems to do this for example with Template:Authority_control#Examples. The idea for this horizontal version came from the Authority control box, and I want to copy that.

Does anyone know how I can make a horizontal infobox that looks like my mockup but which can be filled in with the code I present above? Blue Rasberry (talk) 20:14, 30 November 2015 (UTC)

@Bluerasberry: I've had a go at adding parameters to your mockup User:Bluerasberry/Medical condition classification and resources - horizontal test-2. You didn't say how you wanted the Patient UK parameter to be named, so I've left that out for now. — Mr. Stradivarius ♪ talk ♪ 23:44, 30 November 2015 (UTC)
Mr. Stradivarius You are more insightful and perceptive about templates than I am. I hardly know what I am doing when I manipulate them but now I see - yes, all of these have some relationship between the field and value, except for Patient UK which has an external link for its value. No, I do not know how the Patient UK parameter should be named. I need to think more about that. Blue Rasberry (talk) 22:01, 3 December 2015 (UTC)
I made different templates for the different versions. Here is how your change looks.
Thanks so much. Let me look... Blue Rasberry (talk) 17:10, 1 December 2015 (UTC)
{{User:Bluerasberry/Medical condition classification and resources - horizontal test-2
 | DiseasesDB      = 29031
 | ICD10           = {{ICD10|M|10||m|05}}
 | ICD9            = {{ICD9|274.00}} {{ICD9|274.1}} {{ICD9|274.8}} {{ICD9|274.9}}
 | ICDO            =
 | OMIM            = 138900
 | OMIM_mult       = {{OMIM2|300323}}
 | MedlinePlus     = 000422
 | eMedicineSubj   = emerg
 | eMedicineTopic  = 221
 | eMedicine_mult  = {{eMedicine2|med|924}} {{eMedicine2|med|1112}} {{eMedicine2|oph|506}} {{eMedicine2|orthoped|124}} {{eMedicine2|radio|313}}
 | MeshID          = D006073
||
}}

generates

Hmmm... Blue Rasberry (talk) 17:21, 1 December 2015 (UTC)

@Bluerasberry: So what do you want the Patient UK parameter to look like? |PatientUK=? |patient_uk=? Let me know and I'll add that as well. Also, do all of the links do what you expect? — Mr. Stradivarius ♪ talk ♪ 22:42, 1 December 2015 (UTC)
@Mr. Stradivarius: Thanks for helping me with this. Maybe you saw that I used it and mentioned you at Template_talk:Infobox_medical_condition#Another_reform_proposal_-_split_infobox_into_.22human_readable.22_and_.22non_human_readable.22_and_call_from_Wikidata. Already something has changed - I found {{Medical condition classification and resources}} and now I am reconsidering what you did. I would rather have these links in Wikidata and pull them from there rather just keep them locally on English Wikipedia. Some of these links and classification systems are already available in other languages. I would like to pause development of this template for now pending comment at "infobox medical condition" and the possibility of putting this information in Wikidata, then calling it back to English Wikipedia from there. Thanks a lot - I have hardly worked with templates and it is interesting to finally see how one works. Blue Rasberry (talk) 23:26, 1 December 2015 (UTC)
@Bluerasberry: How about using both local parameters and Wikidata? The template can be set up so that it uses the local parameter if it is available, and if it isn't, it uses data from Wikidata. And if there is no data on Wikidata for the link in question and no local parameter is specified, that link can be made not to display. — Mr. Stradivarius ♪ talk ♪ 05:37, 2 December 2015 (UTC)
Mr. Stradivarius I hardly know what is possible or easy but yes, setting these up to take a local parameter would give the option of a local override and be ideal. Without a local parameter, pulling data from Wikidata is best. I do not know where to begin with this. I checked - it seems that these and lots of other values are already in gout (Q133087).
Does that mean that these can already be connected to a template and called from Wikidata, to render the same output but not based on local input? Blue Rasberry (talk) 22:01, 3 December 2015 (UTC)
@Bluerasberry: That's right. You can get the data with, e.g., {{#property:p604|from=Q133087}}, or if you're on the Gout page already, just {{#property:p604}}. This produces "000422". Most of the properties produce multiple values, though (for example, {{#property:p493|from=Q133087}} produces "274.00, 274.0, 274, 274.9"), so we would need to use Lua in some way to format them properly. — Mr. Stradivarius ♪ talk ♪ 04:28, 4 December 2015 (UTC)

Template talk:Hdl#Error message[edit]

Could someone please take a look at the above error? Thanks. DrKay (talk) 16:19, 9 December 2015 (UTC)