User:Pavel Malakhov/test auto form: Difference between revisions
No edit summary |
mNo edit summary |
||
Line 2: | Line 2: | ||
There are bookmarks on every page of the ''Secret Doctrine''. Template {{t|SD-page}} makes a link from semantic query: | There are bookmarks on every page of the ''Secret Doctrine''. The book devided on several wiki pages by chapters. Template {{t|SD-page}} makes a link to the wiki page from semantic query: | ||
* <nowiki>{{SD-page|v=2|p=45|text=SD, volume 2, page 45}}</nowiki><br> | * <nowiki>{{SD-page|v=2|p=45|text=SD, volume 2, page 45}}</nowiki><br> | ||
Line 28: | Line 28: | ||
</pre> | </pre> | ||
But | 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 | May be the question is: '''how to implement in MediaWiki form request''' the functionality of <meta> tag of HTML: | ||
<pre> | <pre> | ||
<meta http-equiv="Refresh" content="0; url='https://en.teopedia.org/lib/HPB-SD(ed.1) v.1 p.2 sec.3#335'" /> | <meta http-equiv="Refresh" content="0; url='https://en.teopedia.org/lib/HPB-SD(ed.1) v.1 p.2 sec.3#335'" /> | ||
Line 37: | Line 37: | ||
Additional form and template with '''#Redirect''' does not work. See {{f|Goto wikipage}} form and {{t|Goto wikipage}} template. | Additional form and template with '''#Redirect''' does not work. See {{f|Goto wikipage}} form and {{t|Goto wikipage}} template. | ||
Latest revision as of 00:48, 19 October 2024
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}}
We can get wiki page name by query:
- {{#ask: [[SD volume::1]] [[Page number::45]] [[SD edition::ed.1]] |?}}
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: