Topic on Project:Support desk

Input box for redirecting to categories?

6
23x23x23 (talkcontribs)

Hello. I need an automated redirecting in my wiki.

I thought of an input box, where for example you enter "1950" and you get redirected to a [[:Category:Born 1950]], you enter "1936" and get redirected to a [[:Category:Born 1936]] and so on.

I only found input boxes for page creation, but not for page redirecting. How to do it? 23x23x23 (talk) 15:22, 9 October 2017 (UTC)

Star Warden (talkcontribs)

Create the 1950 page with #REDIRECT [[:Category:Born 1950]] and whenever someone enters 1950 in the search box and clicks on it, they will be redirected to the aforementioned category.

23x23x23 (talkcontribs)

Star Warden: If there are 2000 categories for Born... and 2000 categories for Died... then this makes 4000 redirects to create. To avoid exactly that work that you present as a solution, i am looking for an input box that can redirect by script.

Any better ideas anyone?

AhmadF.Cheema (talkcontribs)

If Extension:CirrusSearch is available, through the InputBox method, this might be possible by using the prefix or searchfilter parameters.

CirrusSearch allows for special parameters like incategory. For example, using the following

<inputbox>
prefix=incategory:Born 
</inputbox>

when the user enters 1950, the search results would probably include articles in the category, Born 1950.

23x23x23 (talkcontribs)

That sounds interesting. Is there a wiki with a similar CirrusSearch installed, so i can check it out before installing?

AhmadF.Cheema (talkcontribs)

Most, if not all, Wikimedia foundation Wikis should have it. You can try it on Project:Sandbox or w:Wikipedia:Sandbox.

I tried this particular solution, couldn't make prefix parameter to work for this use-case.

<inputbox>
type=search
searchfilter=incategory:Disambiguation_pages
</inputbox>

The above InputBox searches for the entered search term in the category "Disambiguation pages".

However, if I understand correctly, your use-case requires the "Disambiguation_pages" part to be a variable determined by what the user enters. I don't know if that's possible. Could be doable using Extension:InputBox#Parser function, though.