I’m having a difficult time getting a view mode on an FPP to use my custom .tpl.php file.
Here is hook_preprocess
:
function mymod_preprocess(&$variables, $hook) { $element = $variables['elements']; if ($element['#entity_type'] == 'fieldable_panels_pane') { $entity_type = $element['#entity_type']; $bundle = $element['#bundle']; $view_mode = $element['#view_mode']; $variables['theme_hook_suggestions'][] = "{$entity_type}__{$bundle}__{$view_mode}"; $variables['theme_hook_suggestions'][] = "fieldable-panels-pane-banner-banner-full-bleed"; kpr($variables); } }
The relevant output of the kpr()
(the theme_hook_suggestions
part of it:
array(3) { [0]=> string(29) "fieldable_panels_pane__banner" [1]=> string(48) "fieldable_panels_pane__banner__banner_full_bleed" [2]=> string(46) "fieldable-panels-pane-banner-banner-full-bleed" }
I hard-coded that last one thinking that it might just be a mishap in the naming conventions. I’ve tried every combination of dashes and underscores that I can think of; theme_devel
isn’t suggesting any of the ones in theme_hook_suggestions
, the only ones it recommends are: panels-pane--fieldable-panels-pane--fpid-4.tpl.php < panels-pane--fieldable-panels-pane.tpl.php
I have the templates in /sites/all/modules/custom/mymod/templates
with the module file in /sites/all/modules/custom/mymod/mymod.module
.
Thanks for any direction!