Here is my use case:

I have lots of nodes that each correspond to an LCD TV model. There are over 500 of them. So I don't really want to manually find the ASIN for each one and manually put them in a CCK field.

Is it possible to do a search on the title of the node, and display the product info/image/price based on that? Or at least get an ASIN to do so from the search? This way each model node will automatically have the amazon product link displayed, and all I need to do is modify the .tpl file for the node type.

Thanks for the help!

Comments

rfay’s picture

This is your lucky day! See #950602: Add autocomplete widget for ASIN field that searches Amazon, which just went in a little while ago. Use the new autocomplete widget with your node type. Thanks to @frando.

Note that Amazon supports feeds, so you can import from a CSV file if you do have the information.

jazzdrive3’s picture

Well that certainly makes the module much more user-friendly for most use cases. And it makes it easy for future nodes I add. Thanks for the heads up. Is it currently only in the dev release?

However, is there anything I can do for current nodes? I suppose I could still add the cck field, but do I still need to manually go into each one and fill out the new field? Or is there a way to automatically populate it programatically?

Maybe I can make use of the autocomplete search code myself to come up with something.

rfay’s picture

Yes, it is in D6 dev; not in D7 yet.

You can change the widget used for your current content type, if that's what you're asking.

I'm not sure what you currently *have* as information. But I think you just want to change the widget for the content type.

jazzdrive3’s picture

All I have is the title of the product, like "Sony Bravia KDL-60EX700", which is the title of the node. And I just want to take that title and automatically create a link to the amazon product. Hopefully this is code I can just put in the content type .tpl file, so I don't have to manually edit 500+ nodes. It will just take the title of the node and pull the amazon information. Is this something I can accomplish by using this module?

What do you mean by widget type? What would that do?

If I end up having to use the CCK field, again I don't want to manually edit 500+ nodes to just copy and paste the title into it. So can the CCK field somehow be programatically populated with just the title and will that work to pull the correct info? I'm talking about just a database call to get all the node ids of the model content type, and then loopng through those and setting the cck field to the title field. Or will that not work, because the autocomplete adds something to the process?

Or can I use the search functionality built into this module to grab asin number based on the node title, and then plug that into the CCK field?

Thanks for the help!

rfay’s picture

Please try out the new widget in the dev version before continuing the conversation. A CCK widget is a way to enter something in a CCK field. We used to just have a text widget; now we have a title autocomplete widget as well.

If I were you I'd be writing a script that uses the Amazon API to look up your ASINs. I sure understand why you don't want to edit 500 nodes, but I don't think there's any built-in functionality that's going to help you.