Template:BookLink: Difference between revisions

From Rosetta Code
Content added Content deleted
(Doesn't work correctly.)
(Usage and demonstration. Also some guidelines.)
Line 1: Line 1:
<includeonly><amazon keywords="{{{1}}}"><span class="plainlinks">[%url% %title%] by %author%</span></amazon></includeonly><noinclude>{{template}}
<includeonly><amazon keywords="{{{1}}}"><span class="plainlinks">''[%url% %title%]'' by %author%</span></amazon></includeonly><noinclude>{{template}}


==Purpose==
The use of this template is preferred to direct linking to book resources, as purchases made through the generated link earn Rosetta Code a bit of money through the Amazon Associates program. This will help offset the cost of the server. Links like these should be kept fairly low-key; Too gaudy a presence would distract from the core content of the site.
The use of this template is preferred to direct linking to book resources, as purchases made through the generated link earn Rosetta Code a bit of money through the Amazon Associates program. This will [[Rosetta Code:Finances|help]].
==When Not to Use==
# When a link to a specific book resource would be decidedly inappropriate or unhelpful. It's unhelpful to have a huge number of links, both in terms of choice of appropriate resources, as well as in terms of quality.
==How to use==


By correct selection of the template parameter (the [[wp:ISBN|ISBN]] number, '''dashes removed''', is ideal, followed by [[wp:ASIN|ASIN]] or [[wp:ESIN|ESIN.), a referral link will be provided to the desired resource, hyperlinked as the title and author's name.


For example, Donald Knuth's ''The Art of Computer Programming'' has the ISBN-10 of '''0201853922'''. To create a referral link to this resource, you may use this syntax:
'''Note: This template does not yet work correctly. Using the code directly does, however.'''
<pre>{{BookLink|0201853922}}</pre>

This will appear as:
{{BookLink|0201853922}}

The box set, volumes 1-4A has the ISBN-10 of '''0321751043'''. To create a referral link to this resource, you may use this syntax:
<pre>{{BookLink|0321751043}}</pre>

This will appear as:
{{BookLink|0321751043}}

Revision as of 21:56, 24 October 2010


This is a template. There are many others. See Category:RCTemplates for a complete list of templates.

Purpose

The use of this template is preferred to direct linking to book resources, as purchases made through the generated link earn Rosetta Code a bit of money through the Amazon Associates program. This will help.

When Not to Use

  1. When a link to a specific book resource would be decidedly inappropriate or unhelpful. It's unhelpful to have a huge number of links, both in terms of choice of appropriate resources, as well as in terms of quality.

How to use

By correct selection of the template parameter (the ISBN number, dashes removed, is ideal, followed by ASIN or [[wp:ESIN|ESIN.), a referral link will be provided to the desired resource, hyperlinked as the title and author's name.

For example, Donald Knuth's The Art of Computer Programming has the ISBN-10 of 0201853922. To create a referral link to this resource, you may use this syntax:

{{BookLink|0201853922}}

This will appear as: <amazon keywords="0201853922">[%url% %title%] by %author%</amazon>

The box set, volumes 1-4A has the ISBN-10 of 0321751043. To create a referral link to this resource, you may use this syntax:

{{BookLink|0321751043}}

This will appear as: <amazon keywords="0321751043">[%url% %title%] by %author%</amazon>