Template talk:DW/Archive 1: Difference between revisions

From Tardis Wiki, the free Doctor Who reference
No edit summary
No edit summary
Line 13: Line 13:
:::: I changed [[Template:Story link/Item]] to link to “… (TV story)”, too, if that page exists. IMHO it is ''much'' cleaner if this distinction is made once and not ten times. Also, adding new suffixes, such as “… (novel)” is much easier. That said, I don't think it's worth arguing about, since I hope those templates don't need any maintenance. —[[User:Effeff|ff]] 12:09, May 31, 2010 (UTC)
:::: I changed [[Template:Story link/Item]] to link to “… (TV story)”, too, if that page exists. IMHO it is ''much'' cleaner if this distinction is made once and not ten times. Also, adding new suffixes, such as “… (novel)” is much easier. That said, I don't think it's worth arguing about, since I hope those templates don't need any maintenance. —[[User:Effeff|ff]] 12:09, May 31, 2010 (UTC)
::You're absolutely right:  my solution is not particularly "readable".  Most people would take one look at it and think, "There's gotta be an easier, or neater, way."  But the thing is, the '''end user''' gets a template that works like they'd expect with an absolute minimum of keystrokes.  And that's why I don't understand why you'd want to update [[:Template:Story link]] and its dependent templates? I'm not getting why someone want to type <nowiki>{{Story link|prefix=TW|1=Everything Changes}}</nowiki> when they can just type <nowiki>{{TW|Everything Changes}}</nowiki>?  I mean, I understand it's good because it's flexible and elegant from a code view, but in terms of the number of keystrokes the user requires to call it, surely it's a lot longer?  I was actually going to put [[:Template:Story link]] up for deletion until I saw you were updating it.  Is there some reason to keep it around that I'm just not seeing?  '''[[User:CzechOut|<span style="background:blue;color:white">Czech</span><span style="background:red;color:white">Out</span>]]'''  [[User talk:CzechOut|☎]] | [[Special:Contributions/CzechOut|<font size="+1">✍</font>]] 00:37, June 1, 2010 (UTC)
::You're absolutely right:  my solution is not particularly "readable".  Most people would take one look at it and think, "There's gotta be an easier, or neater, way."  But the thing is, the '''end user''' gets a template that works like they'd expect with an absolute minimum of keystrokes.  And that's why I don't understand why you'd want to update [[:Template:Story link]] and its dependent templates? I'm not getting why someone want to type <nowiki>{{Story link|prefix=TW|1=Everything Changes}}</nowiki> when they can just type <nowiki>{{TW|Everything Changes}}</nowiki>?  I mean, I understand it's good because it's flexible and elegant from a code view, but in terms of the number of keystrokes the user requires to call it, surely it's a lot longer?  I was actually going to put [[:Template:Story link]] up for deletion until I saw you were updating it.  Is there some reason to keep it around that I'm just not seeing?  '''[[User:CzechOut|<span style="background:blue;color:white">Czech</span><span style="background:red;color:white">Out</span>]]'''  [[User talk:CzechOut|☎]] | [[Special:Contributions/CzechOut|<font size="+1">✍</font>]] 00:37, June 1, 2010 (UTC)
::: I updated it because it used to be the template used by [[Template:DW]] and [[Template:TW]]. The two used to be implemented in a way that could be copy-and-pasted easily and keep all the logic in [[Template:Story link]]. I didn't see that somebody already copied the spaghetti code to the ''TW'' template, so I thought I'd at least do that template some good.
::: I still favor the ''Story-link''-based implementation. For end-users, there is no difference in usage – they use the front-end templates such as ''DW''. For people maintaining or creating new templates, the code is much cleaner and easier to understand. And even with copy-and-paste: handling code that you understand is much better than blindly copying something you don't understand – the code required for the "front-end templates" is really easy to understand. —[[User:Effeff|ff]] 07:31, June 3, 2010 (UTC)

Revision as of 07:31, 3 June 2010

How does this work for those stories that have TV story on the end like Frontios - [[Frontios (TV story)|Frontios]]? --Tangerineduel 07:37, May 24, 2010 (UTC)

Almost had it but it is quite tricky. You would have to use the code {{#if: but I couldn't get it. ☆The Solar Dragon (Talk)☆ 07:52, May 24, 2010 (UTC)
For now, you can use {{DW|Frontios (TV story){{!}}Frontios}}Template:DW. I was thinking about making it possible to add multiple stories in one template, which makes it harder to specify an alternate name in the template. I.e. I'm torn between:
What do you think would be more useful? —ff 07:56, May 24, 2010 (UTC)
I've opted for the second option and made it possible to add up to ten stories. You can still add an alternate text, but you need to use the somewhat hackish exclamation mark template ({{!}}). Please let me know what you think. —ff 08:44, May 24, 2010 (UTC)
  • Example: {{DW|Blink|Frontios (TV story){{!}}Frontios|The Time of Angels|Flesh and Stone}}Template:DW
Working on the disambig problem. Give me a bit of time here. Temporarily might experience problems with this template. CzechOut | 15:43, May 28, 2010 (UTC)
Okay, this problem solved. However, I really don't like template:Story link and so I completely excised it from the code. This is a standalone template. It'll be MUCH harder trying to use a "centralized" template and feeding off that than it would be to just have individualized templates for each prefix. There are two reasons for this. First, and most imporantly, the template really must have the same name as the prefix code as the range itself for people to remember and use it. If I have to remember to type {{Story link|Prefix=BFA|1=The Condemned}}, that's not saving me ANY time. In fact, it's harder. And if I create a
which runs [[:Template:Story link}} within it, then I run the risk of falling foul of an ((#if:)) parser.  Way simpler just to copy and paste the code into new, standalone templates  The second reason is that disambiguation challenge is different on every line.  Comic stories are disambiguated (comic story), audios as (audio story), novels as (novel).  Yes, you could nest all these #if clauses togther into one all -purpose Swiss Army knife, but why?   It's so much simpler just to cut, paste, and make prefix-appropriate changes to the prefix in question.  
Oh, and in case you haven't read the documentation, the solution to the disambig problem was to go with exactly the reverse idea. You don't enter "EpName (TV story)", and lop it off. You type in "Ep Name", then check to see whether it needs to be added on in the background. CzechOut | 18:14, May 28, 2010 (UTC)
I changed Template:Story link/Item to link to “… (TV story)”, too, if that page exists. IMHO it is much cleaner if this distinction is made once and not ten times. Also, adding new suffixes, such as “… (novel)” is much easier. That said, I don't think it's worth arguing about, since I hope those templates don't need any maintenance. —ff 12:09, May 31, 2010 (UTC)
You're absolutely right: my solution is not particularly "readable". Most people would take one look at it and think, "There's gotta be an easier, or neater, way." But the thing is, the end user gets a template that works like they'd expect with an absolute minimum of keystrokes. And that's why I don't understand why you'd want to update Template:Story link and its dependent templates? I'm not getting why someone want to type {{Story link|prefix=TW|1=Everything Changes}} when they can just type {{TW|Everything Changes}}? I mean, I understand it's good because it's flexible and elegant from a code view, but in terms of the number of keystrokes the user requires to call it, surely it's a lot longer? I was actually going to put Template:Story link up for deletion until I saw you were updating it. Is there some reason to keep it around that I'm just not seeing? CzechOut | 00:37, June 1, 2010 (UTC)
I updated it because it used to be the template used by Template:DW and Template:TW. The two used to be implemented in a way that could be copy-and-pasted easily and keep all the logic in Template:Story link. I didn't see that somebody already copied the spaghetti code to the TW template, so I thought I'd at least do that template some good.
I still favor the Story-link-based implementation. For end-users, there is no difference in usage – they use the front-end templates such as DW. For people maintaining or creating new templates, the code is much cleaner and easier to understand. And even with copy-and-paste: handling code that you understand is much better than blindly copying something you don't understand – the code required for the "front-end templates" is really easy to understand. —ff 07:31, June 3, 2010 (UTC)