DEPRECATION WARNING
This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.
Created: | 2003-10-10T15:22:51 |
---|---|
Changed: | 2005-07-02T22:20:35 |
Info 1: | |
Info 2: | |
Info 3: | |
Info 4: |
EXT: Amazon Search¶
Extension Key: eim2amazonsearch
Copyright 2000-2002,Achim Eichhorn, <achim@eim2.de>
This document is published under the Open Content License
available from http://www.opencontent.org/opl.shtml
The content of this document is related to TYPO3
- a GNU/GPL CMS/Framework available from www.typo3.com
Table of Contents¶
EXT: Amazon Search 1
Introduction 2
What does it do? 2
Screenshots 3
Users manual 4
Adminstration 10
Installation 10
Configuration 11
TyposScript setup 12
Configuration 16
searchtypes and searchmodes 16
Listfields, Displayfields and Hiddenfields 17
FAQ 17
Reference 18
Known problems 18
To-Do list 18
Changelog 19
Introduction¶
What does it do?¶
This front end plugin uses the amazon SOAP webservices to receive information from amazon. The query results will be displayed within the typo3 frontend. If you have an amazon patner ID and you enter it in the constant section of your template, this ID will be added to all links leading to amazon. Visit amazon website (section partner program) for more information.To use this extension you must have an amazon developer token, which you have to enter in the constant section of your template. Visit amazon webpage (section webservices) for more information. (Don't mess associate ID and developer token!)
This extension uses the “NuSOAP - Web Services Toolkit for PHP” by Dietrich Ayala, dietrich@ganx4.com , http://dietrich.ganx4.com/nusoap . The library and license information can be found in the extensions subfolder “soap”.
What is new in Verions 2?
You can now use multiple partner programs, the additional programs are defined in typoscript setup. The partner program defined in constants section will be used as “default” program, if no others are defined.
There are TEASER and DETAIL elements in addition to FORM and LIST of the previsious version.
TASERS display a small amount of query results, the querys can be very tricky, depending on predifined ASIN lists, on the POST/GET Vars sent to other plugins, on the searchword with which a user came from an external searchengine like google,...
DETAILS display the infomation of a single item.
A plugin can do a “heavy” search, which gives back much more information than the “lite” version.
This extension now depends on eim2nusoap extension, which holds the actual Version of Dietrich Ayala's nusoap library. There is another extension in TER, which does the same, but with an older Version of nusop, which caused problems with amazon's soap interface, so I had to publish my own extension.
Upgrade
To tell the truth, I am not sure if Version 2 is full compatible with the previsious Versions, so I recommend to try this on local/development/backup installations first. On the other hand, I don't think that you installed more than perhaps 2 or 3 different plugins on one website, so the changes, which perhaps will be necessary aren't to complex.
Screenshots¶
This is an example of a search form. The look depends on your template. All labels and options are available in german and english, more languages can be added. In this example we want to search for the author “pratchett”.
The result would look like this:
There were 116 articles in the book store to the author “pratchett”. These 116 articles are displayed on 12 pages, the actual page is page num 1. The 2 displayed articles are available within 24 hours at amazon. With the navigation on the top you can navigate between page 1 and 10. With the arrow on the right side, you have access to the next two pages. It can happen that there exist hundreds of pages at amazon. Then there will be always a “first button” to the first page, a “next button” to the next 10 oages and a “previsous button” to the previsious 10 pages in the navigation.
There are several searchtypes provided by amazon. (author, keywords, artists, asin, producers, manufactureres...)
Users manual¶
First of all, you have to enter your developer token in the constants. You can read in section “configuration” how you have to do this.
We will now create a little website containing all of the eim2amazonsearch elements (TEASER,DETAIL,FORM,LIST).
**Pagestructure**
Create something like the following page structure:
The page named “DETAIL” should be a page, which is not in menu!
**TEASER**
Now go to the page called “TEASER” and select “Create page content”
Then choose “gerneral plugin”
Now we have to do a little bit of configuration:
Choose Amazon SOAP Interface as plugin, and enter the following line in the CODE field:TEASER:OPTIONS=3-4:ELEMENTS=5;
Ok, what does this mean? TEASER – thats clear, we want to have a teaser on this page. ELEMENTS=5, that's clear, too: The teaser should not display more than 5 elements. But what means “OPTIONS=3-4” and by the way, WHAT should the TEASER display?The answer to both questions can be found in typoscript setup: There is a section called teaseroptions:
#################################### TEASER OPTIONS###################################
plugin.tx_eim2amazonsearch_pi1.teaseroptions{
1.TYPE = SEARCHENGINE
2.TYPE = PLUGIN2.PARAM = sword2.DELIMITER =
3.TYPE = SEARCH3.SEARCHTYPE = KeywordSearch3.SEARCHMODE = books3.SEARCHSTRING = content management
4.TYPE = ASINLIST4.LIST = 3937514015,3898424707
}
3-4 means, that the teaser uses the elements 3 and 4 of teaseroptions. “3” defines a KeywordSearch for books, with the words “content” and “management”.
4 defines a search for the two ASIN's “3937514015” and ”3898424707”.
The teaser behaves that way: If one search doesn't return results, it uses the next. It starts with the keywordsearch, and if that fails, then it trys the ASIN search.Time to have a glance at the frontend?
You can see, there are five books displayed.
But what, if you want to have some more information for one of those books?It's time to insert a second plugin and let our second hero enter the stage:
**DETAIL**
Go to the page called “DETAIL” and insert a plugin like described in TEASER section, but this time, insert the following line in the CODE section:Now we have to tell our teaser, that he can use a detail page for displaying additional information.
Go back to teaser page end edit the teaser plugin as follows:In the field “Startingpoint” choose the DETAIL page.
Time to swith back to the frontend and see, if there has changed something...
Ah, there is a new link “Details” - don't hesitate to klick ist...Cool, now we see more information about this item, a bigger image of the cover and so on.On the end of the list we find a link “back”, and if we follow this, we come back to our teaser.But what, if you really want to have all available information about the articles?Then you have to use something called “heavy.dtd” from the amazon webservices. This defines a much bigger result set. It doesn't make much sense, to use this within the TEASSER, but we could use it in our DETAIL plugin.Go back to the DETAIL page, and edit the plugin. Enter in the CODE section this line:
DETAIL:RESULT=heavy
No back to the frontend, and follow the “Details” link again...WOW, that's really a lot of information. But be careful, this option is timeconsuming! If you scroll down to the bottom of the page, you find the section “SimilarProducts”. Amazon soap interface only returns the ASIN's of those products. eim2amazonsearch takes this ASIN's and does another amazon query, to get the corresponding product Information, too.
If you use “heavy” within a LIST plugin, for all SimilarProducts of all result entries there will be another amazon query. You have to test, if this is too slow in your environment. I would recommend to use “heavy” only on DETAIL pages. I tried to optimize programming and reduce the soap requests to a minimum, but until I have implemented a caching mechanism, be carefull...
So, now I wrote about LIST plugins -> its time to have one on our webpage!
**FORM and LIST**
Go to the page we called FORM and LIST.
There you create two plugins, the first gets the following line in the code Field:FORMThe other one gets LIST.Thats all, if you switch to this page in the frontend you have got a searchform and the results will be listed in LIST plugin.
If you want your searchform on another page, than the list, then you have to redirect from the form to the listpage. This is done similar to what we have written about TEASER and DETAIL. Just choose the page with the LIST plugin as Startingpoint of the FORM plugin.
If you want to provide detail information in a LIST plugin just choose the DETAIL page as starting point of the list plugin.
**Some additions to TEASERS**
If you enter the phrase “content management”, which is the keyword search we defined as input for our teaser, in the FORM plugin, you see, that there are more than 5 books fitting this search.
If you want, that your website visitors can see all possible results for the search belonging to the teaser, you have to edit the teaser plugin again, and give it a second “startingpoint” which has to lead to a page with a LIST plugin.
Each time, the TEASER gets more results as defined in his ELEMENTS option, it displays an additional link, which leads to the LIST page and there forces another search with the same parameters as in the TEASER's search.
Be sure, that the first parameter goes to the DETAIL page and the second to the LIST!In the frontend you will now see:
There is a link “More results”. If you follow this you will get to the LIST page and can navigate through all results.On the bottom of the LIST page you will now find a “back” link, which leads back to the calling TEASER!
If you remember the typoscript setup for the teaseroptions, you perhaps remember that there were two more options listed? One was “SEARCHENGINE”, another one was “PLUGIN”.
The SEARCHENGINE option examines an referer. If it came from a known searchengine then it grabs the given searchwords. With them it starts a keyword search at amazon. If you are a programmer and want to test, if this feature works, you first have to enter in the plugin's CODE field the OPTION combination 1-3-4. (it starts with 1 => SEARCHENGINE, if it gets no results, then it uses 3 => keywordsearch “content management” and so on).
Now you have to simulate an external referer from a searchengine. If you open the file classes/class.controller.php in the extension directory, you will find at lines 300 ... some comments like:
//$referer = "http://www.google.de/search?q=typo3&hl=de&lr=&cr=country AT&ie=UTF-8&oe=UTF-8&start=20&sa=";
If you uncomment this line, our plugin thinks the visitor came from google and there he searched for “typo3”, so the plugin itself searches for typo3. You can define more searchengines in typoscript setup (there you see, which are allready defined, and how this is done). If you then like to test your new createt “searchengine agent”, you just have to add a line, like the above listet (don't forget to comment “//” it after testing!).
plugin.tx_eim2amazonsearch_pi1.searchengines{
google.referer = googlegoogle.keyword = qgoogle.delimiter = +
altavista.referer = altavista.comaltavista.keyword = qaltavista.delimiter = +
...
}But what we want to do now, is to test the “PLUGIN” option. We want our teaser to listen to what the user searches on our website and then provide corres books.
First we need a search plugin on the page, where the teaser is.Klick “create new page content” and then choose Search form:
Now we have to tell our teaser, that we want to listen to information sent to the search plugin.The parameter for this plugin is “sword”.In typoscript setup we find the entry:#################################### TEASER OPTIONS############# ######################plugin.tx_eim2amazonsearch_pi1.teaseroptions{
1.TYPE = SEARCHENGINE
2.TYPE = PLUGIN2.PARAM = sword2.DELIMITER =
Now we tell the plugin to use this option as first option and 3 and 4 as the other options.The CODE field of the TEASER plugin now looks like this:
If you go to the frontend again and reload the teaser page, you will
see that there is a search form.
the teaser shows the same as before... nothing really interresting happend :-(
Enter a word in the search form, I choose “fit”, and hit “search”!Now you see the searchresults from the typo3's search over your website (in my case it found nothing, cause there is no content available...)
BUT if you have a look at the output of our TEASER, you will see, that there is a completly other result than before, they “fit”, to what was entered in the searchform.Cool, isn't it?
You now can experiment with some other search words. If you have enough of playing around this way, try a nonsene word like “Hommingberger Gepardenforelle”. Is this confusing our teaser? No, not really, it gets no results for this word, so it uses the second defined option and does a keyword search for “content managment”. You should always have a search on the bottom of your options which leads to results, so your teaser will never display “NO RESULTS”.
**Different partner programs**
If you join different amazon partner programs, eim2amazonsearch now supports this feature, too.Have a look in tssetup, where you will find the following:
#################################### PARTNER PROGRAMS###################################
plugin.tx_eim2amazonsearch_pi1.partnerPrograms {#Available amazon wsdl's#United States,locale: None needed, http://soap.amazon.com/schemas3/AmazonWebServices.wsdl #Great Britain,locale=uk, http://soap- eu.amazon.com/schemas3/AmazonWebServices.wsdl #Germany,locale=de, http://soap-eu.amazon.com/schemas3/AmazonWebServices.wsdl #Japan,locale=jp, http://soap.amazon.com/schemas3/AmazonWebServices.wsdl #France,locale=fr, http://soap.amazon.fr/schemas3/AmazonWebServices.wsdl #Canada,locale=ca, http://soap.amazon.ca/schemas3/AmazonWebServices.wsdl 1.locale = de1.associateId = webservice-201.wsdl = http://soap- eu.amazon.com/schemas3/AmazonWebServices.wsdl
2.locale = us2.associateId = webservice-202.wsdl = http://soap.amazon.com/schemas3/AmazonWebServices.wsdl
3.locale = uk3.associateId = webservice-203.wsdl = http://soap- eu.amazon.com/schemas3/AmazonWebServices.wsdl
4.locale = jp4.associateId = webservice-204.wsdl = http://soap.amazon.com/schemas3/AmazonWebServices.wsdl
}
We defined 4 partner programs. Instead of webservice-20 you would enter your own partner ID.I have listet all available amazon partner program's wsdl files, so you can quickly enter those you need.How do we tell a plugin, which partner program it should use?
Simply by entering the index of the wanted partner program as a parameter in the plugins CODE field.To test this, we create a second FORM plugin on the “FORM and LIST” page.In the CODE field we enter this line:FORM:PROGRAMUID=2;
This means we search in the us – locale domain.
If you now go to the “FORM and LIST” page, you have got 2 plugins.Use the first and then the second plugin and you will see, how it works.
Adminstration¶
Installation¶
At first, you have to install the extension from the repository. There will be two errors displayed. Never mind about them they are caused because the imported libraries don't fit to typo3's naming guidline, they have no effect on the extensions functionality.
Configuration¶
After installing the extension, you MUST enter some values in the constants of your template:
The developer token is a string, which you can get from amazon. Without this token, you won't get any results from the webservice.
The associateID is a partner ID, you can get from amazon partner program. If you enter this ID here, all resulting hyperlinks will have this ID coded in them. If a visiter from your page follows such a link and buys a product at amazon afterwards, you will get a percantage of the sale.
WSDL URL leads to the wsdl of the amazon site. Default value is the wsdl for the german amazon site, but there are wsdl's for more countries, too. For more informationhave a look at amazon's webpages.
Resultype defines if you get an lite or a heavy result set. At the moment, only lite is imlemented. The corresponding dtd's can be achieved at amazon.
If you want, that a link from your site to amazon should open in another window, you can enter the name of the new window here. If it should open in the same window, where your typo runs, you can leave the default value (“_self”).
For a firsttime installation you dont have to think about wsdl, resulttype, associateID or framename, you can leave them at their defaults, BUT you MUST enter a developer token.
TyposScript setup¶
THIS IS THE PART from the older Version of eim2amazon search, I have no time to update it completely, but with this information, and if you have a look in typoscript setup, I am sure you will know, what you have to do.
After installation and basic configuration, you want to fit the design of the plugin with your website's design. In the object browser of the template section you find in the setup of the eim2amazonsearch extension a key “layout”, there you can find the standard layout.
To use a different layout, it is the easiest way to copy and paste the value of this key into a file, perhaps “tpl_amazon.htm”. Copy this file to the fileadmin folder of your typo installation. In the setup of your template you now change the value of the key in the following way:
plugin.tx_eim2amazonsearch_pi1.layout = FILEplugin.tx_eim2amazonsearch_pi1.layout.file = fileadmin/path/to/template/tpl_amazon.htm
This template file consists of several sections:
layout part¶
<!--###LAYOUT### begin-->###SEARCH_FORM######SEARCH_RESULTS######BAC K_LINK###<!--###LAYOUT### end-->
Layout, here are the markers for the different parts of the plugins interface.You should not change them, there is no design information within this section.
searchform details¶
<!--###SEARCH_FORM_DETAILS### begin--><script language="javascript"><!--//function changeMode(){###JAVASCRIPT###formName = "tx_eim2amazonsearch_pi1[searchform]";searchType = "tx_eim2amazonsearch_pi1[searchtypeselect]";searchMode = "tx_eim2amazonsearch_pi1[searchmodeselect]";selectedIndex = document .forms[formName].elements[searchType].selectedIndex;selectedValue = do cument.forms[formName].elements[searchType].options[selectedIndex].val ue;target = document.forms[formName].elements[searchMode];newlength = values[selectedValue].length;target.options.length = newlength;for (i=0;i<newlength;i++){target.options[i].text = text[selectedValue][i];target.options[i].value = values[selectedValue][i];if (values[selectedValue][i] == defvalue[selectedValue])target.selectedIndex = i;}return true;}//--></script><table class="tx-eim2amazonsearch-pi1-searchForm" width="100%"><form action="###PAGELINK###" method="POST" name="tx_eim2amazonsearch_pi1[searchform]"><tr><td class="tx- eim2amazonsearch-searchlabel">###SEARCH_LABEL###</td><td class="tx- eim2amazonsearch-searchinput"><INPUT type="text" name="tx_eim2amazonsearch_pi1[searchString]" value="###SEARCHSTRING###"></td></tr><tr><td class="tx- eim2amazonsearch-searchtypelabel">###SEARCH_TYPE_LABEL###</td><td class="tx-eim2amazonsearch-searchtypeselect"><select name="tx_eim2amazonsearch_pi1[searchtypeselect]" onchange=" javascript:changeMode ();">###SEARCH_TYPE_OPTIONS###</select></td></tr><tr><td class="tx- eim2amazonsearch-searchmodelabel">###SEARCH_MODE_LABEL###</td><td class="tx-eim2amazonsearch-searchmodeselect"><select name="tx_eim2ama zonsearch_pi1[searchmodeselect]">###SEARCH_MODE_OPTIONS###</select> </td></tr><tr><td> </td><td class="tx-eim2amazonsearch- searchsubmit"><INPUT type="hidden" name="tx_eim2amazonsearch_pi1[searchsubmit]" value="submitted"><INPUT type="image" class="tx_eim2amazonsearch_pi1[searchsubmitbutton]" name="tx_eim2amazonsearch_pi1[searchsubmitbutton]" alt="###SUBMIT_LABEL###" src="fileadmin/templates/images/amazon/searc h.gif"></td></tr></form></table><!--###SEARCH_FORM_DETAILS### end-->
markers:
JAVASCRIPT¶
The search form contains a javascript, which is called, when the search type is changed. If this happens, the search mode field is automatically changed, too. If the user changes the search type from “Actor Search” to “Artist Search” the available search modes are changed from “dvd, vhs video, video” to “music, classical”.If the client browser does not support javascript, this javascrip will have no effect, but the plugin on the server side will change the search modes. In this case there will be a standard mode used for the first search. There is a marker “JAVASCRIPT” within the script. This marker is replaced corresponding to the settings in your typoscript setup.
PAGELINK¶
This marker returns a link to the page with the search form – don't touch this.
SEARCH_LABEL and SEARCHSTRING¶
This is the label for the string, which you search for. You can define the value in the language file, so the plugins language will be changed automatically, when the user changes his locale. Searchstring is the string, the user searches for. This is reentered in the text- input field of the form.
SEARCH_TYPE_LABEL and SEARCH_MODE_LABEL¶
The labels for the search types and modes, define them in the language settings.
SEARCH_TYPE_OPTIONS and SEARCH_MODE_OPTIONS¶
The options for the select fields – don't touch them.
You see, there are classes defined for nearly all fields, so it is easy to change the look and feel of the plugins interface by css style sheets.
Search result list¶
<!--###SEARCH_RESULT_LIST### begin-->###STATISTICS######NAVIGATION###<table class="tx- eim2amazonsearch-pi1-searchResults" width="100%">###ITEMS###</table>## #NAVIGATION###<!--###SEARCH_RESULT_LIST### end-->
STATISTICS¶
displays how many items where found, how many pages and the actual page number.
ITEMS¶
In this area the results are inserted.
In the design above, the navigation part is displayed on the bottom of the results again, this makes it easier for the user to navigatethe results.
Display Fields¶
<!--###DISPLAYFIELDS### begin--><tr><td class="tx-eim2amazonsearch- pi1-itemimage"><IMG src="###ImageUrlMedium###" alt="" width="97"></td><td class="tx-eim2amazonsearch-pi1-details"><TABLE class="tx-eim2amazonsearch-pi1-detailtable" width="100%"><tr><td class ="tx-eim2amazonsearch-pi1-itemnumber" valign="top">###ITEMNUM###</td><td class="tx-eim2amazonsearch- pi1-itemlink"><!--###Url### begin-->###ProductName###<!--###Url### end --></td></tr>###LISTFIELDS###</TABLE></td></tr><!--###DISPLAYFIELDS### end-->
Display Fields are fields of the query result data set, which should always be displayed. In the example above this are: ImageUrlMedium, ITEMNUM, Url and ProductName.ITEMNUM ist the absolute number of the item in the data set. Url is the link to this item at amazon.For other fields look at the dtds.The marker LISTFIELDS inserts all the other fields, which can occure in the result dataset, but which are optional.
For example, with a book, you can get several authors, with a DVD you can get Actors. Read more about list and display fields further in this document.
Listfields¶
<!--###LISTFIELD### begin--><tr><td class="tx-eim2amazonsearch- pi1-itemlabel">###RESULT_LABEL###</td><td class="tx-eim2amazonsearch- pi1-item">###RESULT_ITEM###</td></tr><!--###LISTFIELD### end-->
There are only two markers for the listfield, a LABEL and a ITEM marker. The labels for all fields can be defined in the language section (locallang.php)
NoResults¶
<!--###NO_RESULTS### begin--><table class="tx-eim2amazonsearch- pi1-searchResults"><tr><td class="tx-eim2amazonsearch-pi1-noresult">## #NO_RESULTS_TEXT###</td></tr></table><!--###NO_RESULTS### end-->
This part is displayed, if the result data set is empty. The text, which is displayed for the marker NO_RESULT_TEXT can be defined in locallang.php.
ErrorPart¶
<!--###ERRORPART begin--><table class="tx-eim2amazonsearch- pi1-searchErrorpart"><tr><td class="tx-eim2amazonsearch- pi1-errorlabel">###ERROR_LABEL###</td></tr><tr><td class="tx- eim2amazonsearch- pi1-errortext">###ERROR_TEXT###</td></tr></table><!--###ERRORPART### end-->
This part is displayed, when an error occurs while connecting to amazon (maybe the amazon servers are down, or maybe you entered a wrong url to the wsdl file, or maybe something else ;-)
Statistictable¶
<!--###STATISTICTABLE### begin--><TABLE class="tx-eim2amazonsearch- pi1-stat" width="100%"><TR><TD class="tx-eim2amazonsearch- pi1-statLabel" width="75%">###LABEL_NUM_RESULTS###</TD><TD class ="tx-eim2amazonsearch- pi1-statItem">###NUM_RESULTS###</TD></TR><TR><TD class="tx- eim2amazonsearch-pi1-statLabel" width="75%">###LABEL_NUM_PAGES###</TD><TD class="tx- eim2amazonsearch-pi1-statItem">###NUM_PAGES###</TD>
</TR><TR><TD class="tx-eim2amazonsearch-pi1-statLabel" width="75%">###LABEL_ACTUAL_PAGE###</TD><TD class="tx- eim2amazonsearch-pi1-statItem">###ACTUAL_PAGE###</TD></TR></TABLE><!- -###STATISTICTABLE### end-->
Displays the labels and items for the number of results, number of pages and the actual page number.
Navigation¶
<!--###NAVIGATIONITEMS### begin--><table class="tx-eim2amazonsearch- pi1-nav" width="100%"><tr><td class="tx-eim2amazonsearch- pi1-navfirst"><!--###FIRSTPAGE_LINK### begin--><IMG SRC="fileadmin/templates/images/amazon/first.gif" ALT="###FIRSTPAGE_LABEL###" border="0" width="36" height="19"><!--###FIRSTPAGE_LINK### end--></td><td class="tx- eim2amazonsearch-pi1-navprev"><!--###PREV_TEN_LINK### begin--><IMG SRC="fileadmin/templates/images/amazon/prev.gif" ALT="###PREV_TEN_LABEL###" border="0" width="20" height="19"><!--###PREV_TEN_LINK### end--></td><td class="tx- eim2amazonsearch-pi1-navpages">###NAVIGATIONPAGES###</td><td class ="tx-eim2amazonsearch-pi1-navnext"><!--###NEXT_TEN_LINK### begin--><IMG SRC="fileadmin/templates/images/amazon/next.gif" ALT="###NEXT_TEN_LABEL###" border="0" width="20" height="19"><!--###NEXT_TEN_LINK### end--></td></tr></table><!--###NAVIGATIONITEMS### end-->
<!--###NAVIGATIONPAGE### begin--><!--###NAVIGATION_PAGE_LINK### begin-->###PAGE_NUM###<!--###NAVIGATION_PAGE_LINK### end--> <!--###NAVIGATIONPAGE### end-->
In NAVIGATIONITEMS are the markers for the “first page”, “next page” and “prev page” defined. Each of them has its ownlabel, which can be defined in locallang.php. In the example above these labels are used as the alt information of an image tag. This markers are only diusplayed, if they are necessary. If you are already on the first page, then you don't need a first page link. This marker will then be replaced by an empty string.The marker NAVIGATONPAGES will be substituted by ten links to different pages (1..10 or 11..20,...).Each of these links is designed like defined in NAVIGATION_PAGE and NAVIGATION_PAGE_LINK.
Back link¶
<!--###BACK_LINK_PART### begin--><table class="tx-eim2amazonsearch- pi1-backlink" width="100%"><tr><td><!--###BACK_LINK_HREF### begin-->###BACK_LINK_LABEL###<!--###BACK_LINK_HREF### end--></td></tr></table><!--###BACK_LINK_PART### end-->If you use different pages for search form(s) and search results, then there will be displayed a back link in the results, which leads back to the calling search form. You can change teh design in the BACK_LINK_PART.
Configuration¶
This is outdated, too, have a look in TSSETUP for all new features.
searchtypes and searchmodes¶
Most of the configuration of the design is explained in the section before. In this section the configuration of the searchform and result fields will be explained.There are several kinds of searches available at amazon. This extension supports only such searchtypes, which have a data set called “details” in the result set.Here are the definitions in the standard setup:
plugin.tx_eim2amazonsearch_pi1.searchtypemodes{ActorSearch.modes = dvd,vhs,videoActorSearch.default = dvdArtistSearch.modes = music,classicalArtistSearch.default = musicAsinSearch.modes = nomodeAsinSearch.default = nomodeAuthorSearch.modes = booksAuthorSearch.default = booksDirectorSearch.modes = dvd,vhs,videoDirectorSearch.default = dvdKeywordSearch.modes = baby, books, classical, dvd, electronics, garden, kitchen, magazines, music, pc-hardware, photo, software, toys, universal, vhs, videogamesKeywordSearch.default = booksManufacturerSearch.modes = electronics, kitchen, videogames, software, photo, pc- hardwareManufacturerSearch.default = software}
This is a mapping of each available searchtype to the corresponding search modes and the default value for the searchmode of a specific searchtype.If you want, that your users can only search within a subset of this searchtypes you only have to delete the lines of the searchtypes, you don't want to have. Provided by your searchform.
As explained above, amazon provides two types of result information: heavy and lite. The heavy infomration provides a lot of information, which I didn't need for my aplication, so I decided only to support the lite type. If you want more information on both kinds of result data sets, visit amazon.com and search for heavy and lite dtd, which describe both in the XML language.
FAQ¶
Reference¶
NOT ACTUAL ANYMORE! I am laking in time to do that, have a look in TSSETUP...
constants¶
dev_token¶
Property
dev_token
Data type
String
Description
Your amazon developer token
Default
assoc_id¶
Property
assoc_id
Data type
String
Description
Your amazon partner ID. If you enter your ID here, all links produced by the pluginin will contain your partner ID.
Default
soap_wsdl¶
Property
soap_wsdl
Data type
String
Description
Path to the amazon wsdl file. See amazon documentation for different wsdl files for different countries.
Default
locale¶
Property
locale
Data type
String
Description
Defines the language of the amazon results.
Default
searchtype¶
Property
searchtype
Data type
String
Description
Default Search Type
Default
KeywordSearch
resultType¶
Property
resultType
Data type
String
Description
Lite (Heavy not supported now)
Default
lite
framename¶
Property
framename
Data type
String
Description
Name of the window/frame, where links to amazon should be opened.
Default
_self
setup¶
searchtypemodes¶
Property
searchtypemodes
Data type
Object/Array
Description
Mapping of all available searchtypes to their searchmodes and default searcmode values
Default
listfields¶
Property
listfields
Data type
Array
Description
If a field of this array occures in the result data set, the field is displayed in the listfields section wrapped as a standard “RESULT_ITEM”
Default
displayfields¶
Property
displayfields
Data type
Array
Description
This fields have their own markers in the DISPLAYFIELDS section of the templates.
Default
layout¶
Property
layout
Data type
HTML
Description
Design Template
Default
Known problems¶
To-Do list¶
- Caching!
- All parameters are passed with url parameters, which enlarges the url really. I think some of those parameters should be stored in a session object.
- Logging
- Backend Module for easy customizing the plugins (parser and editor for the plugins code fields) and doing statistics over loggin, clearing the cache...
- flash interface for teasers
- programming structure was devided into model/view/controller, but it is far from beeing perfect/correct.Refactoring of the code would be good.
- Documentation of the code
- Flash tutorial / video tutorial
Changelog¶
New in Verion 2
- TEASERS
- DETAILS
- partner programs
- heavy dtd
Changes in previsious Versions
- now the plugin recognizes errors which can occure while establishing a connection to amazon. The template is expanded by “###ERROR_PART###” and the language file has an additional label. Have a look at setup and language.php.
- There was a bug in the class amazonsearch.class. The class always used the german wsdl file, now it uses the wsdl file you specify in the constant part.
- 19