Help talk:Template/Archive 1
Template tip section on my user pageI have noticed that less experienced users might notice that I create a lot of templates for my own use (see User:Will Pittenger/templates for a list). Those users might try to ask for a fix to their template (or for creation of a template they don't know how to start) on my talk page. In an attempt to encourage them to seek the correct locations, I wrote User:Will Pittenger#Tips on working with templates. Does anyone see any changes I should make? I am not attempting to provide a complete tutorial; just explain common mistakes. Will (Talk - contribs) 08:26, 15 February 2007 (UTC)
If-thenI skimmed/searched the article, but couldn't find anything to help me - is it possible to tell a template to look for an inputted value and if the value matches a predefined value, give a specific output? Specifically, I want to make a template (on another wiki) that puts a page in the Build: namespace in one of five (seven?) categories, but they're named quite differently. I was thinking I could make it so that if I say {{Build|Stub}}, the template would show that the page is a stub and add the page to Category:Stubs, whereas if I put in {{Build|New}}, it would add it to Category:New builds. (Note that these would entail different templates combined into one.) The biggest problem would be getting the code to put it in different percentage categories; we want the pages to be categorized by percentage, and the categories will be 0-19%, 20-39%, etc. Can I make it so that if I say {{build|0}} it'll put it in Category:0-19% builds, {{build|20}} in Category:20-39% builds, and so forth? While I have your attention, is it possible for a template to spit out the time it was placed on a page? I've tried messing with ~~~~~, nowiki tags around certain areas of the code (which just disabled the code until it got to an end tag), and {{CURRENTTIME}}, but nothing's helped. Thank you for your help! -- Maethon (talk) 21:39, 10 May 2007 (UTC) Template X2The page transcludes {{X2}} which on m:Help:Template works fine but here it's a sandbox template. Jɪmp 01:33, 28 May 2007 (UTC) UsageIn the section on usage it states "Templates are useful for any text for which one wants a copy in two or more pages, and there is no need for each copy to be edited independently to adapt it to the page it is in." In the recent deletion debate [here http://en.wikipedia.org/wiki/Wikipedia:Templates_for_deletion/Log/2007_August_29#Template:La_Martiniere_Song here] it was noted in particular that "Templates should not masquerade as article content in the main article namespace; instead, place the text directly into the article." I wonder if it might be advisable to change the wording of the usage section here because, in view of this deledtion debate the text as it currently stands is misleading and implies that it is acceptable to use templates for editorial text. Either that or the WP:TMP guideline should be changed. Dahliarose 15:29, 6 September 2007 (UTC)
Simpler, clearer explanations neededHi, I think this Help article is not really of much help to beginners at all. It uses far too much jargon and doesn't explain clearly how to use parameters or special operators such as #if and #switch. Is there another article that does this? If not, would somebody please simplify this article? Cheers, Jacklee 01:34, 19 September 2007 (UTC)
Yes, but those articles are too simple and don't explain the use of functions such as #if and #switch, which I see being used in other templates. What is needed is an article that explains in more detail the workings of templates, but with clearer examples and without the jargon. I am trying to create a template to display a link to an online version of the Singapore Constitution with the syntax "{{Singapore Constitution|full=|rep=}}" (see {{Singapore Constitution}}, which doesn't work properly at the moment). The purpose of the "full" parameter, which is intended to take a "yes" or "no" value, is for users to indicate whether they would like the full title of the Constitution ("Constitution of the Republic of Singapore") or an abbreviated title ("Singapore Constitution") to be displayed. However, I can't determine from this help article how to do so, or whether this can even be done. Cheers, Jacklee 12:18, 19 September 2007 (UTC)
But surely that has everything to do with templates! How do I find out how to use #ifeq instead of #if? What does #ifeq even mean? Is there a full list of operators that begin with # somewhere, with instructions on how they should be used? This underlines my point that there needs to be a clear article somewhere explaining how all this works, otherwise there are just going to be a lot of broken templates out there. Cheers, Jacklee 14:22, 19 September 2007 (UTC)
Oh, right. I didn't even realize those were called parser functions. Thanks. Anyway, I hope you look into my feedback about clarifying and simplifying this article. Cheers, Jacklee 05:28, 20 September 2007 (UTC)
passing a tableI am setting up templates for a wiki we are establishing where i work. We are using the templates because many people will be contributing and we want to keep a consistency throughout the pages. The template is used to establish section headers with data being passed to populate the text under the section. One of the sections contains a table.. when the table is passed to a variable it shows up as simply an opening curly bracket, nothing else in its contents appears. I've found references to double curly brackets being passed but nothing saying that a single would cause problems. Can anyone tell me if it is possible to pass a table as a variable and if so, what i am doing wrong? The code i am using for the template is as follows: ==Section 1 Header== {{{data0|}}} ==Section 2 Header== {{{data1|}}} ==Section 3 Header== {{{data2|}}} ==Section 4 Header== {{{data3|}}} ==Section 5 Header== {{{data4|}}} ==Section 6 Header== {{{data5|}}} ==Section 7 Header== {{{data6|}}} The page that calls the template contains the following: {{Design Review|data6= {| |- |Test |} }}
Ok.. i found the page you are talking about but it appears to reference anther template that, since we are using our own instantiation of a wiki, we don't currently have. i was going to try to build it but when i try to view source... things get really confusing. am i correct in thinking that i need to set up a special template to get the {{!}} to work in place of "|" ? Caile13 15:02, 13 November 2007 (UTC)
Categories and templatesI'm having some trouble with categories and templates. There are some templates on Eurovision pages that automatically categorize any page with the template in a certain category. The problem is that it is the wrong category. How do i add something or change something in these templates to make the pages who have them be in the right category? I also want to add some categorizers to some templates. For example, I want all pages having this template [1] to be in Category:Sweden in the Eurovision Song ContestGrk1011 (talk) 22:32, 19 January 2008 (UTC) Lanlp 1 defunct?Template:Lanlp 1 is given as an example of repitition, and indeed that is the case on meta, but the wikipedia version is just a URL as of October. What's the correct thing to do? jhawkinson (talk) 14:33, 25 January 2008 (UTC)
WPSI Template helpThere is an annoying glitch with the comments section of Template:WPSI. Sorry if I am being dense, but can someone tell me how I can find some technical help with this? Thanks. Ben MacDuiTalk/Walk 12:12, 30 March 2008 (UTC)
Plural if more than one parameterI need a way to change a word in a template to plural if more than one parameter is passed. Does anyone know how I would do this? Any ideas? Kaldari (talk) 19:01, 16 April 2008 (UTC)
Starting a parameter value with an asterisk![]() Whenever I start a parameter value with an asterisk, it is not formatted as a list item. It's not converted at all. Surely there's a way to have lists passed in as parameter values? See here as an example -- Charles (Kznf) (talk) 14:36, 2 May 2008 (UTC)
Problems with the new WikiProject Soviet Union templateIn an effort to improve WikiProject Soviet Union, I have undertaken a task over the past few days to lay the groundwork for an improved project template by adding class= and importance= parameters to the templates on the talk pages of each article in the scope of the project. After this was completed, I attempted to modify the template (using Template:WP conlangs as a guide - the new template is essentially a clone of it - it is also important to note that the WP conlangs template works flawlessly) so it would display the newly-embedded information and sort the tagged articles into categories based on class and importance. While the modified template looked good with both class= and importance= left blank (i.e. the way it appeared in the template page itself, which has now been moved to a sandbox on my user page), all talk pages to which the new template had been attached to appeared strangely deformed, with certain parameters outside the template's space. In general, it was simply messing up the talk page. The sandbox, and the attached doc file, are exact copies of the faulty, new WP Soviet Union template. The template itself has been reverted to its previous state, but its history still contains the faulty version. If anyone can help me in resolving this project or helping me find someone who can help, your assistance would be greatly appreciated. Thanks! TFCforever (talk) 22:51, 3 June 2008 (UTC)
Parameter names should follow CSS standardMost formatting parameters are translated internally into CSS properties. I suggest Help:Template should be edited to:
Most of the examples are unreadableBecause they do not use white=space, line-breaks, indentation and the other visual cues that most development groups insist on. Philcha (talk) 12:51, 24 June 2008 (UTC) Passing parameters through to inner templatesIs it possible for a template "call" to pass parameters through to inner templates? The specific case I have in mind is Template:Annotated image, which contains a variable number of uses of Template:Annotation to insert notes into an image. In this case I'd like "calls" to Template:Annotated image to be able pass default values of formatting parameters to the instances of Template:Annotation - these would be used in all the contained instances of Template:Annotation, except where over-ridden for specific instances. Philcha (talk) 00:28, 26 June 2008 (UTC)
Suppress display of template on doc pagesHow can I suppress the autmotic display of a template at the foot of the doc page? I want to put a few simple exmaples in the doc page and display the results floated alongside. Philcha (talk) 09:06, 1 July 2008 (UTC)
TemplateI was recently told by two different people that, a) there is a limit on the number templates a page may have (including any templates used internally by other templates) and, b) the wiki will stop processing templates if it takes longer than 30 seconds to evaluate them. Which is true, or are both statements accurate? Also, does the 30 second limit apply to a single template or the sum of all templates in a page? Thanks! SharkD (talk) 23:50, 19 July 2008 (UTC)
question about MetaPer the template at the top of this page, edits should be made to the page at Meta. however, the version here differs significantly from the one at meta, so someone has been editing here extensively. is there something I don't know about? :-) --Ludwigs2 22:18, 25 July 2008 (UTC)
Help creating templateI seem to recall there being a place to find a list of users who are good with templates that you can ask for help, but for some reason I can't seem to find it. I'm sure it's there and I'm just missing it. Can anyone point me in the right direction? Or you could just offer to help if you're knowledgeable and available.►Chris NelsonHolla! 02:34, 1 August 2008 (UTC)
Passing parameters by another templateIs there any way to pass parameters from another template? Here's what I'm thinking: {{DoStuff1 {{Values}} }} where Values is: |Var1 = ... |Var2 = ... |Var3 = ... This though, doesn't work multiple reasons:
{{DoStuff1 | {{Values}} }}
I'm trying to get this to work, as I have multiple templates that take the same input parameters. Rather than changing all those templates when a change occurs, I want to just change the Template:Values template... Can anybody help? I looked into subst, which can be a work around, but in the end, I still have to go around all the templates manually every update. Anyone got a clue? happypal (Talk | contribs) 18:34, 3 August 2008 (UTC)
Switches on templates - Please helpHello. I'm a beginning wiki editor, and I have a wikia account which is just starting. I was wondering how to create a template that will categorize a page a particular way when asked. It's Guild Wars related, if you would like yo know. Here's how it breaks down. There is a base template, say {{guild}}. I want it able to be discernible with several different categories. Something like {{Guild|PvX}} will automatically place it in the [[Category:PvX Guilds]]. At basic level, I would like to do so with these:
It would be awesome if I could get subsets of each category too:
My question to you is how should I best do this? Thanks for listening. --67.119.193.93 (talk) 03:44, 7 August 2008 (UTC)
[[Category:{{{1|}}}Guilds]]
[[Category:{{#switch: {{{1|}}}|PvE = PvE|PvP = PvP|PvX = PvX}} Guilds]] While the malfunctioning one is this: [[Category:{{#switch: {{{2|}}}|Recruiting = Recruiting}}{{#switch: {{{1|}}}|PvE = PvE |PvP = PvP |PvX = PvX }} Guilds]] Thanks. --People of Antioch (talk) 21:36, 8 August 2008 (UTC)
Hide/ShowI have a template which defaults to show and i'd like it to default to hide? Operating (talk) 20:51, 2 September 2008 (UTC)
I'm wanting to add a listas parameter to this template, as one does not exist on it at the moment, which makes it more difficult to manage as well as counter to other biography template functions. However, I'm totally clueless about how to edit templates. Help? Thanks! Wildhartlivie (talk) 00:06, 15 September 2008 (UTC)
Template helpHow might I make a template that does both of the following: {{TemplateThatNumbersNames|Joe|John|Mary}} would yield:
while: {{TemplateThatNumbersNames|Joe|John|Mary|Sam|Sandra|Sue|Dave|Marcus Brutus}} would then yield:
Basically, the template forms new rows for each new name, and numbers each new row accordingly. Is a template like this possible to create? Thanks for your help, αЯβιτЯαЯιŁΨθ (talk) 23:06, 29 September 2008 (UTC)
Interwiki linkswhere are the interwiki links? at the begining of the article there are only two (:ro and :es). where are the others? Ark25 (talk) 18:00, 5 October 2008 (UTC) Template HelpHi, i revamped a template recently at Template:TUGS. I used the code from Template:WikiProject Ships and tried my best to make some sense of it by editing out the bits i didn't need and replacing the pictures. But, as you can see from this edit, it didn't quite work out right. Can anyone tell me what went wrong? I should have heeded the esoteric warning...--SteelersFanUK06 ReplyOnMine! 11:56, 13 November 2008 (UTC)
QuestionHello, is there a place I can ask questions about templates? I can't get the User UBC template to work the way i want it to. It works fine for the default case but for the cases with a modifier (like "alum") it changes the colour of the left side of the template... (The problem is demonstrated on the talk page of the template) TastyCakes (talk) 22:52, 13 November 2008 (UTC)
Template usage on UserpagesHi, i've created a template at Template:TUGS-Member, to be placed on a user's userpage if they contribute to the TUGS WikiProject. For some reason, when this is done a message flags up telling me that the page should be moved to the user's talk page. But it shouldn't, that's not what its for. The only option round it is to add parameter "|category=no", but we don't want to do this either as this would remove them from Category:WikiProject TUGS participants - as well as mean that the user would have to add the category parameter on to the template every time it was added by a new user. Some examples of the template flagging up a problem can be seen at User:FelixCheng, User:Rusty5, User:PercytheGreen. What is the problem? --SteelersFanUK06 ReplyOnMine! 17:13, 20 November 2008 (UTC)
redirect to a template with the addition of a parameterHi. I made a new template called template:Infobox EU legislation, which is designed to merge template:EU regulation and template:EU directive. To make this merge come about I need some sort of a redirect from template:EU regulation and template:EU directive to template:Infobox EU legislation, but with the addition of another parameter ("regulation=1" for template:EU regulation and "directive=1" template:EU directive). The addition of the parameter is not a problem, but how do a forward the original parameters of template:EU regulation? I'm currently trying to establish something at template:EU regulation. Maybe some expert can help? Fentener van Vlissingen (talk) 23:11, 1 December 2008 (UTC)
How to make template appear below rather than next to another item on the page?At Vocal pedagogy and Vocal register, how would I make the Voice Type template appear below the first item at the upper right? Whatever404 (talk) 14:58, 8 December 2008 (UTC) Help with infobox publisherI hate to dump this on a talk page, but is there a template wizard who can help me with {{infobox publisher}}? The country of origin parameter isn't showing up even though its filled out. Also, there were originally two documents - infobox publisher and infobox Publisher (capital P), I redirected the latter to the former, but lost some fields in the process (here is the diff and here is the previous version). WLU (t) (c) (rules - simple rules) 22:59, 10 December 2008 (UTC)
Hijacked shipSome help is needed, please, converting {{Hijacked ship}} (whose intricacies are beyond me) to use {{Start date}}, as discussed on its talk page. Andy Mabbett (User:Pigsonthewing); Andy's talk; Andy's edits 14:09, 29 December 2008 (UTC) Various Cher templatesAn editor has made a bit of a mess of templates for Cher songs and I can't quite sort it out. I'm not sure if he originally created Template:Cher songs, but he moved it to Template:Cher songs part 1 and also created Template:Cher songs Part 2. In the process, he also created Template:Cher singles (1965-1982)(navbox), which had errors, so he abandoned it (I've since nominated it for deletion). One of the problems, besides few of the songs in the templates having the template, is that with the templates on the Cher page when one clicks view on either template, it goes through a redirect from Template:Cher songs instead of directly to the correct template. Then today, he decides he wants to change the name of the Template:Cher songs Part 2, so he creates a new template, Template:Cher songs (1987-2009, which had an obvious error, so rather than request a name change/move the page, he created yet another new template, Template:Cher songs (1987-2009). Then he went in to the Cher page and changed the template name. I've nominated the new one with the error for nomination and redirected the second new one to the original Template:Cher songs Part 2. I changed back the template name on the Cher page to the orginal Part 2 template. The problem is, I'm overwhelmed. I don't know enough about all of this to fix the current templates on the Cher page so that one isn't redirected through the old, single template. When all of this is sorted out, I'll put the appropriate template on the song pages. Meanwhile, the editor split the Cher discography page into two separate pages, Cher singles discography and Cher albums discography but didn't changed the links in any of the templates (though I've fixed this). Help!! Wildhartlivie (talk) 05:11, 22 January 2009 (UTC)
So is there someone who can help me sort out the problems the editor left in all the templates so that they don't go back to something else? Please? Wildhartlivie (talk) 02:16, 24 January 2009 (UTC) Page does not help a new userHi. I am a new user. I was browsing through the help pages. I found that the help page starts from 'transculation' or something. For a new user I think it should start from what a template means and how to apply it. Dheerajakula (talk) 18:09, 28 January 2009 (UTC) —Preceding unsigned comment added by Dheerajakula (talk • contribs) 18:07, 28 January 2009 (UTC) Perhaps http://en.wikipedia.org/wiki/Help:A_quick_guide_to_templates would help? Kenpem (talk) 01:03, 4 February 2009 (UTC) When parameters do not expand
Is there any sensible way to work around this? For example: {{Template:Query|Q=rep_StockStatus}} where the template code is: <include nopre noesc src="https://my.domain.com/FetchData?q={{{Q}}}" /> which should expand to: <include nopre noesc src="https://my.domain.com/FetchData?q=rep_StockStatus" /> but does not, the PHP code doesn't get parsed data, it sees https://my.domain.com/FetchData?q={{{Q}}}, which is pretty useless. Kenpem (talk) 01:03, 4 February 2009 (UTC)
<nowiki><include nopre noesc src="https://my.domain.com/FetchData?q=</nowiki>{{{Q}}}<nowiki>" /></nowiki> Jargon cleanupI'm happy to start on this (I'm usually pretty good at cleaning up jargon) but shouldn't this be done on the main mediawiki version? or doesn't that matter? --Ludwigs2 05:21, 24 February 2009 (UTC) @ Patrick - correctionsPatrick, re: this corrections you made - [2]. I'd added that blurb because of this discussion Help:Template#Troubles with noinclude. did I misunderstand? your other corrections have been spot-on, so I probably goofed up here as well; I'd just like to see it more clearly. Help with templates having seemingly erroneous symbols?Not sure how to explain this, but what I can do is point you to, for example, Template:NBA game log section, which shows at the top this: |}
Easy template problemThe template I'm having problems with is Template:PhylomapA. It's pretty straightforward, but I can't figure out why the parameters aren't working. There's a demo at my sandbox. I'm sure it's something silly, but any help is appreciated! a relevant page is the ImageMap explanation at mediawiki. -ΖαππερΝαππερ BabelAlexandria 01:27, 3 March 2009 (UTC)
For [3], it might not be necessary to mention any variations with named parameters, as this section starts out with unnamed parameters. Really minor point though. Congrats to the re-writer of the page. Last time I was looking for something (here or on Mediawiki), I had a really hard time to find anything in the documentation. BTW for version 1.2.6, wasn't it initially thought that, in general, templates were to be substituted? -- User:Docu
WikiMedia => Wikipedia ?Should references to "WikiMedia" be changed to "Wikipedia"? It reads "WikiMedia" as this page was written for/at m:Help:Template. -- User:Docu
help w tableI'd like the last line of the table in {{Infobox Bantu name}} to not appear unless it is filled. I've tried doing this with if: parameters, based on existing templates, but can't get it to work properly. Can anyone help? kwami (talk) 06:10, 25 March 2009 (UTC)
TodoA few suggestions:
I will add more as I think of them. --—— Gadget850 (Ed) talk - 17:11, 30 March 2009 (UTC)
DL Template HelpI am trying to edit this template in order to fix some redirects. Could someone please give me a hand and help explain how I would go about doing that?MusicInTheHouse (talk) 19:18, 18 April 2009 (UTC)
Help with an aspect of making a templateHi, I hope this is in the right place! I recently made a template located here, and was wondering how I could make the three subsections of "Associates" align to the right, so that each sub-list begins un-staggered. I think that I have seen this used on templates before, but I could not find an example to copy when searching for pages I hoped would have complex templates on... Antienne (talk) 02:16, 2 May 2009 (UTC)
Unquoting a parameter valueThe 'lc' and 'uc' functions are very useful for changing case. Is there a simple method for removing quotes from a parameter value? Thanks! Plastikspork (talk) 21:09, 9 May 2009 (UTC) easy oneI'd like to add an optional page parameter to a ref. template, {{SOWL}}. Help:Extension:ParserFunctions does not seem to cover this that I can see, though I'm probably only off by a pipe or two. Can someone take a look? Thanks, kwami (talk) 07:03, 11 May 2009 (UTC)
Searching pages for template usageIs there a way to do a search to see what pages are using a specific template (like Template:Star Trek for example)? Aatrek (talk) 20:33, 11 May 2009 (UTC)
Foreign exchange-rate converterDoes anybody know if one already exists to translate foreign currencies in articles into current USD equiv? I looked around but all I could find is one that just does it for Indian Rupees, and the template to describe FX markets (but not do any calculations). If there is not one for all major currencies, I'd like to take a stab at creating one... but I just don't want to spend a lot of time on it if there is already an established template. I am thinking something like this in an article:
The reason for the word "today" in the conversion results would be to make sure people knew this was not a static number, but may not be necessary if it seems obvious to everyone. I would use public data from the US Fed and update it weekly (hopefully automated at some point). Any/all feedback welcome. Regards, 7 talk | Δ | 04:25, 14 May 2009 (UTC)
(←)Thanks to all for the feedback. I'm not a template programmer but was a geek (clipper, delphi, vc++, vb, sliverstream, etc...) in a prior life, so I will definitely seek support from others to make it a properly-coded reality. The more I think about this the more I think it may make sense to have two templates:
I realize people may say that this should be a single template (since you can accomplish the FX by using todays date in the complicated HCC template) but I've got two reasons why I think they should be separate: first - I think overly complex (# of parms) templates discourage users trying to accomplish simple tasks, and second -it will be a lot easier for me to get my feet wet coding the simple FX one first and it can be used as a base for the second. Will give it a start over the weekend and post in my user space for review / discussion. Thanks again. 7 talk | Δ | 00:57, 15 May 2009 (UTC)
Update: (←)OK - here's a very rough draft. Clearly I'm no template pro, but most of it worked as expected. I haven't yet put the documentation in to a separate "doc" folder - but will do that shortly. Also, no real error checking in here yet (other than defaulted values where possible).
The good news is that I found this existing template:Inflation which can be combined with this simple FX template to make a Historical Conversion Calculator. One thing I couldn't get to work was a sub-template to keep the rates separate from the code. For example, I have an excel macro that will easily pull the rates from the Fed's website and put them into this format: User:7/Template:fx/fxarray, and I was hoping that I could just put this {{User:7/Template:fx/fxarray}} into the middle of the main template code to have it transcluded (is that the right word to use), but it doesn't seem to work. Probably a simple fix. Any feedback or modifications are welcome. Thanks. 7 talk | Δ | 13:34, 16 May 2009 (UTC) I was hoping there would be other comments in the meantime because I didn't want to be the first and last word on this subject. However, I still have some serious misgivings about the underlying concept and I really don't think you should spend any more time on this just yet. Even if such a template is adopted, I believe it needs to used with a great deal of restraint. On Monday, I will write a fuller explanation as to the inherent problems which I hinted at above. Ohconfucius (talk) 13:59, 16 May 2009 (UTC)
Counter-argument as promisedPrices move in relation to each other according to supply and demand - this is the classic definition of how the market mechanism works; the price of different things also vary at different rates through time. This is not to be conflated with link between the general trend of prices (as measured by the Consumer price index) and the money supply. As prices may move differently, it is often appropriate to use different 'inflators' depending on what the subject is. You can see from a quick visit to this website that they give six methods/indices which could be used to calculate, for example, one of Handel's annual pensions (₤200 per annum in 1713) of USD $303 - equates to (at least) $8,342.30 in 2008 using the CPI-based calculation method, but turns out to be (at least) $157,100.91 in today's money using a wage-inflator. Depending on what benchmark is used for the adjustment because rates of inflation (or evolution of cost of living or purchasing power) may differ between countries or between categories of individuals, the 'adjusted value' may differ considerably. The Handel example illustrates my point very well, as the difference here is a factor of 18. It can be seen that we get a very wide ranging result for Handel's pension. Paradoxically, the only index generally used to de/inflate is the retail prices index, which is based on a basket of commodities which reflect the cost of living. Even so, governments have been known to understate this for political reasons. Except in the most broad and general cases, the CPI will never result in the correct figure. There are official data about the cost of building houses, upon which house insurance calculations are generally based; if a reader wants to know the equivalent cost today of building a Dreadnought, or how much in today's money the QE2 cost, we would use a specific index for shipbuilding, instead of using the CPI. Journalists and economists often compare then-to-now costs - we see these in newspapers often enough. Usually, such figures are pretty wild estimates which may vary depending on the hypotheses used. Physical storm damage is a real cost of repair/reinstatement can be measured with some accuracy; others are opportunity costs. It is here where we get differences of several orders of magnitude. I have no problem with comparative valuations as such so long as figures are sourced/attributed. There are people armed with copious data and powerful algorithms who calculate such things for a living, so it's a can of worms for us mere mortals here on WP to decide, except on a very general level, and I don't trust the average WP editor to be able to be able to handle when such a template would be used. It is potentially all too easy to fall foul of WP:NPOV or WP:SYN. That's why I prefer attributed static conversions to such a dynamic solution. Ohconfucius (talk) 03:36, 18 May 2009 (UTC) Template/Switch questionTechnical support question - Separate from the merits of the FX template in the discussion above, can anyone help me understand why this concept won't work for templates within templates. (would still like to understand why it doesn't work even if we decide the template itself is not that useful). Question: For ease of maintaining lookup tables I wanted to have one template which contains the code and another subtemplate which contains the data that I am working with. It works fine when the data and the code are together, but I can't get it to work when the code just opens another template with double curly brackets for the data. Here's an example:
Not sure if this is a template question or a switch question, but I suspect a template guru will figure it out in about 4 seconds. The reason I wanted to do it this way is that I have an excel macro that will easily down and format all the data that I need so that I can store/update it separately here: User:7/Template:fx/fxarray, and I was hoping that I could just put this {{User:7/Template:fx/fxarray}} into the middle of the main template code to have it transcluded (is that the right word to use?), but it doesn't seem to work. Any thoughts on how to fix? Thanks. 7 talk | Δ | 03:31, 18 May 2009 (UTC)
QuestionDo you have the following possibility: including an article on a page, but with only a certain number of characters? --82.171.95.220 (talk) 15:52, 27 May 2009 (UTC)
Is it possible to limit the number of variables that get processed or displayed?The Video games project uses a template ({{VG reviews}}) to display reviews scores given by publications. Though it is not a requirement in articles, it is used in a large number of them. A common problem is that editors tend to include every review score they can get their hands on, basically bloating the table to impractical lengths. My question is if there is a way to limit the number of scores that get displayed? For instance, if an editor inputs 11 or more scores, only the first 10 will show up. I realize that a set amount of numbered parameters could be used, but the current set up works rather well. Mainly because the current parameters properly format publication names and links. Is such a thing possible? (Guyinblack25 talk 20:56, 1 June 2009 (UTC))
Please review my changesAfter these changes, I'd like to ask for review. This page should both give information to those struggling with the very concept of transclusion, and to those seeking the technical details. I'd place myself among those who grasp the basic concept well, but still grapple with the ancient mysteries... So what I've done is try to explain how the parser lists template transclusions for any given Preview (i.e. it does NOT show which actual templates were called from the page/section you actually edited, instead it enumerates EVERY template invocation required to render the preview); how it acts when viewing a page from history (where I'm pretty sure it doesn't seek the historic version of the template and all sub-transclusions thereof) (and this was already alluded to in "Revision history of pages containing templates", way down there where most people would have long stopped reading); and a little discussion of what exactly the performance implications are, and the NewPP report. These have all arisen in the context of the very complex {{convert}} template, which exemplifies almost all of the changes I've made. My request here is for those more knowledgable to evaluate the factual accuracy of my changes; eliminate overlaps with "advanced" template help whilst still preserving links; and possibly creation of a separate section dealing with performance implications and the new pre-processor report in the HTML. Thanks! Franamax (talk) 23:48, 18 July 2009 (UTC) Parameters to show a different textI'm trying to make a template with several different outputs. For example, if you use {{Template | Date}} it will transclude 24 July, 2004, but if you use {{Template | Time}} it will show 13:04 specified by the template. I imagine the template code itself would be something like: | Date = 24 July, 2004 | Time = 13:04 Is there a way to do this? Smurfy 15:07, 19 July 2009 (UTC)
{{#if:{{{date|}}}|{{{date}}}|{{#if:{{{time|}}}|{{{time}}}}}}} If the date parameter is non-blank, then show the date; else show the time if it is non-blank. ---— Gadget850 (Ed) talk 17:56, 19 July 2009 (UTC) Adding text after calculationHow can I add a text, say unit miles, after the result of {{#expr: ( 27 * 46 / pi ) round 2 }} from with in the template? In other words, I want the template to return the word miles too as a part of its result in an article. — [Unsigned comment added by 76.69.90.229 (talk • contribs).]
{{#expr: ( 27 * 46 / pi ) round 2 }} miles
Bar chart templateI would like to create a bar chart similar to this one on the Dutch wiki: http://nl.wikipedia.org/w/index.php?title=FC_Twente&action=edit§ion=23 Can anyone inform me how to proceed with this? Does an equivalent template exist in English (copy & pasting the Dutch one doesn't work)?. Thx. --Wolbo (talk) 15:35, 29 July 2009 (UTC)
Template troubleA group/list template with more than 20 groups (Template:National personifications) won't show the 21st group. If this is a general constraint on group/list templates, what other kind of template could be used instead? RandomCritic (talk) 10:27, 17 August 2009 (UTC)
Problem with if scriptsI'm a user on the Danish version of Uncyclopedia ([4]). 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: [5] 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 conventionsI'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 |