1

I'm using the TimeField module with a custom theme (a subtheme of the Bootstrap theme) and I want to change how the output is rendered.

There's a timefield.tpl.php file located at

sites/all/modules/timefield/theme/timefield.tpl.php

which I want to modify copying it to

sites/all/themes/my_theme/templates/

but when I do so the copy is ignored and the original file is loaded instead.

I'm a Drupal newbie but I like to learn, so any advice or link to a resource to understand where the problem lay is fine.

2
  • clear cache for site
    – monymirza
    Mar 27, 2013 at 5:40
  • Thanks for the suggestion, but it didn't work
    – Proteo
    Mar 27, 2013 at 6:14

1 Answer 1

1

Create tpl file for field field--field-name.tpl.php. place it to your theme.

if Field name is: field_page_photos
then File name will: field--field-page-photos.tpl.php

copy sites/all/modules/timefield/theme/timefield.tpl.php code to above tpl file. make changes and clear cache.

2
  • Cheered too soon... the new template loads OK, but there is a $time variable that is no longer recognized. Any advice?
    – Proteo
    Mar 27, 2013 at 6:34
  • create an issue at drupal.org
    – monymirza
    Mar 27, 2013 at 7:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.