Template talk:context/archive

Definition from Wiktionary, the free dictionary
Jump to: navigation, search

Preserved from Template talk:cattag/equate[edit]

I would really like to see some documentation for this complicated template. Usage notes, examples, etc. It seems to have residual bugs (i.e. templates that use this are stuffed into the respective category at "T" instead of "*".) --Connel MacKenzie 21:15, 13 November 2006 (UTC)

As for documentation, it's provided at the BASEPAGENAME i.e. cattag, or rather should be if the above isn't sufficient. DAVilla 01:06, 6 December 2006 (UTC)

Preserved from Template talk:tag[edit]

Is it okay to redirect this page to cattag? Does this page have any other uses? Davilla 09:59, 8 June 2006 (UTC)

No idea. Does cattag provide only categories for the right entries? And merely a tag for the others? If so, then yes, a redirect is appropriate I guess. — Vildricianus 21:27, 8 June 2006 (UTC)
There has been objection to categorizing only with existing categories, so that should probably be settled first. DAVilla 19:46, 21 July 2006 (UTC)
What links here is much smaller now, so no problems with redirecting. In the future this should be the home for cattag, the redirect working the other way.DAVilla 15:04, 1 September 2006 (UTC)
Now redirected to {{context}}. Should probably be deprecated though, since it is only three letters long, and could be a name collision. DAVilla 06:43, 31 December 2006 (UTC)
The code tag is used for the w:Tagoi language, which is a Kordofanian language, closely related to Tegali, spoken near the town of Rashad in southern Kordofan in Sudan. Not likely to be a problem, but there it is. --EncycloPetey 07:09, 31 December 2006 (UTC)

Preserved from Template talk:cattag[edit]


I'm not sure what the discussion back in June was, but I do think that the parenthesis are better presented in italics. This is particularly the case when the last letter of the item is a lower case "l". The non-italicized right parenthesis hits the last letter. Specific examples include anything that uses the "fb" (American football) template. Example words include safety and cornerback. Also, it seems like the parenthesis "belong" to the thing that they enclose and should inherit the enclosed item's properties, just as the size and strength of a box is determined by the needs for protection of the item inside. Brholden 20:59, 16 August 2005 (UTC)

Links in-line?[edit]

Now that this template allows up to nine (9) category tags, should we consider wikilinking the relevant categories in-line? For example: {{cattag|religion}} I think should transclude this: ''[[Category:Religion|Religion]]:'' [[:Category:Religion]] which would in turn render this: Religion: Category:Religion. Shall I be bold? --Connel MacKenzie T C 22:19, 15 May 2006 (UTC)


Speaking of being bold, I removed the parenthesis in favor of the trailing colon (which was not technically feasible in earlier iterations.) --Connel MacKenzie T C 22:20, 15 May 2006 (UTC)

Context template[edit]

I didn't realize {{cattag}} existed when I embarked on {{context}}. Perhaps we should discuss the features of the two templates to avoid duplicating effort. There are some features I'm still working on, but it appears the main difference is the ability to associate multiple categories with a single context. Let me know if {{cattag}} has (or will have) a similar feature. Rod (A. Smith) 00:30, 16 May 2006 (UTC)

Now that I've looked at {{context}}, I think I understand what you want. However, the approach you took there will create an endless stream of "Context-" templates.
For extra categories, I think adding a "morecats" parameter might work, e.g. {{cattag|US|criminal law|morecats=[[Category:Law]]}}. This looses the invisible category addition of your method, but makes editing the entry a bit more transparent. OTOH, using your method forces the second mandatory category, especially for people editing entries who don't know it is supposed to be in both.
How many "Context-" type templates have you done so far? Hrm, Look at pages starting with Template:Context.. Not too bad.
I suppose this template could check {{exists}} (glom from Wikipedia) for additional "Context-" templates, but they'd have to be changed to only contain additional categories for that context, is they were to be included. Something like {{exists|Template:Context-{{{1}}}|{{Context-{{{1}}}}}}}{{exists|Template:Context-{{{2}}}... tacked onto the end here. Seems pretty server-abusive though.
Tough call, all around, I think. --Connel MacKenzie T C 04:27, 16 May 2006 (UTC)
The set of resulting Context-* templates were my attempt to solve multiple problems, a Category:*Topics browsing problem mentioned in WT:BP and others addresed by {{cattag}}. As you see, the topic browsing aspect introduces extra overhead of Context-* templates to allow multiple fixed topic categories per tag.
I think now, though, that we should revisit the topic browsing problem prompting the multiple-category aspect of the {{context}} solution. Perhaps it's a red herring.
To facilitate browsing for words using Category:*Topics , {{context}} puts context tags like "criminal law" into multiple categories (e.g. both Category:Law and Category:Criminal law).
If there were another way to list all terms in a branch of Category:*Topics (i.e. all terms in category and all terms in the subcategories), it would suffice to associate just one topic category with each context marker, and the {{cattag}} system would be the clear winner. Is it possible to include a category? Rod (A. Smith) 06:00, 16 May 2006 (UTC)
If you put [[Category:Law]] on the page Category:Criminal law, the latter becomes a sub-category of the former. I know of no way to have the parent category list the entries in sub categories as if they were also in the parent category. I had the same problem with Category:Abbreviations, Acronyms and Initialisms, where some people would like to see only a sub-category, while most people want to see all abbreviations (no matter what the sub-type) on one logical list.
What did you think of my server-abusive suggestion above? Server abuse aside, that seems to be the best of both worlds, no? --Connel MacKenzie T C 06:31, 16 May 2006 (UTC)
The "server abusive" suggestion, now that I have re-read it, seems great. I hadn't understood before, but the point is that most contexts have a single tag and a single category, so they don't need a Context-* template, right? Rod (A. Smith) 14:37, 16 May 2006 (UTC)


I've included the magical {{italbrac}} here. That's after all its purpose, right? As a result, I also removed the ucfirst for the first parameter. —Vildricianus 20:53, 25 May 2006 (UTC)

Alternative formats will be assimilated. Resistance is futile. :-) No, really, I like it. Thanks! There is a an odd extra space before the closing parenthesis, though. See "abdominal" and "brown" for examples. Rod (A. Smith) 21:37, 25 May 2006 (UTC)
Sorry, don't care; I don't have parentheses. :-) Fixed. —Vildricianus 21:46, 25 May 2006 (UTC)
Looks great! ((Even with parentheses visible.:)) Rod (A. Smith) 22:03, 25 May 2006 (UTC)

Expanding parameters[edit]

I've tested and implemented a crazy scheme that uses the existence of label templates to determine if a parameter should be expanded. Now documenting. Davilla 16:39, 7 June 2006 (UTC)

Well, I agree it is crazy. I've rolled back {{idiom}} as it was rather broken. --Connel MacKenzie T C 01:24, 8 June 2006 (UTC)
Sorry, I just wasn't paying attention when I changed it. Because of the s, I should have left the category there. Now redirected to {{idiomatic}} as per the new scheme, with the category included. See kick the bucket for an example of why all this craziness is beneficial. Davilla 08:55, 8 June 2006 (UTC)
The categorization isn't working so well. See for instance {{science}}. I'm going to revise cattag/equate to take an optional argument when the category name differs.
I also want to know if you want the labels linked. I don't understand why some of the templates arbitrarily do that and some don't. Davilla 09:20, 8 June 2006 (UTC)

I don't understand what "/equate" is supposed to mean, in your terminology. Again, I find this over-complication of things that mostly worked in the past, a little disconcerting. --Connel MacKenzie T C 01:19, 24 June 2006 (UTC)

Wait a second (misc. comments)[edit]

  • This is a very old template, that at times has seen varying use. The radical changes it has recently undergone have had some time to resolve themselves, but they have not.
  • I don't know how to encourage Rod to do further experiments, and provide constructive criticism at the same time...but I'll try. Each small improvement has great potential, but now that templates are getting a life of their own, backward compatability is more and more of an issue. (Can you guarantee which version of a template is used, say, when looking at older revisions of an entry?)
  • In theory, I like the idea of unit-test code. In practice, it has a horrific affect on every edited page...two screenfuls of "templates used on this page."
  • {{tag}} is the one to just tag an entry. If "cattag" is called, it means 1) Add the category to the entry, 2) tag the line. If the category doesn't yet exist, it needs to appear in red at the bottom - so a new category can be started. Not ELIMINATED if this is the first entry in a category.

I would really like to see a lot more discussion about template changes before they happen. Being bold is cool when you are not affecting main namespace entries. But once a template is used in any main namespace entry, we should probably think about them differently.

--Connel MacKenzie T C 16:26, 24 June 2006 (UTC)

Hasn't this all been said before in Tricky templates I & II ? I thought I had addressed exactly these points.
On topic: the issue is what to use for a mixture of both. Say you need to display (transitive, chemistry) for some kind of verb, do you use {{tag|transitive|chemistry}} or {{cattag|transitive|chemistry}}? I think that's what Davilla is trying to solve, but it indeed poses the problem you mention. Perhaps the parameter checking should be the other way round than how it's working now (I guess). — Vildricianus 16:34, 24 June 2006 (UTC)

I haven't yet make any edits to {{cattag}}, but the above looks like a suggestion to add unit-tests with a plea not to overflow the "templates used on this page". Note that unit tests are clients of templates but no template should ever include any unit tests. So, creating unit tests should not affect the "templates used on this page". If you see otherwise, please let me know about it. Rod (A. Smith) 17:33, 24 June 2006 (UTC)

How soon will we have string functions? This template will be completely overhauled when string functions are available. Davilla 14:23, 26 June 2006 (UTC)

I wish I knew, but I haven't read anything to suggest that they're on their way. Rod (A. Smith) 04:21, 27 June 2006 (UTC)
I think Brion is waiting for a vote, stemming from a BP coversation (plus, he tends to be busy.) I am unclear on what is being requested, myself. Could someone please start a WT:VOTE for it?
Could someone please explain the "cattag/equate" syntax above? The explanation above doesn't make much sense. --Connel MacKenzie 18:34, 19 October 2006 (UTC)
You mean the technical side of it? Basically to make the substitution when there are redirects, e.g. math to mathematics, {{cattag}} from an entry has to make calls to each of its parameters if those label templates exist. So the label templates should output the internals without parentheses. However, calling the label template by itself should generate the parentheses. To do this the label templates call {{cattag}} (indirectly as it works out). But then cattag needs to know who's calling it, an entry or a label template. That's why label templates are required to use a different call, {{cattag/equate}}, to distinguish them. DAVilla 01:33, 6 December 2006 (UTC)
Wait a minute. When I invoke
what are foo and bar? Are they
1. tag names,
2. category names,
3. tag names and maybe also category names, or
4. template names??
I was assuming 3, but if the answer is 4, that throws a whole new light on the questions I was just asking in the Grease Pit... —scs 01:47, 6 December 2006 (UTC)

From discussion of previous major version[edit]

substituting lang in templates[edit]

In label templates, don't you want the parameter to be ...|lang={{{lang|}}}|...? Seems to me an undefined {{{lang}}} would tend to show up unwanted? Robert Ullmann 14:15, 12 December 2006 (UTC)

It shouldn't really matter because all cases are caught by context. lang={{{lang}}} works fine... let me check yours too. If you wanted to be absolutely correct about it though the substitution to make is lang={{{lang|en}}}. But wouldn't you say it's already difficult enough to use as it is, without having to worry about such details? DAVilla 16:52, 12 December 2006 (UTC)
Actually it's preferable the way it is. I want to make sure that the label templates are set up correctly, and error-checking for lang={{{lang}}} is possible because the code itself is passed, whereas with your suggestion lang={{{lang|}}} is impossible to distinguish from the not improbable lang=. DAVilla 22:08, 13 December 2006 (UTC)
Shouldn't cattag pass lang through? --Connel MacKenzie 16:56, 2 January 2007 (UTC)
The above only concerns the outcome on the template page itself, when it is not included and there are, hence, no parameters. This template does pass lang= through, and because the template cattag is a redirect to context, it behaves equivalently. Similarly for the context subtemplates. Although the old {{cattag/equate}} could not, its use has been completely overridden. DAVilla 23:32, 13 February 2007 (UTC)

What does the "@" do?[edit]

It reminds me of the M "indirection" operator. Its function seems to be similar? --Connel MacKenzie 16:57, 2 January 2007 (UTC)

You mean @check1 /2 in context/checklabel? It's just a unique name, a carry-over from cattag, which can be removed once cattag is put out of service. I carried the practice over from the infamous foreach from meta, but then decided it wasn't really unique. For instance you might wonder what's so unique about #default. Nothing. Nonethelss it can't be detected as a value by the built in parser function #switch. Yes, what a beautiful language. DAVilla 17:19, 2 January 2007 (UTC)

Sorry for being dense, but...[edit]

...why does the template name have to match the tag name again? I understand that it should by why does it suddently have to? --Connel MacKenzie 17:54, 13 January 2007 (UTC)

This isn't too sudden; it was the same with {{cattag/equate}}. The reason is that there may be several abbreviations for a template name, but there should be only one centralized placed for the template, to make sure that the categories etc. are handled in an orderly manner. In other words, there should be exactly one template for each physical label. Of course, other templates may redirect for convenience, but the obvious choice for a centralized name is the full label itself.
The effect of this policy is that the set-up of these templates is somewhat particular, but essentially that's because it takes a little bit of work to keep the templates organized. It has no effect on the use of context within entries because redirects equate any abbreviations. DAVilla 23:18, 13 February 2007 (UTC)

Grammatical tags[edit]

As I just pointed out at User Talk:Williamsayers79, a lot of grammar templates like Template:transitive, Template:intransitive, and Template:uncountable use this template. Based on the current documentation, that's really inappropriate since these are not context tags at all but grammar tags. This could be an issue for people who write 3rd party software that uses Wiktionary, there's a big difference being a word being "intransitive" and a word being "UK slang".  :-) Language Lover 18:17, 10 April 2007 (UTC)

I'm rewriting context as we speak, and I've already made a distinction between a modifier such as "usually" or "mainly" and the labels themselves. I could very easily add another class. I've also added the ability to label a word without categorizing the page at all, as one might want to do in the synonyms section, so this would allow new names like {{label}} for basic calls. I wasn't honestly thinking of scrapping "context" the way I had "cattag" though. Do transitivity and countability need to be separated out of {{context}} calls, or does the template need a more general name? DAVilla 22:21, 10 April 2007 (UTC)
Well, I'm a little over my head, I was just pointing out the incongruency in case it was unnoticed. :) You're doing a great job overall, you're definitely the go-to person for template work (loved your help on Template:comparative of, btw). It's really a non-issue for casual wiktionary users who wouldn't even realize what's going on behind that "(uncountable)" tag they see. I'm sure you will know best what to do, or whether to just ignore it and count those grammar tags as context. :-) Language Lover 02:06, 11 April 2007 (UTC)

.*Topics template for other than English language words[edit]

I added the Norwegian idiom syden and I wanted to have it included in both the Category:no:Idioms and Category:no:Tourism. I'd also like to have nice parenthesized keywords in italic before the definition, i.e. (idiomatic)(tourism). For English words this is easy, one simply uses the templates {{idiomatic}} and {{tourism}}. From the documentation here I figured I might try and apply the following code: {{idomatic|tourism|lang=no}}, but that did not place the word in the two mentioned categories. I notice that the code for {{astronomy}} which does seem to work as I intend, is simpler than for the idiomatic/tourism templates (actually, I created the second one using the code from the first one). Can someone point to the solution here? __meco 15:38, 7 May 2007 (UTC)

Yes. See the page now. DAVilla 15:42, 7 May 2007 (UTC)
Much appreciated, however it seems like I should have been able to figure this one out myself with just a teensy bit more effort (an all too familiar situation I keep finding myself in when it comes to technical difficulties). __meco 20:40, 7 May 2007 (UTC)

Problem with multiple tags and categorization[edit]

I was going to add {{context|plurale tantum|euphemism}} to unmentionables, however, the template doesn't seem to properly categorize into both Category:English pluralia tantum and Category:Euphemisms. My quick-fix solution was to use the two templates {{plurale tantum}} and {{euphemism}} separately. __meco 10:41, 30 June 2007 (UTC)

I've adjusted {{plurale tantum}} to use {{context/tag}} so that it can be recognized by {{context}} and now this should work. However, I'm not sure if "English" in the category name is appropriate. DAVilla 17:45, 30 June 2007 (UTC)