I have modified a Global module so that it has a 2nd .tpl file. The original .tpl file is for sites using Zurb Foundation 5, the newer one I created is for sites using Zurb Foundation 6. Because this is a global module, these files exist in the same directory.

I've named the newer .tpl inline with what Theme Debug suggests (image_resp_item--f6.tpl.php).

Now, I've just got to tell the site that when it's using Foundation 6 to preference the .tpl named image_resp_item--f6.tpl.php.

However, I'm completely lost at where to start with this. Is this something I set up on the module's .module file? Or something I set up on each sites template.php file? Is there a hook I can use?

Sorry its kinda vague - been dumped in the deep end here - any advice is appreciated.

  • what makes your site using F6 ?
    – rémy
    Commented Mar 15, 2017 at 7:59
  • @rémy someone else's module I think
    – MeltingDog
    Commented Mar 15, 2017 at 22:55
  • I mean - what defines the use of Foundation 5 or 6 ?
    – rémy
    Commented Mar 16, 2017 at 7:49

1 Answer 1


Update the modules weight in the DB.

This code is for a custom module, when enabled:

 * Implements hook_enable()
function YOUR_MODULE_enable() {
    ->fields(array('weight' => 1))
    ->condition('type', 'module')
    ->condition('name', 'YOUR_MODULE')
  • Sorry, I don't think this is what I'm after. The module works fine, I just want it to preference one of 2 .tpls contained within it.
    – MeltingDog
    Commented Mar 15, 2017 at 1:06
  • true - it's more about non theme hook_s. but maybe a simple workaround ..
    – rémy
    Commented Mar 15, 2017 at 7:57

Your Answer

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

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