Closed (duplicate)
Project:
Amazon Product Advertisement API
Version:
6.x-1.0-beta3
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
2 Jul 2008 at 23:49 UTC
Updated:
14 Jul 2008 at 17:14 UTC
I am trying to create a new version of amazon-item-book-details.tpl.php. I have tried copying the file from the amazon_media folder to my theme folder and modifying it there, but this does not work. I have tried renaming that copy {theme_name}-amazon-item-book-details.tpl.php but this does not work either.
Is it possible to override an Amazon module template file, and if so, how?
Thanks.
Comments
Comment #1
devonharper commentedI have gotten a copy of amazon-item-book-details.tpl.php to work from my theme directory by modifying my copy of the sites/all/modules/amazon/amazon_media/amazon_media.module file. I have added the following to line 33:
$theme_registry['amazon_item']['theme paths'][] = path_to_theme();I am sure that this is the wrong way to do this, but can someone tell me what is the correct method? I tried recreating the hook_theme_registry_alter() function within my template.php file, but this had no success.
Comment #2
eaton commentedIt should be possible to simply copy one of the files and place them in your theme directory like any other template. The theme registry has to be reset obviously, but it should still work.
I'll investigate further. Thanks!
Comment #3
eaton commentedTurns out, this is a bug in the theme system (#279573: Themes can't use node-story.tpl.php without node.tpl.php). I'm working on a core patch to fix the problem, but in the meantime, you need to copy amazon-item.tpl.php from the amazon folder to your theme's folder. As long as it exists inside your theme directory, all of the other variations (like amazon-item-dvd-details.tpl.php etc) will be recognized properly.
Comment #4
devonharper commentedThank you Eaton. I will undue my fix and use your technique.
I have one further question in this direction. Is there someway to assign the amazon-item class (or one of its varients) to the div.content that contains that node's content? I am looking for a reliable way to style the container of a node that has amazon data.
Thanks!