Template:Cocktaildb recipe/doc

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, 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:
 * 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.

categories
By default, any article that uses this template is presumed to be a mixed-drink related article (otherwise use of this template in the article should be avoided). So, the article is automagically categorized under, which helps to alert Project Participants to the existence of the article.

This attribute is a somewhat "hidden" feature that allows demonstrating this template in places where the automagical categorization is undesirable. Any value other than no is ignored and the category will be generated. If set to no the template will display as normal, but the category will be suppressed.

info
Another somewhat "hidden" feature of this template is the automatic inclusion of the words "Information from the " prefixed to the output of this template. This is primarily for use within the WPMIXInfobox when the standardized recipe information used comes from CocktailDB. In the External links section and most other places, this would be undesirable.

The categories are automatically suppressed with this option, since the infobox adds the category, and it is silly to do so twice.

Example
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:
 * The result is:

To display the same information in WPMIXInfobox format, the following would be used:
 * The result is:

If the template is used without the required id attribute, a search link is generated instead:
 * The result is:
 * This is not the desirable output, and usage in this manner likely violates Wikipedia's guidelines.
 * The template defaults to a search link only because the developer feels that is preferable to generating a broken link.
 * Missing ids will result in the article being categorized under unless categories are suppressed.
 * Missing ids will result in the article being categorized under unless categories are suppressed.

Template

 * The generic template is displayed below.