User:Pavel Malakhov/test auto form

From Teopedia

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


There are bookmarks on every page of the Secret Doctrine. Template {{SD-page}} makes a link from semantic query:

  • {{SD-page|v=1|p=45|text=SD, volume 1, page 45}}
SD, volume 1, 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 how to go to that page, 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 HTML's set in <meta> tag:

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


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=


Some resources: