Template talk:NYCS
From Wikipedia, the free encyclopedia
Contents |
[edit] Proposal to merge NYCS* templates
There is a plethora of templates for the NYCS. Should thest be merged into a single/few ones by use of m:parser functions?
See Category:WikiProject New York City Subway for a list. --Swift 22:20, 18 August 2006 (UTC)
[edit] Simple numbers and characters
For many, this will suffice:
{{ #switch: {{{1}}} | AA = [[A (New York City Subway service)|{{{1}}}]] | BB = [[B (New York City Subway service)|{{{1}}}]] | CC = [[C (New York City Subway service)|{{{1}}}]] | DD = [[D (New York City Subway service)|{{{1}}}]] | EE = [[E (New York City Subway service)|{{{1}}}]] | FF = [[F (New York City Subway service)|{{{1}}}]] | GG = [[G (New York City Subway service)|{{{1}}}]] | HH = [[H (New York City Subway service)|{{{1}}}]] | JJ = [[J (New York City Subway service)|{{{1}}}]] | KK = [[K (New York City Subway service)|{{{1}}}]] | MJ = [[M (New York City Subway service)|{{{1}}}]] | MM = [[M (New York City Subway service)|{{{1}}}]] | NX = [[N (New York City Subway service)|{{{1}}}]] | QB = [[Q (New York City Subway service)|{{{1}}}]] | QJ = [[J (New York City Subway service)|{{{1}}}]] | QT = [[Q (New York City Subway service)|{{{1}}}]] | RR = [[R (New York City Subway service)|{{{1}}}]] | TT = [[T (New York City Subway service)|{{{1}}}]] | Z = [[J-Z (New York City Subway service)|{{{1}}}]] | [[{{{1}}} (New York City Subway service)|{{{1}}}]] }}
Unfortunately, I don't think we can simplify this any more (but then again, this makes the template very easy to edit). --Swift 22:46, 18 August 2006 (UTC)
Sounds good; go for it! Once you've confirmed that it's working give me a newline-delimited list of all of the {{NYCS ***}} templates that can be replaced with this new {{NYCS|***}} syntax and I'll have Cydebot go through and adjust everything. --Cyde Weys 20:44, 20 August 2006 (UTC)
- I'd prefer we centralize this discussion on the TfD page, given that no concrete decision has been made to any effect, and Cydebot is not approved to perform this edit. alphaChimp laudare 21:37, 20 August 2006 (UTC)
- The TFD is about deleting a single template, that A template. This is about generalizing all of the templates. Centralizing this discussion at that TFD is illogical. And if bot approval worked the way you seem to think it does I'd have to go get bot approval everytime I plugged in another regex to make some fix. --Cyde Weys 21:42, 20 August 2006 (UTC)
- Or, before you started replacing any templates. You do have approval for that, don't you? alphaChimp laudare 21:47, 20 August 2006 (UTC)
- The TFD is about deleting a single template, that A template. This is about generalizing all of the templates. Centralizing this discussion at that TFD is illogical. And if bot approval worked the way you seem to think it does I'd have to go get bot approval everytime I plugged in another regex to make some fix. --Cyde Weys 21:42, 20 August 2006 (UTC)
Sigh ... so are we ready for these changes or not? Bot approval is irrelevant ... what's relevant is whether we have consensus on this or am I going to get my head bitten off again? --Cyde Weys 01:29, 22 August 2006 (UTC)
[edit] Recursion
I think the best (or at least better) implementation of this template would be if it used recursion. I'm trying it now, but I'm having problems with it, and I'm still learning the template language. Tinlinkin 07:12, 22 August 2006 (UTC)
- I found from Help:Template that "If a template calls itself directly or indirectly, inclusion works only on one level for each template." So I created Template:NYCS basic to redirect to Template:NYCS and "recursive" calls that way work. I will reprogram NYCS basic to the original version of Template:NYCS to make it truly "basic": it doesn't include the switch calls. Tinlinkin 07:59, 22 August 2006 (UTC)
- On the other hand, copying the template code from the individual templates is the easiest thing to do and it gets the job done. But once all templates have been merged into Template:NYCS, then Template:NYCS basic can replace all the links that are supposed to be recursively called (the X (New York City Subway service)). Tinlinkin 08:50, 22 August 2006 (UTC)
[edit] Meta-templates
The term for templates inside templates in MediaWiki software seems to be meta-templates. I've been meaning to go through the information on Wikipedia:Transclusion costs and benefits and the pages linked to in its See also section to get a better view on this.
From what I've read about and been told, so far, the practice isn't so good. There may be cases where it is benefitial, but in our case, I think they might not. I'm even thinking that the {{NYCS time}} should be removed. The reason is that if we have 20 templates on a page, that is an extra 20 calls to the database. If each of these has a meta-template, that makes the calls 40. If each has two, it's 60!
Finding the best solution isn't going to be easy (we may end up settling for individual templates for each line) but let's try and see what we can come up with. To that end, we should also discuss what the purpose of these templates is. For that discussion, please go to Wikipedia talk:WikiProject New York City Subway. In this section, however, I propose we discuss whether meta-templates are justified in {{NYCS}}. --Swift 17:59, 22 August 2006 (UTC)
- For what it's worth, the problem of templates isn't nearly as bad as you seem to think of it. You should probably speak to Brion if you're concerned, but basically, our database is small enough that all of the most-accessed stuff (including templates) is kept in cache. The current site bottleneck is with the webservers, not the backend db. The performance impact of templates is truly negligible, so don't worry about that. If you can do something with a meta-template that is better for the end-user, do it. --Cyde Weys 13:22, 24 August 2006 (UTC)
-
- Hmmm ... I didn't find myself to have a very hostile attitude towards meta-templates. No-one brought up anything against them, so I did. I find it useful in discussions to have as many bits of information as possible.
- Your point is good though, and Brion VIBBER has pointed out that meta-templates aren't too bad if they are kept simple. --Swift 18:23, 24 August 2006 (UTC)
[edit] Overhead
With this template, if one service is changed, every subway page including a link to any service is invalidated and has to be regenerated. Is this worth it? There really hasn't been much discussion on the switch. – flamurai (t) 02:15, 6 November 2006 (UTC)