Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Quick overview  





2 Reason  





3 Description of use  





4 Limitations  





5 See also  














Template:Querylink






العربية
تۆرکجه


فارسی
ि
Bahasa Indonesia

Ikirundi







سنڌي
کوردی
Tagalog
 

Türkçe
Tiếng Vit

 

Edit links
 









Template
Talk
 

















Read
View source
View history
 








Tools
   


Actions  



Read
View source
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 




In other projects  



Wikibooks
Wikiquote
 
















Appearance
   

 





Permanently protected template

From Wikipedia, the free encyclopedia
 


Quick overview

This template creates an internal link to the specified page (1) with the specified query string (qs) of the form qs=name=value&name2=value2 and optionally the specified caption (2) which defaults to the specified page (1). The intended purpose of this template is to provide the ability to create internal links with a query string component, which addresses a limitation of the current wiki software.

Example usage:

                     1         query string               2
 {{Querylink|Special:Allpages|qs=namespace=1|See what people are talking about}}

Produces: See what people are talking about

Reason

The MediaWiki software does not support the use of a query string element of an URL as part of the internal wiki link syntax. This means that when wishing to link to a page that requires a query string in order to display the desired view of a page, an external link must be used. This is misleading when linking to a page within the wiki itself. For example, to create a link to this page's edit page, one might use the following wikitext: [https://en.wikipedia.org/w/index.php?title={{FULLPAGENAMEE}}&action=edit edit]. This would produce the following link: edit. However, the edit page is not really an external link, so the desired result would be edit, without the external link graphic.

Description of use

Internal links with a query string URL element may be achieved through the use of this querylink template. This template has been provided as a workaround for the described wiki software limitation. The template has been designed to be usable in a similar manner to creating a normal internal link, and takes two to three parameters depending upon how you wish to use it. To create the example link from before to this page's edit page using the querylink template, the following wikitext markup was used:

 {{Querylink|Template:Querylink|qs=action=edit|edit}}

All templates are called by enclosing the template name and parameters within a pair of curly braces "{{}}". All parameters are separated with the pipe character "|". The first "parameter" is always the name of the template that you wish to use and as such is not formally a parameter at all. In this case, it is Querylink.

  1. The first formal parameter passed to the template should be the name of the internal page that you wish to link. In this case, Template:Querylink.
  2. The second parameter is the query string used to display the desired view of the page. It has the form qs= followed by the name and value pairs of the query string of the form name=value&name2=value2. In this case, just one name and value pair is used: action=edit.
  3. The third parameter is optional. If included, the text of this parameter will be used as the display name for the link text in the article, similar to piped links. If omitted, the page name will be used instead, similar to ordinary internal links. In this case, we specify a friendly name for the link: edit.

In some cases you might prefer to produce a query string without a page name. For that, simply omit the first parameter:

{{Querylink||qs=oldid=10000|10 000th revision}}

This produces the link 10 000th revision, pointing to the location https://en.wikipedia.org/?oldid=10000

Limitations

The template normally does not work as a target for #REDIRECT in redirect pages. You can subst: it to achieve that: {{subst:querylink|...}}

See also


Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Querylink&oldid=1007813076"

Category: 
Internal link templates
Hidden category: 
Wikipedia template-protected templates
 



This page was last edited on 20 February 2021, at 01:52 (UTC).

Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



Privacy policy

About Wikipedia

Disclaimers

Contact Wikipedia

Code of Conduct

Developers

Statistics

Cookie statement

Mobile view



Wikimedia Foundation
Powered by MediaWiki