Not sure if it is just me but the field-collection-item.tpl.php template doesn't seem to be working, along with its template suggestions.

I have a field collection called field_featured_images and according to the $variables array there are theme hook suggestions such as field_collection_item__field_featured_images.

I can successfully use template_preprocess_field_collection_item__field_featured_images() but I can't seem to use an equivalent template file.

I have tried field-collection-item--field-featured-images.tpl.php & field-collection-item--field_featured_images.tpl.php but they don't seem to work.
I have tried with and without a field-collection-item.tpl.php in the same directory and that doesn't seem to matter.

Comments

rooby’s picture

Title: field-collection-item.tpl.php template suggestions don't seem to work » field-collection-item.tpl.php template doesn't seem to work
Priority: Normal » Major

Actually, the field-collection-item.tpl.php doesn't seem to work at all.

I have a field collection field set to use the "Field collection items" field formatter, and field-collection-item.tpl.php is never used.

Even if I directly modify the one in the field_collection module it doesnt' show the change.

It is hitting theme_field_collection_view but not field-collection-item.tpl.php

jmeyerson’s picture

Having the same problem, my field-collection-item.tpl.php seems to have no effect. Even deleting the original file doesn't change anything. Anyone besides myself and rooby experiencing this?

marcus178’s picture

I'm having issues with it too although updating to dev version it at least seems to recognise the template.

I have a template call field-collection-item--field-slides.tpl.php and the following prints the fields info.

dpm($content);

However that's about it, I can delete everything in the template but it will display as normal and trying to hide fields such below has no effect.

hide($content['field_image']);
marcus178’s picture

Issue summary: View changes

Changing to note that the field-collection-item.tpl.php itself isn't working.

drubb’s picture

Maybe you're using Display Suite? Field collection item template won't work in conjunction with DS, it work's fine if used standalone.

hefox’s picture

Issue summary: View changes

Try devel themer to see what's happening

sriharsha.uppuluri’s picture

I have edited field-collection-item.tpl.php in the module file directly putted lorem ipsum its not printing then just putted the die function even though page is loading.
I'm using drupal 7.34 devel themer is not supporting this vesrion.

jmuzz’s picture

Status: Active » Closed (duplicate)