Rosetta Code:Village Pump/Language Page Links: Difference between revisions

Content added Content deleted
(I like 1st option (also reordering comments so as to avoid nesting)
(Formatting+Comment+Comment)
Line 2: Line 2:
Example: On the [[4D]] page, there are links to all the tasks that have been completed in 4D. The top one is "[[Change string case]]". It links to [[Change string case]]. If this passes, it would instead link to "[[Change string case#4D]]" --[[Special:Contributions/66.27.48.50|66.27.48.50]] 22:48, 23 January 2010 (UTC) [[User:BR|BR]] 05:20, 24 January 2010 (UTC) (I'm at home)
Example: On the [[4D]] page, there are links to all the tasks that have been completed in 4D. The top one is "[[Change string case]]". It links to [[Change string case]]. If this passes, it would instead link to "[[Change string case#4D]]" --[[Special:Contributions/66.27.48.50|66.27.48.50]] 22:48, 23 January 2010 (UTC) [[User:BR|BR]] 05:20, 24 January 2010 (UTC) (I'm at home)


The language pages are MediaWiki categories, which just don't support that. Unfortunately. —[[User:Kevin Reid|Kevin Reid]] 22:54, 23 January 2010 (UTC)
:The language pages are MediaWiki categories, which just don't support that. Unfortunately. —[[User:Kevin Reid|Kevin Reid]] 22:54, 23 January 2010 (UTC)


That's too bad... [[User:BR|BR]] 05:20, 24 January 2010 (UTC)
::That's too bad... [[User:BR|BR]] 05:20, 24 January 2010 (UTC)


With the transclusion functionality added to the MCS extension, it becomes possible to create category listings that aren't in the Category namespace. I wouldn't mind seeing that, to be honest; The Category namespace has a lot of quirky restrictions that have made some things difficult. (Such as their lack of supporting "<nowiki>#REDIRECT [[some other category]]</nowiki>") --[[User:Short Circuit|Michael Mol]] 07:21, 24 January 2010 (UTC)
With the transclusion functionality added to the MCS extension, it becomes possible to create category listings that aren't in the Category namespace. I wouldn't mind seeing that, to be honest; The Category namespace has a lot of quirky restrictions that have made some things difficult. (Such as their lack of supporting "<nowiki>#REDIRECT [[some other category]]</nowiki>") --[[User:Short Circuit|Michael Mol]] 07:21, 24 January 2010 (UTC)


I don't see how that's relevant. It's not the page namespace that's the problem; it's that there's no way of expressing “Some_page#Some_section is in Some_category”, as opposed to “Some_page is in Some_category”, whether you use standard MW categories or MCS. Am I missing something? —[[User:Kevin Reid|Kevin Reid]] 12:42, 24 January 2010 (UTC)
:I don't see how that's relevant. It's not the page namespace that's the problem; it's that there's no way of expressing “Some_page#Some_section is in Some_category”, as opposed to “Some_page is in Some_category”, whether you use standard MW categories or MCS. Am I missing something? —[[User:Kevin Reid|Kevin Reid]] 12:42, 24 January 2010 (UTC)


Ah, yes, you're right. I can think of three solutions, though:
::Ah, yes, you're right. I can think of three solutions, though:
* Do some JavaScript foo taking advantage of the referring page URL, and inject it into [[MediaWiki:Common.js]]. I won't write it, though; Cross-browser, production-grade JavaScript isn't among my skill set.
::* Do some JavaScript foo taking advantage of the referring page URL, and inject it into [[MediaWiki:Common.js]]. I won't write it, though; Cross-browser, production-grade JavaScript isn't among my skill set.
* Write a MW extension to inject that JavaScript code into the relevant pages. (To be included in [[Template:Task]], for example.
::* Write a MW extension to inject that JavaScript code into the relevant pages. (To be included in [[Template:Task]], for example.
* Write a MW extension to detect a forward from another page, and then ''re-''forward to the present page+#lang. (That, at least, doesn't require JS support, but hits the server twice for the same page, ''and'' is a potential disaster if any part of the MW-to-user chain caches the wrong page.)
::* Write a MW extension to detect a forward from another page, and then ''re-''forward to the present page+#lang. (That, at least, doesn't require JS support, but hits the server twice for the same page, ''and'' is a potential disaster if any part of the MW-to-user chain caches the wrong page.)
--[[User:Short Circuit|Michael Mol]] 15:45, 24 January 2010 (UTC)
::--[[User:Short Circuit|Michael Mol]] 15:45, 24 January 2010 (UTC)


:::Another solution I can see is if there was some server-side language (well, I guess JS would work too..) that redirects ?lang=4D to #4D (a MW extension might work there, appending "?lang=CategoryName" to the links to things within Categories). --[[User:BR|BR]]
I like the first option. The second is unnecessarily complex, and the third fails if, for example, a category page has a link to a specific example or other section of another page, because the server can't tell if there was ''already'' a #fragment, but JS can. —[[User:Kevin Reid|Kevin Reid]] 17:02, 24 January 2010 (UTC)

:::I like the first option. The second is unnecessarily complex, and the third fails if, for example, a category page has a link to a specific example or other section of another page, because the server can't tell if there was ''already'' a #fragment, but JS can. —[[User:Kevin Reid|Kevin Reid]] 17:02, 24 January 2010 (UTC)

::::Well, wouldn't the JS fail for the same reason? --[[User:BR|BR]]