Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
asv_amazon2: it's been a long time coming
UPDATE:
Download rc2 and jquery (jquery.js goes in /textpattern – only required if you are using 4.0.4 or below)
Alright, I’m done adding features to asv_amazon2. It’s in RC, while I do bug fixes. There’s a major change from how v0.2 had worked. I now use a tag asv_amazon2_display. This tag has three formats:
1. hardcode – you can hardcode all the details (title, url, image urls) in to the tag and apply it to a form.
<txp:asv_amazon2_display title="Textpattern Solutions: PHP-Based Content Management Made Easy (Solutions)" smallimage="http://ec1.images-amazon.com/images/I/01yaq1etjKL.jpg" mediumimage="http://ec1.images-amazon.com/images/I/21Kyb5n01xL.jpg" largeimage="http://ec1.images-amazon.com/images/I/51xlE6beAKL.jpg" url="http://www.amazon.com/gp/redirect.html%3FASIN=1590598326%26tag=ws%26lcode=xm2%26cID=2025%26ccmID=165953%26location=/o/ASIN/1590598326%253FSubscriptionId=0Y8F1YV1N2YSGJ1MC202" form="asv_amazon2" />
2. form – this is similar to the way the old plugin worked. You provide an asin number and the tag will request the data from Amazon each time
<txp:asv_amazon2_display asin="1590598326" form="asv_amazon2" />
3. form (cached) – here you can cache the request for data from Amazon, to improve performance.
<txp:asv_amazon2_display asin="1590598326" form="asv_amazon2" cached="y" />
To use caching you’ll need to go to “Extensions > Amazon Settings” and provide a cache directory and a url path to that directory (no end slashes).
Sample Form (works for all three of the above)
<a href="asv_amazon2_url"><img src="asv_amazon2_sImageUrl" /><br />asv_amazon2_title</a><br />
======= Original Message ===============================
I always dreamed of this plugin and am glad I found the time to write it. This is also my first experience with jQuery, which I opted to use since it was a pain to write for cross browser compatibility. It’s still early in testing and lacks a couple features, but the heart of it is there.
Download – requires jquery.js in your textpattern/ folder
Tested on TXP 4.0.4 using OSX Safari 3, OSX FF 2.0.04, XP IE 7
How does it work?
Simple – when writing an article just click on the “Amazon2” link in the top right column. You can search and add products to your post by clicking the “add” button next to each item.
Creating a form
With the current version, you will have to have forms (type ‘misc’) to generate the layout of the product on your page. When creating a new ‘misc’ form you can use the following values:
asv_amazon2_url
asv_amazon2_sImageUrl
asv_amazon2_mImageUrl
asv_amazon2_lImageUrl
asv_amazon2_asin
asv_amazon2_title
asv_amazon2 will just replace these literals with their product counterpart, so a form (type ‘misc’) like:
<a href="asv_amazon2_url"><img src="asv_amazon2_sImageUrl" /><br />asv_amazon2_title</a>
returns:
<a href="http://www.amazon.com/gp/redirect.html%3FASIN=1590598326..."><img src="http://ec1.images-amazon.com/image..." /><br />Textpattern Solutions: PHP-Based Content Management Made Easy (Solutions)</a>
Last edited by variaas (2007-10-03 18:54:28)
Offline
Re: asv_amazon2: it's been a long time coming
One thing to note…this is really v0.2 (i.e. it’s beta and going to change a LOT). I’ve already changed the way the plugin is shown on the write tab. I’m also creating a tag, because I realized there’s no other way to mass edit the layout of your amazon products. I’ll be doing rapid releases in the next week to make sure there is a stable version to use.
Offline
Re: asv_amazon2: it's been a long time coming
ooh i’ll have to try this plugin out when i need it. in the meantime, have you considered updating textpattern.org with it? seems like it still has an old version listed
Offline
#4 2008-05-15 16:36:49
- Ruhh
- Member
- From: dakota dunes
- Registered: 2008-01-20
- Posts: 305
Re: asv_amazon2: it's been a long time coming
Is this plugin still supported? Does it work on latest versions of TXP?
<txp:Ruhh />
Offline
Offline
#6 2008-05-15 16:44:50
- Ruhh
- Member
- From: dakota dunes
- Registered: 2008-01-20
- Posts: 305
Re: asv_amazon2: it's been a long time coming
Hm, it gives me an empty article. I don’t see any books. :/ This is a great plugin.
By the way, the article is on sticky status. Is it why the plugin can’t work in sticky articles?
Last edited by Ruhh (2008-05-15 16:47:33)
<txp:Ruhh />
Offline
Offline
#8 2008-05-15 16:53:50
- Ruhh
- Member
- From: dakota dunes
- Registered: 2008-01-20
- Posts: 305
Re: asv_amazon2: it's been a long time coming
I’m actually in debug mode. I don’t see any errors. I don’t want to use it on a live article but a sticky article, however, I don’t see anything when on the page. Is there a way to get it working on a sticky article?
<txp:Ruhh />
Offline
Offline
#10 2008-05-15 17:03:57
- Ruhh
- Member
- From: dakota dunes
- Registered: 2008-01-20
- Posts: 305
Re: asv_amazon2: it's been a long time coming
Nope. Books not showing. The article is in a created section: About and the article is set on status: Sticky. I use the basic tag with a notextile. before it. And a form created: amazon with the example given.
Ok, I think I got the books to show up. But I do get an error:
Tag error: <txp:asv_amazon2_display asin="0099450259" form="amazon" /> -> Notice: Undefined variable: asv_amazon_cachedir on line 497
Ok, edit again. The tag requires a cache path and url so the errors are gone. Another question: Is there a way to show the author’s name?
Last edited by Ruhh (2008-05-15 17:41:00)
<txp:Ruhh />
Offline
Re: asv_amazon2: it's been a long time coming
thanks amit for the plugin. for those using this and also aro_myadmin, i had to add the following:
$("#asv_amazon2wrapper").css("z-index", "1000");
to this plugin so the popup amazon search box sits on top of everything else. without it, it gets buried underneath aro_myadmin’s interface.
edit: apparently with aro_myadmin enabled, search results with this plugin just sticks on “loading…”. when i disable aro_myadmin, search works again. i’ll poke around and see whats conflicting.
edit #2: asv_amazon2 + glz_custom_fields + aro_myadmin = barf! ahh well i’ll just stick to a regular non-plugin theme. it seems to mess with too many plugins that rely on javascript + hooks.
edit #3: hmm no associate id support?
Last edited by iblastoff (2008-06-09 20:43:15)
Offline
#12 2011-10-04 10:48:13
- AdamK
- Member
- From: Kraków, Poland
- Registered: 2009-08-11
- Posts: 47
Re: asv_amazon2: it's been a long time coming
Hello
three years after the last post :) I’ve tried to use the plugin, but there is an error with multisite TXP 4.4.1:
When i try to search an article with the popup window on “write” tab, I get no results (The ‘Articles’ tab opens with ‘No articles recorded.’ text).
Help? :)
Thanks
A.
Offline