Jump to content

Template talk:Pagetype

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
(Redirected from Module talk:Pagetype/config)

Books[edit]

{{editprotected}} This should be updated to account for |class=book. Headbomb {ταλκκοντριβς – WP Physics} 06:15, 11 December 2009 (UTC)[reply]

I'm not exactly sure what the behavior should be. Somewhat important when changing a template that is used 2.7 million times. —TheDJ (talkcontribs) 12:45, 11 December 2009 (UTC)[reply]
I don't think "books" is a proper classification here. Either way, these changes need to be made in a sandbox like Template:pagetype/sandbox to avoid breaking things. --MZMcBride (talk) 18:44, 11 December 2009 (UTC)[reply]

Needed[edit]

Should |class=needed be produce "page" or "article"? — Martin (MSGJ · talk) 07:27, 29 April 2010 (UTC)[reply]

I thought we didn't support Needed-Class anymore. Happymelon 15:24, 29 April 2010 (UTC)[reply]
But what about all the subcategories of Category:Needed-Class articles? — Martin (MSGJ · talk) 16:07, 29 April 2010 (UTC)[reply]
And the subcategories of Current-Class articles, or Merge-Class articles, or any of the other custom classes?? Those classes which we said should be available for projects to use if they wish, but for which we should not bloat banner code for all projects. There are 74 Needed-Class categories, 63 of which are empty. I don't agree that we should make any move to better integrate these niche classes when that disadvantages 1,600 projects for the sake of less than a dozen. Happymelon 21:31, 29 April 2010 (UTC)[reply]
Fair enough. I hadn't noticed that so many of them were empty. — Martin (MSGJ · talk) 10:32, 30 April 2010 (UTC)[reply]

talkspace=yes[edit]

I think a talkspace=yes, similar to subjectspace=yes, would be useful to have as an optional parameter for this template. It should, if on a talk page, return "talk page" and otherwise return the default value. This would be useful for templates like {{Last edited by}} to be more accurate or {{In use}} so we can get rid of the switch function there. --The Evil IP address (talk) 18:08, 6 June 2010 (UTC)[reply]

Sorry I can't understand what you mean. Can you describe the behaviour of the template with this new parameter? — Martin (MSGJ · talk) 18:46, 6 June 2010 (UTC)[reply]
Currently, on a talk page, this template shows the subject namespace, for example on an article talk page, it shows "article", on a template talk page it shows "template", and so on. However, there are situations in which it would be good to return "talk page" instead, for example within {{Last edited by}}. I'd like to add this template to {{Db-meta}} in the next time (which already uses a similar hardcoded function of this template), but since db templates are also used on talk pages, showing "article" or "template" wouldn't make sense there. --The Evil IP address (talk) 13:10, 9 June 2010 (UTC)[reply]
Ah now I understand. I would be open to such an addition if it can be coded cleanly without affecting the performance for the majority of uses (as this is a very widely used template!) Question: could you not just use {{NAMESPACE}} page in your case? — Martin (MSGJ · talk) 15:36, 9 June 2010 (UTC)[reply]
Fixed by using Template:pp-meta/pagetype instead. Prodego talk 23:59, 12 January 2011 (UTC)[reply]

Misleading documentation[edit]

According to the documentation there's a parameter "subjectspace - If set to yes then subjectspace pages will be treated the same as talkspace pages."

Without subjectspace: {{pagetype|page=Category:X1}} and {{pagetype|page=Category talk:X1}} produce "category" and "category".

With subjectspace: {{pagetype|page=Category:X1|subjectspace=yes}} and {{pagetype|page=Category talk:X1|subjectspace=yes}} produce "category" and "category".

There's an unnamed parameter, "class", but that's "optional" and the documentation suggests that it shouldn't affect the result in this case. Is the intention to require page name (which includes namespace) and namespace specified as separate parameters? Peter James (talk) 00:01, 22 September 2013 (UTC)[reply]

I've updated the docs to match what the template does. -- WOSlinker (talk) 00:15, 22 September 2013 (UTC)[reply]
It's still misleading. "This template is used to identify what kind of page it or its subject page is." - but when used with a page name, it returns "Article" for a template and "Template" for a template talk page. Is there something similar to Template:Pp-meta/pagetype (mentioned above) but allowing a parameter for page name? Peter James (talk) 08:02, 22 September 2013 (UTC)[reply]
This template was designed for use by WikiProject banners so it was mainly just tested on talk pages and currently doesn't do very well with non-talk pages. I'll have alook at doing something better in the sandbox soon. -- WOSlinker (talk) 08:33, 22 September 2013 (UTC)[reply]
I found it in use in Template:Edit protected and Template:Edit semi-protected, where parameter is needed because of a change to MediaWiki:Protectedpagetext. I've had to use TALKPAGENAME in those templates, which isn't ideal but produces the correct result (except in the unlikely event of a request for an edit to a redirected talk page). It may produce incorrect results if this template is changed, although it only affects the message and not the template's function. If improving or replacing this template, it may also be possible to use Module:Redirect to determine whether a page is a redirect, although it currently fails where "#REDIRECT:" (instead of just "#REDIRECT" is used. Peter James (talk) 10:12, 22 September 2013 (UTC)[reply]
Right, I've made some changes in the sandbox and now {{pagetype/sandbox|page=Category:X1}} and {{pagetype/sandbox|page=Category talk:X1}} produce "category" and "category". I've also removed the subjectspace option from the sandbox since it's not needed with the changes that I've made. Can you give it a test yourself & if you are happy, we can make it live. -- WOSlinker (talk) 13:30, 22 September 2013 (UTC)[reply]
It's an improvement for pages not in talk or article space, and does what the "output" section of the documentation says, with the exception of "portal" or "project" class in subjectspace - is that needed? Peter James (talk) 15:08, 22 September 2013 (UTC)[reply]
I think that's fine. I've updated the template and the docs. -- WOSlinker (talk) 16:07, 22 September 2013 (UTC)[reply]

Module:Pagetype[edit]

I've created a Lua implementation of this template at Module:Pagetype. It's much more customisable than this template, and can be used to create other pagetype-like templates with different namespace configurations and custom text values. Have a look at the module documentation for details. The default settings are almost the same as this template, with one important difference - redirects are now detected and displayed as "redirect", no matter what namespace they are in. If this is undesirable I can change it, but it won't be easy to change the redirect detection on a per-namespace basis, due to the way the module hooks into Module:Namespace detect. Please have a look at the module, test it a bit, and see if there are any bugs, or anything you would like to change. You might also want to take a look at the test cases (results). If everything is ok, I plan to update {{pagetype}} with this module some time this week. — Mr. Stradivarius ♪ talk ♪ 14:07, 4 November 2013 (UTC)[reply]

Great! I notice that {{db-meta}} uses the following construction several times:
{{talk other|talk page|{{pagetype|subjectspace=yes}}}}
Does your version make this simpler to do? — Martin (MSGJ · talk) 11:23, 7 November 2013 (UTC)[reply]
Seems as though {{#invoke:pagetype|main|talk=y}} would work here as a shorter replacement. -- WOSlinker (talk) 12:00, 7 November 2013 (UTC)[reply]
Yes, that's right - you could also use {{#invoke:pagetype|main|defaultns=all}}, depending on how many namespaces you want to include by default. I also wasn't aware of the |subjectspace= parameter until now, as it was removed with this edit, so adding |subjectspace=yes to the module won't have any effect. — Mr. Stradivarius ♪ talk ♪ 14:13, 7 November 2013 (UTC)[reply]
Ok, I've made the switch to the new module. Let me know if you spot any issues. — Mr. Stradivarius ♪ talk ♪ 07:50, 9 November 2013 (UTC)[reply]

Misleading message about redirect[edit]

 – Jackmcbarn (talk) 19:16, 3 April 2014 (UTC)[reply]

If you put {{Edit protected|MediaWiki talk:Spam-blacklist/log}} on MediaWiki talk:Spam-blacklist, the box begins with "It is requested that an edit be made to the fully protected redirect at MediaWiki talk:Spam-blacklist/log.". Why "redirect", when MediaWiki talk:Spam-blacklist/log isn't? See this permalink. --Redrose64 (talk) 18:54, 3 April 2014 (UTC)[reply]

@Mr. Stradivarius: The issue is that when p._main{page='MediaWiki talk:Spam-blacklist/log'} is called, checkRedirects instead checks to see if MediaWiki:Spam-blacklist/log is a redirect (lines 208-211). I'm not sure what the logic behind doing that that way is. Thoughts? Jackmcbarn (talk) 19:16, 3 April 2014 (UTC)[reply]
Yep, that's a bug in the module. It should use the current page rather than the subject page if talk pages are allowed, but at the moment it only checks args.talk, not args.defaultns. I'll have a think about how best to fix this. (Also, your ping didn't work - not sure why.) — Mr. Stradivarius ♪ talk ♪ 04:12, 4 April 2014 (UTC)[reply]
Now fixed. I also uncovered a nasty bug that was introduced by the recent changes to Module:Namespace detect - this module was trying to use the # operator with the mappings table, which didn't work after it was switched to load using mw.loadData. I also split out the config data to Module:Pagetype/config, loaded using mw.loadData. And I made some beautification fixes too. — Mr. Stradivarius ♪ talk ♪ 06:01, 4 April 2014 (UTC)[reply]
I didn't get a ping either. It might be because it was a page creation? --Redrose64 (talk) 10:18, 4 April 2014 (UTC)[reply]
@Mr. Stradivarius: Broken in the opposite way now. [1] says talk page instead of module. Jackmcbarn (talk) 16:05, 5 April 2014 (UTC)[reply]
Bleh. That was a bug I introduced to Module:Namespace detect this morning trying to fix an unrelated issue. That's now fixed as well. And with that, I think I shall call it a night. If you notice other similar problems, purging should fix it. — Mr. Stradivarius ♪ talk ♪ 17:13, 5 April 2014 (UTC)[reply]

Drafts[edit]

I don't think this module identifies pages in the draft namespace. Please could this be added? — Martin (MSGJ · talk) 11:40, 3 October 2014 (UTC)[reply]

You could either use {{pagetype|draft=true}} or you could edit the cfg.defaultNamespaces section of Module:Pagetype/config. -- WOSlinker (talk) 11:56, 3 October 2014 (UTC)[reply]
@MSGJ: Drafts are detected fine - they are one of the extended namespaces. See Module:Pagetype#Default namespace sets for a quick look at what is in what set. And if you think drafts should be in the default set instead of just the extended set, we can make the change in the module config, as WOSlinker said. (We should probably get consensus for that first, though.) — Mr. Stradivarius ♪ talk ♪ 13:13, 3 October 2014 (UTC)[reply]
Yes well, perhaps "draft" should be in that set. Also I'm surprised that "file" is not there. — Martin (MSGJ · talk) 13:51, 3 October 2014 (UTC)[reply]
Hmm I see "file" is there, but not in the "media" row so I'm a bit confused by that. — Martin (MSGJ · talk) 13:53, 3 October 2014 (UTC)[reply]
@MSGJ: That's because when you click a link to a media namespace page, you're not going to a wiki page, but you're viewing the file directly. For example: Media:Example.svg. — Mr. Stradivarius ♪ talk ♪ 14:00, 3 October 2014 (UTC)[reply]
Interesting, I didn't know that! In the meantime I've used |draft=yes on Template:Importance mask so it works as intended. Cheers all — Martin (MSGJ · talk) 11:29, 4 October 2014 (UTC)[reply]

Protected edit request on 28 September 2015[edit]

Add the Gadget and Gadget definition namespaces and make the page type the same name, but with a lowercase "G". GeoffreyT2000 (talk) 02:50, 28 September 2015 (UTC)[reply]

DoneMr. Stradivarius ♪ talk ♪ 03:41, 28 September 2015 (UTC)[reply]

Set index articles[edit]

@Mr. Stradivarius: Is there any way for the module to distinguish between disambiguation pages and set index articles? PC78 (talk) 00:06, 5 July 2016 (UTC)[reply]

I asked about disambiguation pages somewhere before and was told that it is impossible ;( — Martin (MSGJ · talk) 11:28, 12 July 2016 (UTC)[reply]
@PC78: see Module talk:Redirect#Query — Martin (MSGJ · talk) 11:32, 12 July 2016 (UTC)[reply]
Hmm. The doc refers to disambiguation pages at Module:Pagetype/doc#Main namespace classes. Does this not do what I think it does? PC78 (talk) 17:02, 12 July 2016 (UTC)[reply]
You have to tell the module that it is a disambiguation page using the class parameter. It won't detect it automatically, which I think it what you were asking about. — Martin (MSGJ · talk) 19:25, 12 July 2016 (UTC)[reply]
Ah-ha. How does the Metadata gadget do it then, is that not something that can be applied to a template? PC78 (talk) 06:49, 13 July 2016 (UTC)[reply]
The gadget also uses the class rating from the article's talk page, I believe! — Martin (MSGJ · talk) 09:36, 20 April 2023 (UTC)[reply]

Detecting disambiguation pages[edit]

Would it be possible to detect disambiguation pages from this module? Disambiguation pages have the page property "disambiguation". Can you retrieve page properties from Lua modules? Kaldari (talk) 20:44, 31 October 2016 (UTC)[reply]

Please see Module talk:Redirect#Query! — Martin (MSGJ · talk) 20:54, 31 October 2016 (UTC)[reply]
Thanks for the pointer. After looking at the Phab ticket and the Scribunto code, I think I actually know how this could be implemented. Kaldari (talk) 21:19, 31 October 2016 (UTC)[reply]

cross project calls[edit]

Should this work across wikiprojects? For example

  • {{#invoke:pagetype|main|page=Frankfurt}} gives: article
  • {{#invoke:pagetype|main|page=Wikipedia:Frankfurt}} gives: page
  • {{#invoke:pagetype|main|page=Wikivoyage:Frankfurt}} gives: page
  • {{#invoke:pagetype|main|page=Voy:Frankfurt}} gives: page
  • {{#invoke:pagetype|main|page=Frankfurt/Main}} gives: redirect
  • {{#invoke:pagetype|main|page=Wikipedia:Frankfurt/Main}} gives: page
  • {{#invoke:pagetype|main|page=W:Frankfurt/Main}} gives: redirect
  • {{#invoke:pagetype|main|page=Wikipedia:Frankfurt/Main123}} gives: page
  • {{#invoke:pagetype|main|page=Wikivoyage:Frankfurt/Main}} gives: page
  • {{#invoke:pagetype|main|page=FRA}} gives: page
  • {{#invoke:pagetype|main|page=Wikipedia:FRA}} gives: redirect
  • {{#invoke:pagetype|main|page=W:FRA}} gives: page
  • {{#invoke:pagetype|main|page=Wikivoyage:FRA}} gives: page
  • {{#invoke:pagetype|main|page=Voy:FRA}} gives: page

Does not appear to be giving correct results, or am I misunderstanding the syntax? --Traveler100 (talk) 12:21, 15 February 2018 (UTC)[reply]

I don't believe this is possible and/or desirable — Martin (MSGJ · talk) 09:46, 20 April 2023 (UTC)[reply]

Plurals[edit]

Following a request at Wikipedia talk:Short description #Category fix needed, which complained that the {{Short description}} naively pluralises 'category' as 'categories