User:Pavel Malakhov/test auto form

How to automaticaly go to the wiki page, returned by semantic query?


There are bookmarks on every page of the Secret Doctrine. The book devided on several wiki pages by chapters. Template {{SD-page}} makes a link to the wiki page from semantic query:

  • {{SD-page|v=2|p=45|text=SD, volume 2, page 45}}
SD, volume 2, page 45


We can get wiki page name by query:

  • {{#ask: [[SD volume::1]] [[Page number::45]] [[SD edition::ed.1]] |?}}
HPB-SD(ed.1) v.1 p.1 st.1 sl.7


Or create a link to bookmark (html anchor), using Special:RunQuery/Goto_sd_page


We can set values and run query automatically: Go to SD page 45 in volume 2, wiki code:

{{#queryformlink:form=Goto sd page 
 | link text = Go to SD page 45 in volume 2
 | query string=Goto_sd_page[volume]=2&Goto_sd_page[page]=45&_run
}}

But in every case we get a result page with a link to wiki page of the book. How to go to that page itself, instaed of getting a page with a link to it?

May be the question is: how to implement in MediaWiki form request the functionality of <meta> tag of HTML:

<meta http-equiv="Refresh" content="0; url='https://en.teopedia.org/lib/HPB-SD(ed.1) v.1 p.2 sec.3#335'" />


Additional form and template with #Redirect does not work. See «Goto wikipage» form and {{Goto wikipage}} template.


Our final goal is to provide a sort of API for external users, so if they put the volume and page numbers in URL they will get the wikipage, the name of which is unknown for the user, but generated by query. Like this:

https://en.teopedia.org/lib/Special:RunQuery/Goto_sd_page?Goto_sd_page[volume]=2&Goto_sd_page[page]=45&_run=

This URL should be redirected to:

https://en.teopedia.org/lib/HPB-SD(ed.1)_v.1_p.1_st.1_sl.7#45


Some resources: