TiiJ7
Joined 20 July 2012
Latest comment: 7 years ago by TiiJ7 in topic Hello and thank you!
Welcome!
edit
|
Module
editHello and thank you!
editHi TiiJ7!
Implemented this nice solution you posted over at https://stackoverflow.com/a/29331597/8409515 for when you want all redlinks to go to a specified URL? I decided to point them to the search page and it works well but would love to exclude the red link to create the page that is on the search page.
HausaDictionary (talk) 12:31, 30 August 2017 (UTC)
- @HausaDictionary: I haven't really looked into this as much. But indeed it would be useful to have the hook not apply on the search page (or even special pages in general). Unfortunately, it seems that the LinkEnd hook doesn't directly expose the Skin object. Perhaps you can still get it in the function with
global $wgSkin
, though I believe global objects are not recommended, so there might be a better way to do it. In either case once you have the skin, you can usegetTitle()
to get the current page and thenisSpecialPage()
orisSpecial('Search')
. So with that it should be a simpleif
check to bypass the href change. But again, I haven't really looked into it much and am not too super knowledgeable about MediaWiki, so I'm afraid this is about all I can give you. Hope it still helped. - TiiJ7 (talk) 21:04, 31 August 2017 (UTC)