User:Pavel Malakhov/test auto form: Difference between revisions
(Created page with "'''How to automaticaly go to the wiki page, returned by semantic query?''' There are bookmarks on every page of the ''Secret Doctrine''. Template {{t|SD-page}} makes a link from semantic query: * <nowiki>{{SD-page|v=1|p=45|text=SD, volume 1, page 45}}</nowiki><br> :: → {{SD-page|v=1|p=45|text=SD, volume 1, page 45}} We can get wiki page name by query: * <nowiki>{{#ask: SD volume::1 Page number::45 SD edition::ed.1 |?}}</nowiki> :: → {{#ask: SD vol...") |
mNo edit summary |
||
Line 39: | Line 39: | ||
<nowiki>https://en.teopedia.org/lib/Special:RunQuery/Goto_sd_page?Goto_sd_page[volume]=</nowiki><span style="color: red; font-weight: bold;">2</span>&Goto_sd_page[page]=<span style="color: red; font-weight: bold;">45</span>&_run= | <nowiki>https://en.teopedia.org/lib/Special:RunQuery/Goto_sd_page?Goto_sd_page[volume]=</nowiki><span style="color: red; font-weight: bold;">2</span>&Goto_sd_page[page]=<span style="color: red; font-weight: bold;">45</span>&_run= | ||
'''Some resources:''' | |||
* https://www.mediawiki.org/wiki/Extension:Page_Forms/Creating_query_forms | |||
* https://www.mediawiki.org/wiki/Extension:Page_Forms/Linking_to_forms |
Revision as of 10:18, 12 October 2024
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}}
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 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: