 |
Using User Defined Fields, you can create e-commerce links for books, movies, or music reviews.
For example, if you have a User Defined Field named "book title," you can create a link to that book at Amazon.com. Find the format that Amazon.com uses for its queries. For books, the URL (at the time of writing this) is:
http://www.amazon.com/exec/obidos/external-search?keyword=book+title&mode=books
Add the following code to your template. It may look a bit cryptic, but it should make sense if you read through it.
T A G C O D E:
<a href="http://www.amazon.com/exec/obidos/external-search?keyword=<dpUserField name="book title" style="lower" style="nohtml" style="urlEncode">&mode=books">Search for related books at Amazon.com</a>
or
<a href="http://www.amazon.com/exec/obidos/external-search?keyword=<dpUserField name="book title" style="lower" style="nohtml" style="urlEncode">&mode=books">Purchase <dpUserField name="book title"> at Amazon.com</a>
Basically, we've replaced the keyword section, which previously had "book+title", with the following: <dpUserField name="book title" style="lower" style="nohtml" style="urlEncode">, which says take the Book Title, change it to lower case, remove any HTML it may have, and encode it so it can be passed in a URL.
Try it out and you'll see how it connects directly to the Amazon search allowing the reader to get right to the book they want. You can use this dynamic tag code to create smart links to external sites.
Here's another example using Google.com and a variable:
<dpVar encodedTitle="<dpUserField name="book title" style="lower"
style="noHtml" style="urlEncode">">
<a href="http://www.google.com/search?q=<dpVar encodedTitle>&mode=books"
target="_blank">Search Google for more on <dpUserField name="book
title"></a>
This would create a link like the following:
http://www.google.com/search?q=good+omens
See also:
Common Attributes,
<dpVar>
A D D I T I O N A L < D P U S E R F I E L D > E X A M P L E S:
S E E A L S O:
Other tag examples that incorporate <dpUserField>
|
 |