Difference between revisions of "11 June 2007"

From Organic Design wiki
(A new template for finding articles)
 
m
Line 1: Line 1:
{{news|title=A new template for finding articles|img=[[Image:PlaceImageHere]]|msg=
+
{{news|title=A new template for finding articles|img=|msg=
 
[[Template:Find]] is a new template made using the [[MW:Extension:Simple Forms|Simple Forms extension]] to make a more sophisticated search form for the site. The new search form works like usual but has extra buttons for sending the query to [[w:|Wikipedia]] or [[Google:|Google]], instead of just the usual ''go'' and ''full-text-search'' buttons. Also if the ''go'' button is used and the search query contains one or more "=" characters, it will be treated as a [[MW:Extension:DPL|DPL]] query allowing searching for articles by [[w:regular expression|regular expression]], category, template-use and much more.
 
[[Template:Find]] is a new template made using the [[MW:Extension:Simple Forms|Simple Forms extension]] to make a more sophisticated search form for the site. The new search form works like usual but has extra buttons for sending the query to [[w:|Wikipedia]] or [[Google:|Google]], instead of just the usual ''go'' and ''full-text-search'' buttons. Also if the ''go'' button is used and the search query contains one or more "=" characters, it will be treated as a [[MW:Extension:DPL|DPL]] query allowing searching for articles by [[w:regular expression|regular expression]], category, template-use and much more.
  

Revision as of 06:55, 11 June 2007

Warning.svg This is a blog item that needs to be converted to the new Bliki format


A new template for finding articles

Template:Find is a new template made using the Simple Forms extension to make a more sophisticated search form for the site. The new search form works like usual but has extra buttons for sending the query to Wikipedia or Google, instead of just the usual go and full-text-search buttons. Also if the go button is used and the search query contains one or more "=" characters, it will be treated as a DPL query allowing searching for articles by regular expression, category, template-use and much more.

There was no programming required to add this functionality to the wiki because it's all done using the Simple Forms and WikiSkin extensions. The search form can be added to any page with {{Find}}. {{#form:name=findForm|class=find|action=/wiki/index.php|

Find articles (more...)

{{#input:name=content|id=query|type=hidden}} {{#input:name=search|id=s|type=hidden}} {{#input:name=q|id=q|type=hidden}} {{#input:name=pagename|type=hidden|value=Search results}} {{#input:name=go|id=input|type=text|value={{#request:go}}}} {{#input: type = image |src = /files/1/1b/Go-icon.png |alt = Title or DPL-query |onClick = i=document.getElementById('input').value;s=document.getElementById('s');s.parentNode.removeChild(s);if (0>i.indexOf('=')) i='titlematch='+i;document.getElementById('query').setAttribute('value','{'+'{#dpl:'+i+'}'+'}'); }}{{#input: type = image |src = /files/1/14/Search-icon.png |alt = Full text search |onClick = findForm.action='/Special:Search';document.getElementById('s').setAttribute('value',document.getElementById('input').value); }}{{#input: type = image |src = /files/4/4f/Favicon_pedia.png |alt = Wikipedia |onClick = findForm.action='http'+'://en.wikipedia.org/wiki/Special:Search';document.getElementById('s').setAttribute('value',document.getElementById('input').value); }}{{#input: type = image |src = /files/3/3a/Favicon_google.png |alt = Google |onClick = findForm.action='http'+'://google.com/search';document.getElementById('q').setAttribute('value',document.getElementById('input').value); }} }}