From: Scott Y. <sco...@an...> - 2010-09-13 04:44:00
|
Hi, On my wiki site I wanted to create a hyperlink behind some text so that when someone clicks on a complete birth date (e.g. 12 September 1841) they get a list of people born in that year (1841). The hyperlink would point to a query returning all pages with a birth date property containing 1841 and the text is the full birth date property of the current page. The only query facility that appears to allow partial matching is the Special:Ask page, so I used an external link in a template as follows (internal link had bracket/brace clashes): <span class="plainlinks">[http://localhost/wiki/Special:Ask?q=[[has_birth_date::~*1841]] {{{1}}}] (Note that in the example I have hardcoded the search year, but most likely this would come from a parser function invoked on the value of {{{1}}}.) The template would be invoked by something similar to: {{#ask: [[{{PAGENAME}}]]|?has birth date|?has death date|?has birth place|?has death place|format=template|template=Test|link=none}} While inline data seems to be taken care of (via #show and #ask parser functions), the "correct" or "clean" way of creating query links in this context is a little more problematic due to bracket clashes. So my question is: Is linking to the Special:Ask results page as per above the "right" way to get queries to work in the scenario above or am I missing something obvious? Also it doesn't appear as though I can pass extra parameters to a template used in an #ask - does anyone know if and how this is possible? Thanks. Scott. |