I'm using Display Suite to generate a page.

Here I have a amazon field called ASIN. I display it using "link-to-item."

I have copied a version of "amazon-inline-item.tpl.php" to my own template folder.

For some reason I can't get it to read from that tpl file in my theme.

Any suggestions?

Comments

rfay’s picture

Please try just copying/changing the template *without* display suite to see if Drupal knows how to do the right thing. It's possible there's a problem in hook_theme() or something.

madeby’s picture

Sadly this is very hard for me to test on this solution.

But is it correct that I just copy it? No need to rename it in some way?

It works with the field tpl. Where I use it as:
field--release.tpl.php

The content type is called "release"

rfay’s picture

Copy the file into your active theme and flush the theme registry (drush cc all).

But I don't guarantee that amazon-inline-item.tpl.php is the theme function for a field set to "link to item". You'll have to take a look and see what the correct theme tpl is. Look in the formatter in the asin module.

madeby’s picture

It is the asin_inline so it should be the one.

Can it be a Amazon Storage Cache thing? Tried to edit the tpl in the amazon module folder. Nothing happened.

rfay’s picture

You do have to clear the theme registry after moving files around, but you shouldn't have to do anything to change the tpl.php in the Amazon directory.

madeby’s picture

This is so strange. The other templates seems to work but not the inline one. The reason I know it is the correct tpl is that it is the only one with span tags.

Can it be that it is rendered from within the module and has no template?

madeby’s picture

For some reason the file in my module folder was named incorrectly.

If this is the case in the rc1 release it needs to be changed.

The correct name is:
amazon-item--inline.tpl.php

rfay’s picture

Patches are always welcome.

How did the field get themed at all then?

madeby’s picture

Have no idea. This is very strange but it works with amazon-item--inline.tpl.php.

Do not know if it is a DS issue.

willvincent’s picture

Status: Active » Fixed

This seems to have been resolved already based on previous comments..

However, for the record. This patch ensures the tpl should be named amazon-item--inline.tpl.php which follows the naming convention of the rest of the tpls.

Marking this fixed.

willvincent’s picture

Status: Fixed » Closed (fixed)