Template:Cocktaildb recipe
"Search for cocktail recipes". CocktailDB. Archived from the original on September 9, 2015.
Cocktaildb recipe: Mixed Drinks WikiProject link to CocktailDB.com Recipes
{{Cocktaildb recipe}} is used to generate a standardized link to mixed drink recipes at CocktailDB.com. CocktailDB has been reviewed by participants of the Mixed Drinks WikiProject and several other editors at Wikipedia, and has been found to be a reliable mixed drink resource, with minimal commercial advertising.
For template or usage questions, contact Willscrlt (original template developer).
Purpose
This template should be used exclusively for mixed drink articles (i.e., cocktails), since it only links to the cocktails portion of the site. If other WikiProjects would find it useful to extend this template to include links to other sections of the site, please discuss it on this template's talk page.
By using this template instead of manually coding a link to CocktailDB's site, it will be easy to update all pages linking to CocktailDB if the CocktailDB.com site ever changes its site in a way that would normally break such links. If that happens, one change to this template should update all the links throughout Wikipedia at once.
It is important that the template is transcluded into the article, rather than substed in. Substituting breaks the dynamic connection to the template, and such pages will no longer dynamically update.
Usage
- Go to CocktailDB and search for the cocktail to which you wish to link.
- Click on the appropriate search result to go directly to the cocktail's page.
- The page URL should look like
http://www.cocktaildb.com/recipe_detail?id=####
, where "####" is a number that represents the particular drink (the number has no significance outside of CocktailDB). - Copy ONLY the numerical portion of the URL indicated by #### above.
- If one does not already exist, add a section named "External links" near the bottom of the wiki article.
- Add the following text to the external links section as shown:
==External links==
* {{Cocktaildb recipe|id=####|name=PRETTY NAME}}
- The asterisk (*) is to make the link be part of a bulleted list (since it's part of the list of external links).
- "####" is the ID number you've copied from the CocktailDB URL. The ID number is required.
- "PRETTY NAME" is the cocktail's name for display in the external link.
- The pretty name is technically optional and defaults to the name of the article if omitted, but since pages are sometimes moved or renamed, it is best to specify the name.
Examples
Searching for "Singapore Sling", you'll reach the page: http://www.cocktaildb.com/recipe_detail?id=3779
Copy "3779" from the URL and then add the following to External links in the Singapore Sling article:
* {{Cocktaildb recipe|id=3779|name=Singapore Sling}}
- The result is:
- "Singapore Sling". CocktailDB. Archived from the original on September 9, 2015.
To display the same information in WPMIXInfobox format, the following would be used:
* {{Cocktaildb recipe|id=3779|name=Singapore Sling|info=yes}}
- The result is:
- "Singapore Sling". CocktailDB. Archived from the original on September 9, 2015.
If the template is used without the required id attribute, a search link is generated instead:
* {{Cocktaildb recipe|name=Singapore Sling}}
- The result is:
- "Search for cocktail recipes". CocktailDB. Archived from the original on September 9, 2015.
- This is not the desirable output, and usage in this manner likely violates Wikipedia's guidelines.
The above documentation is transcluded from Template:Cocktaildb recipe/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |