SourceForge.net Logo
July 20, 2006
© GPL
 
ProWikiCenter
Cdml Asin
 
CdmlAsin provides an automatic Amazon affiliate image link. You can use such links to get a percentage of the book sales of Amazon customers which used these links when buying the books.

Example

Default element:

created by:

[[ASIN]]

parameters

CdmlAsin is implemented on top of CdmlLink, therefore all parameters of CdmlLink can be used.

CdmlAsin parameters:

  • body: The body of the CdmlAsin element is taken as the ISBN or ASIN number.
  • title: The optional title parameter provides an additional description text for the link. It is only visible when the user hovers with the mouse over the link.
These parameters exist but are typically not used because the are created automatically from the defaults. The description here is for completeness only:

  • aid: the affiliation id
  • url: the URL which is linked to
  • image: the URL of the image shown

Configuration

The configuration of the defaults is done by using the CdmlElementDefaults mechanism.

You define:

  • the url pattern where you link to
    • e. g. [image=http://images.amazon.com/images/P/{code}.01.THUMBZZZ.jpg]
  • the image that is to be shown and
    • e. g. [url=http://www.amazon.com/exec/obidos/ASIN/{code}/{aid}]
  • the affiliate id (aid)
    • e. g. [aid=rickcogleyweb-20]
Combined default definitions:

  • cdml.asin.defaults=[aid=rickcogleyweb-20][image=http://images.amazon.com/images/P/{code}.01.THUMBZZZ.jpg][url=http://www.amazon.com/exec/obidos/ASIN/{code}/{aid}]
These defaults are also defined in the script so currently you only need to define the aid parameter. But the Amazon url parameter structure may change and then it is probably easier for the maintainer if these parameters are already in place to be changed.

Note: the insertion marker {code} is replaced by the given ISDN or ASIN code, the insertion marker {aid} is replaced by the affiliation id.

Location: typically the TopConfiguration, where it affects all wiki pages.

For an example configuration in place (working only for this page) see /Context.

More examples

This example uses an ASIN number and defines a title "Life is Beautiful" that shows when you hover with the mouse over the image:

create by:

[[ASIN]B00001U0DP[title=Life is Beautiful]]

Discussion / starting with the original text from FeatureRequests

/Discussion


FolderCdml