Last week I was working on a feature that I didn't want to surface on a disambiguation page. I was surprised to find there was no way I could distinguish between a normal article and a disambiguation page. The disambiguation pages have no clearly marked templates I can use and they are in the same namespace as normal articles.
Does anyone have a suggestion for how I might do this?
Jon
On Mon, 24 Dec 2012 11:00:36 +0100, Jon Robson jdlrobson@gmail.com wrote:
Last week I was working on a feature that I didn't want to surface on a disambiguation page. I was surprised to find there was no way I could distinguish between a normal article and a disambiguation page. The disambiguation pages have no clearly marked templates I can use and they are in the same namespace as normal articles.
What about [[MediaWiki:Disambiguationspage]]?
see https://bugzilla.wikimedia.org/show_bug.cgi?id=43210
On Mon, Dec 24, 2012 at 5:12 AM, Matma Rex matma.rex@gmail.com wrote:
On Mon, 24 Dec 2012 11:00:36 +0100, Jon Robson jdlrobson@gmail.com wrote:
Last week I was working on a feature that I didn't want to surface on a disambiguation page. I was surprised to find there was no way I could distinguish between a normal article and a disambiguation page. The disambiguation pages have no clearly marked templates I can use and they are in the same namespace as normal articles.
What about [[MediaWiki:Disambiguationspage]]?
-- Matma Rex
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
I hadn't thought of using categories but that may indeed work for en.wiki :) thanks! On 24 Dec 2012 11:43, "John" phoenixoverride@gmail.com wrote:
see https://bugzilla.wikimedia.org/show_bug.cgi?id=43210
On Mon, Dec 24, 2012 at 5:12 AM, Matma Rex matma.rex@gmail.com wrote:
On Mon, 24 Dec 2012 11:00:36 +0100, Jon Robson jdlrobson@gmail.com
wrote:
Last week I was working on a feature that I didn't want to surface on a disambiguation page. I was surprised to find there was no way I could distinguish between a normal article and a disambiguation page. The disambiguation pages have no clearly marked templates I can use and they are in the same namespace as normal articles.
What about [[MediaWiki:Disambiguationspage]]?
-- Matma Rex
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Ok I explored this however this solution is not perfect as it requires you know the name of the disambiguation category for a given language. I want this code to run on fr.wiki, en.wiki and all other wikis....
Any other ideas?
On Mon, Dec 24, 2012 at 12:06 PM, Jon Robson jdlrobson@gmail.com wrote:
I hadn't thought of using categories but that may indeed work for en.wiki :) thanks!
On 24 Dec 2012 11:43, "John" phoenixoverride@gmail.com wrote:
see https://bugzilla.wikimedia.org/show_bug.cgi?id=43210
On Mon, Dec 24, 2012 at 5:12 AM, Matma Rex matma.rex@gmail.com wrote:
On Mon, 24 Dec 2012 11:00:36 +0100, Jon Robson jdlrobson@gmail.com wrote:
Last week I was working on a feature that I didn't want to surface on a disambiguation page. I was surprised to find there was no way I could distinguish between a normal article and a disambiguation page. The disambiguation pages have no clearly marked templates I can use and they are in the same namespace as normal articles.
What about [[MediaWiki:Disambiguationspage]]?
-- Matma Rex
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Check the MediaWiki:Disambiguationspage language message - it exists for all languages. It lists all the templates that mark Disambig pages.
(https://fr.wikipedia.org/wiki/MediaWiki:Disambiguationspage for the french wikipedia, https://en.wikipedia.org/wiki/MediaWiki:Disambiguationspage for english). I'm sure there are easy ways to check if a page is Disambig in PHP - not sure about JS.
I am actually trying to do this in javascript in the lightest way possible.
There is no way that I can to get from outputted html to the Template it came from in Javascript.
Ideally I'd like to see something like class="template" data-template="TemplateName" on all outputted templates to solve this problem.
See https://gerrit.wikimedia.org/r/#/c/40314/ for background.
On Mon, Dec 24, 2012 at 2:33 PM, Yuvi Panda yuvipanda@gmail.com wrote:
Check the MediaWiki:Disambiguationspage language message - it exists for all languages. It lists all the templates that mark Disambig pages.
(https://fr.wikipedia.org/wiki/MediaWiki:Disambiguationspage for the french wikipedia, https://en.wikipedia.org/wiki/MediaWiki:Disambiguationspage for english). I'm sure there are easy ways to check if a page is Disambig in PHP - not sure about JS. _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Perhaps this helps something if you are familiar with javascript:
http://de.wikipedia.org/wiki/MediaWiki:Gadget-bkl-check.js
We in huwiki use an adopted version of this script to display links to disambpages with a different colour.
You could always have a magic word that disables the features, and let the users put it in the relevant templates. Then the users could disable it on all the pages they feel it would be inappropriate for.
--bawolff
On Mon, Dec 24, 2012 at 2:34 PM, Bináris wikiposta@gmail.com wrote:
Perhaps this helps something if you are familiar with javascript:
http://de.wikipedia.org/wiki/MediaWiki:Gadget-bkl-check.js
We in huwiki use an adopted version of this script to display links to disambpages with a different colour.
-- Bináris _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
I implemented a fix for bug 6754 here: https://gerrit.wikimedia.org/r/#/c/40343/
It's a simple 2 line change to core that adds a 'disambiguation' page property to any page that includes '__DISAMBIG__'. I was originally considering implementing this as an extension, but it seems like a feature that would be generally useful to lots of wikis and is a much lighter-weight solution than a full-blown extension.
The reason I used a doubleunderscore magic word is because they don't have to output anything and they automatically set a page property. In other words, they were invented for exactly this sort of purpose.
Ryan Kaldari
On 12/24/12 1:48 PM, bawolff wrote:
You could always have a magic word that disables the features, and let the users put it in the relevant templates. Then the users could disable it on all the pages they feel it would be inappropriate for.
--bawolff
On Mon, Dec 24, 2012 at 2:34 PM, Bináris wikiposta@gmail.com wrote:
Perhaps this helps something if you are familiar with javascript:
http://de.wikipedia.org/wiki/MediaWiki:Gadget-bkl-check.js
We in huwiki use an adopted version of this script to display links to disambpages with a different colour.
-- Bináris _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
I am not sure I understand you perfectly. Does "includes" mean that the magic word has to be in disambiguation template? I hope so as these pages are marked with templates and it wouldn't be a great idea to put the magis in the pages themselves.
Other: will this magic word have localised versions as the others? Or how can we localize it? (Huwiki uses mostly localized magic words.)
Is this change subject to the next version upgrade? When?
2012/12/25 Ryan Kaldari rkaldari@wikimedia.org
I implemented a fix for bug 6754 here: https://gerrit.wikimedia.org/**r/#/c/40343/https://gerrit.wikimedia.org/r/#/c/40343/
It's a simple 2 line change to core that adds a 'disambiguation' page property to any page that includes '__DISAMBIG__'. I was originally considering implementing this as an extension, but it seems like a feature that would be generally useful to lots of wikis and is a much lighter-weight solution than a full-blown extension.
The reason I used a doubleunderscore magic word is because they don't have to output anything and they automatically set a page property. In other words, they were invented for exactly this sort of purpose.
Ryan Kaldari
On 12/24/12 1:48 PM, bawolff wrote:
You could always have a magic word that disables the features, and let the users put it in the relevant templates. Then the users could disable it on all the pages they feel it would be inappropriate for.
--bawolff
On Mon, Dec 24, 2012 at 2:34 PM, Bináris wikiposta@gmail.com wrote:
Perhaps this helps something if you are familiar with javascript:
http://de.wikipedia.org/wiki/**MediaWiki:Gadget-bkl-check.jshttp://de.wikipedia.org/wiki/MediaWiki:Gadget-bkl-check.js
We in huwiki use an adopted version of this script to display links to disambpages with a different colour.
-- Bináris ______________________________**_________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/**mailman/listinfo/wikitech-lhttps://lists.wikimedia.org/mailman/listinfo/wikitech-l
______________________________**_________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/**mailman/listinfo/wikitech-lhttps://lists.wikimedia.org/mailman/listinfo/wikitech-l
______________________________**_________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/**mailman/listinfo/wikitech-lhttps://lists.wikimedia.org/mailman/listinfo/wikitech-l
On 12/25/12 12:55 AM, Bináris wrote:
I am not sure I understand you perfectly. Does "includes" mean that the magic word has to be in disambiguation template? I hope so as these pages are marked with templates and it wouldn't be a great idea to put the magis in the pages themselves.
Yes, the magic word can just be added to the templates. No need to add it to each page.
Other: will this magic word have localised versions as the others? Or how can we localize it? (Huwiki uses mostly localized magic words.)
Yes, the magic word is completely localizable and aliasable.
Is this change subject to the next version upgrade? When?
It depends on one MediaWiki core change, which is here: https://gerrit.wikimedia.org/r/#/c/40349/ That's the hook that allows the extension to create a new double-underscore magic word (since they are handled differently than regular magic words and parser functions).
As soon as that is code reviewed and merged in, it will just be waiting on the extension. I have no idea how long the process of getting the extension out there will take. Probably a month or two assuming it isn't shot down in flames.
Ryan Kaldari
Thank you for the answers! This will be great and simplifies life.
2012/12/25 Ryan Kaldari rkaldari@wikimedia.org
Yes, the magic word is completely localizable and aliasable.
What is the way to do it? How will bots recognize the localized versions?
On 12/25/12 2:14 AM, Bináris wrote:
Thank you for the answers! This will be great and simplifies life.
2012/12/25 Ryan Kaldari rkaldari@wikimedia.org
Yes, the magic word is completely localizable and aliasable.
What is the way to do it?
The magic word can be localized and aliased through the extension's Disambiguator.i18n.magic.php file (similar to how other magic words are localized).
How will bots recognize the localized versions?
The magic word will be localized, but the page property in the database won't be. The page property will always be called 'disambiguation'. If you know any bot writers that are dealing with disambiguation pages, I would love to know more about what their needs are specifically. Perhaps an API could be added to the extension if it would be useful.
Ryan Kaldari
On Tue, Dec 25, 2012 at 6:46 PM, Ryan Kaldari rkaldari@wikimedia.org wrote:
On 12/25/12 2:14 AM, Bináris wrote:
Thank you for the answers! This will be great and simplifies life.
2012/12/25 Ryan Kaldari rkaldari@wikimedia.org
Yes, the magic word is completely localizable and aliasable.
What is the way to do it?
The magic word can be localized and aliased through the extension's Disambiguator.i18n.magic.php file (similar to how other magic words are localized).
How will bots recognize the localized versions?
The magic word will be localized, but the page property in the database won't be. The page property will always be called 'disambiguation'. If you know any bot writers that are dealing with disambiguation pages, I would love to know more about what their needs are specifically. Perhaps an API could be added to the extension if it would be useful.
Is this enough?
api.php?action=query&prop=pageprops&ppprop=disambiguation&titles=
Ryan Kaldari
-Liangent
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
On Tue, Dec 25, 2012 at 6:00 AM, Liangent liangent@gmail.com wrote:
Is this enough?
api.php?action=query&prop=pageprops&ppprop=disambiguation&titles=
One thing that would be nice would be the ability to go the other way. Consider for example this similar query that tests if the specified pages are in a category:
api.php?action=query&prop=categories&clcategories=Category:All_disambiguation_pages&titles=
We can do the "opposite", getting a list of pages in the category, something like this:
api.php?action=query&list=categorymembers&cmtitle=Category:All_disambiguation_pages
It would be nice to have a corresponding api.php?action=query&list=pageswithprop&pwpprop=disambiguation. At a glance, it looks like we could do it easily enough if someone adds an index on page_props (pp_propname,pp_page).
It would also be great if these pages were marked in the dump files too.
It should be exactly the same way as how redirect pages are marked.
On 27 December 2012 01:41, Brad Jorsch bjorsch@wikimedia.org wrote:
On Tue, Dec 25, 2012 at 6:00 AM, Liangent liangent@gmail.com wrote:
Is this enough?
api.php?action=query&prop=pageprops&ppprop=disambiguation&titles=
One thing that would be nice would be the ability to go the other way. Consider for example this similar query that tests if the specified pages are in a category:
api.php?action=query&prop=categories&clcategories=Category:All_disambiguation_pages&titles=
We can do the "opposite", getting a list of pages in the category, something like this:
api.php?action=query&list=categorymembers&cmtitle=Category:All_disambiguation_pages
It would be nice to have a corresponding api.php?action=query&list=pageswithprop&pwpprop=disambiguation. At a glance, it looks like we could do it easily enough if someone adds an index on page_props (pp_propname,pp_page).
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
That is why I was suggesting adding a field to the page table, instead of using page_props
On Wed, Dec 26, 2012 at 9:56 AM, Andrew Dunbar hippytrail@gmail.com wrote:
It would also be great if these pages were marked in the dump files too.
It should be exactly the same way as how redirect pages are marked.
On 27 December 2012 01:41, Brad Jorsch bjorsch@wikimedia.org wrote:
On Tue, Dec 25, 2012 at 6:00 AM, Liangent liangent@gmail.com wrote:
Is this enough?
api.php?action=query&prop=pageprops&ppprop=disambiguation&titles=
One thing that would be nice would be the ability to go the other way. Consider for example this similar query that tests if the specified pages are in a category:
api.php?action=query&prop=categories&clcategories=Category:All_disambiguation_pages&titles=
We can do the "opposite", getting a list of pages in the category, something like this:
api.php?action=query&list=categorymembers&cmtitle=Category:All_disambiguation_pages
It would be nice to have a corresponding api.php?action=query&list=pageswithprop&pwpprop=disambiguation. At a glance, it looks like we could do it easily enough if someone adds an index on page_props (pp_propname,pp_page).
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
On 26 December 2012 14:57, John phoenixoverride@gmail.com wrote:
On Wed, Dec 26, 2012 at 9:56 AM, Andrew Dunbar hippytrail@gmail.com wrote:
It would also be great if these pages were marked in the dump files too.
That is why I was suggesting adding a field to the page table, instead of using page_props
It's not clear to me that this is a great idea. There's disambigs and there's disambigs. Some have encyclopedic detail, for example. We're not actually talking about something with a clear-cut binary distinction. It's a matter of human judgement. As such, going per-wiki on a local category basis is the closest I can see to a right answer.
- d.
On Wed, Dec 26, 2012 at 10:41 PM, Brad Jorsch bjorsch@wikimedia.org wrote:
On Tue, Dec 25, 2012 at 6:00 AM, Liangent liangent@gmail.com wrote:
Is this enough?
api.php?action=query&prop=pageprops&ppprop=disambiguation&titles=
One thing that would be nice would be the ability to go the other way. Consider for example this similar query that tests if the specified pages are in a category:
api.php?action=query&prop=categories&clcategories=Category:All_disambiguation_pages&titles=
We can do the "opposite", getting a list of pages in the category, something like this:
api.php?action=query&list=categorymembers&cmtitle=Category:All_disambiguation_pages
It would be nice to have a corresponding api.php?action=query&list=pageswithprop&pwpprop=disambiguation. At a glance, it looks like we could do it easily enough if someone adds an index on page_props (pp_propname,pp_page).
Then we may want to get rid of tracking categories generated by code and use pageprops instead?
and implement a generic Special:PagesByProperty in core, and use it like Special:PagesByProperty/disambig , Special:PagesByProperty/brokenfilelink etc?
-Liangent
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
On Thu, Dec 27, 2012 at 4:53 AM, Liangent liangent@gmail.com wrote:
On Wed, Dec 26, 2012 at 10:41 PM, Brad Jorsch bjorsch@wikimedia.org wrote:
On Tue, Dec 25, 2012 at 6:00 AM, Liangent liangent@gmail.com wrote:
Is this enough?
api.php?action=query&prop=pageprops&ppprop=disambiguation&titles=
It would be nice to have a corresponding api.php?action=query&list=pageswithprop&pwpprop=disambiguation. At a glance, it looks like we could do it easily enough if someone adds an index on page_props (pp_propname,pp_page).
Then we may want to get rid of tracking categories generated by code and use pageprops instead?
I have no opinion on that one.
and implement a generic Special:PagesByProperty in core, and use it like Special:PagesByProperty/disambig , Special:PagesByProperty/brokenfilelink etc?
That would need the same page_props (pp_propname,pp_page) index, BTW.
Then we may want to get rid of tracking categories generated by code and use pageprops instead?
I have no opinion on that one.
Tracking categories are nice for certain errors. They more explicitly show there is an error, because there is a category at the bottom of the page. User's can edit the category pages to give helpful information and even change the category name to localize it.
Otoh I suppose such a special page could would also have a system message to provide useful introduction to what the property in question means.
-bawolff
2012/12/25 Ryan Kaldari rkaldari@wikimedia.org
If you know any bot writers that are dealing with disambiguation pages, I would love to know more about what their needs are specifically. Perhaps an API could be added to the extension if it would be useful.
Forwarded to Pywikipedia-l.
Well, it looks like my 2-line fix wasn't very popular. I abandoned that one and wrote an extension instead (plus a hook for core). This extension solves both bug 6754 and bug 35981. It will let us get rid of all the disambiguation code in core, and also stop relying on the MediaWiki:Disambiguationspage hack. Furthermore, it is backwards compatible and will allow the community to migrate to the new system whenever they want to. The old system will continue working in the meantime. In summary, the advantages of this extension over the old system are: 1. It will be trivial to query for which pages are disambiguation pages from the database - just test for the 'disambiguation' page property 2. No longer any need to keep track of all of the different disambiguation templates on all the wikis -- just add __DISAMBIG__ to them and you're done 3. The special page output is identical, but requires fewer queries and is more efficient 4. All the code is in an extension rather than in core (per bug 35981)
I know you're all dying to +2 this new extension (or perhaps tell me why it's a horrible idea), but unfortunately I don't have rights to create new projects on gerritt, and strangely the IRC channels are a ghosttown this evening ;) Perhaps after you've all recovered from your eggnog hangovers someone could great a new project for me on gerrit: ssh -p 29418 gerrit.wikimedia.org gerrit create-project --owner=editor-engagement --parent=mediawiki/extensions --description='"Repository for the Disambiguator MediaWiki extension"' mediawiki/extensions/Disambiguator
Merry Festivus! Ryan Kaldari
On 12/24/12 5:10 PM, Ryan Kaldari wrote:
I implemented a fix for bug 6754 here: https://gerrit.wikimedia.org/r/#/c/40343/
It's a simple 2 line change to core that adds a 'disambiguation' page property to any page that includes '__DISAMBIG__'. I was originally considering implementing this as an extension, but it seems like a feature that would be generally useful to lots of wikis and is a much lighter-weight solution than a full-blown extension.
The reason I used a doubleunderscore magic word is because they don't have to output anything and they automatically set a page property. In other words, they were invented for exactly this sort of purpose.
Ryan Kaldari
On 12/24/12 1:48 PM, bawolff wrote:
You could always have a magic word that disables the features, and let the users put it in the relevant templates. Then the users could disable it on all the pages they feel it would be inappropriate for.
--bawolff
On Mon, Dec 24, 2012 at 2:34 PM, Bináriswikiposta@gmail.com wrote:
Perhaps this helps something if you are familiar with javascript:
http://de.wikipedia.org/wiki/MediaWiki:Gadget-bkl-check.js
We in huwiki use an adopted version of this script to display links to disambpages with a different colour.
-- Bináris _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
On 24 December 2012 10:00, Jon Robson jdlrobson@gmail.com wrote:
Last week I was working on a feature that I didn't want to surface on a disambiguation page. I was surprised to find there was no way I could distinguish between a normal article and a disambiguation page. The disambiguation pages have no clearly marked templates I can use and they are in the same namespace as normal articles.
On en:wp, don't all (or most) dab pages have a template that puts them in [[Category:All disambiguation pages]] ?
-d.
wikitech-l@lists.wikimedia.org