- i am using the zen theme, drupal 6, cck rc4.
- i have double-triple checked that the file is named exactly as suggested (copied and pasted an double triple checked)
- i have tried moving the file from my sub-theme folder to the zen theme folder then outside the theme folder...
- i have emptied the cache through the devel module sidebar, and also /admin/settings/performance
- i have edited and saved the content to double trip check...

but it just won't allow me to override this template.

Themer Info tells me I have a Template called:
content-field.tpl.php
File used:
sites/all/modules/cck/theme/content-field.tpl.php
Candidate template files:
content-field-field_image-project.tpl.php < content-field-project.tpl.php < content-field-field_image.tpl.php < content-field.tpl.php < content-field.tpl.php

i tried creating the
content-field-field_image-project.tpl.php
and also tried
content-field-field_image.tpl.php
... and did all the things listed above...

what am i misunderstanding? is it not supposed to work the way i expect?

is there a secret hidden step?

Comments

yched’s picture

In order for your template variant to be found, both the original content-field.tpl.php and your content-field-field_image.tpl.php variant have to be present in your theme's directory - not *just* the variant.

heather’s picture

Category: support » bug

thank you yched! that is exactly what I needed!!

works a charm now.

how was i supposed to know to do that?

i think the README.txt is a bit obtuse and even vague.

Those template variants should be placed in your theme's root folder.
Please note that your theme's content-field-xxxxxx.tpl.php variants will not
get called if the generic content-field.tpl.php template is not present as well.

That's a double negative. They should be avoided like the plague of instructional text. And it doesn't say where it should 'be present'... if my module is uploaded, then the file is *present*?

How about something more pithy and clear:

To use template variants, you must place both your template variant and a copy of the original content-field.tpl.php in your theme's root folder.

not sure if it's a bug report, but i think it would be good to be fixed...

yched’s picture

You're probably right.
I changed that part of the README to use the 'official' terminology (base tempate / suggestions), and added a reference to the theming handbook page about suggestions (http://drupal.org/node/223440)

hass’s picture

Couldn't we change the suggestion here? I don't know why the content-field.tpl.php from the module is not used... but I think it should fallback to the module file if a theme override is not found. This sounds not very logic as it is written everywhere that we only need to place template files in the theme for things we'd like to override!?

yched’s picture

Status: Active » Fixed

This is not in our hands. This is the way core theming works, nothing cck can do about it. See http://drupal.org/node/279573

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

ressa’s picture

I was going crazy over this too, thank you for the help yched.

StephenRobinson’s picture

Hi,

I am using taxonomy acces control with a custom page called group page. I am trying to make a tpl file to change the list of allowed taxonomies for the role/user, has anyone tried this with CCK?

I have a CCK type group_page which has a select list field called edit-taxonomy-1

I am trying tpl files like content-field-edit-taxonomy-1.tpl.php content-field-edit-taxonomy-1-group_page.tpl.php and nothing works, no cache or copying content-field.tpl.php issues.

StephenRobinson’s picture

I used function mytheme_taxonomy_term_select($element), as I couldnt get content-field-edit-taxonomy-1.tpl.php to work,
Stephen :)

davidgeilfus’s picture

Hello,

I encounter the same problem: I have copied content-field.tpl.php to my theme folder, duplicated and renamed it to content-field-field_project_date_value.tpl.php to theme the field_project_date_value field, but it doesn't work.
I have cleared all caches but it doesn't seem to be the problem.

Thank you in advance!

David