I'm having a problem perhapx similar to #194, but in my case I cannot get an override for paragraphs-item.tpl.php to work at all.
I have a bundle named section and I can see this in by printing it out in my preprocess hook, as follows:
/**
* Prepare variables for paragraph-item templates.
*/
function hook_preprocess_paragraphs_item(&$variables) {
dpm($variables['paragraphs_item']->bundle);
}
But when I create a template file named paragraphs-item--section.tpl.php it is never called.
When I enable theme debug and look at the suggestions for overrides, I see the following:
FILE NAME SUGGESTIONS:
x paragraphs-item.tpl.php
* paragraphs-item--section.tpl.php
* paragraphs-item--section--paragraphs-editor-preview.tpl.php
* paragraphs-item--5.tpl.php
x paragraphs-item.tpl.php
I wonder if the problem is that paragraphs-item.tpl.php appears in here twice, at both ends. This would make that file "win" the selection process, regardless of which way the suggestions are checked.
In my preprocessor, I needed to remove the duplicate suggestion, as follows:
function hook_preprocess_paragraphs_item(&$variables) {
// Clean up theme hook suggstions.
$names = array();
foreach ($variables['theme_hook_suggestions'] as $key => $name) {
if (!in_array($name, $names)) {
$names[$key] = $name;
}
else {
unset($variables['theme_hook_suggestions'][$key]);
}
}
unset($variables['theme_hook_suggestion']);
}
I couldn't find where this extra suggestion is being added in paragraphs. Perhaps this is an entity_plus issue?
I'm having a problem perhapx similar to #194, but in my case I cannot get an override for
paragraphs-item.tpl.phpto work at all.I have a bundle named
sectionand I can see this in by printing it out in my preprocess hook, as follows:But when I create a template file named
paragraphs-item--section.tpl.phpit is never called.When I enable theme debug and look at the suggestions for overrides, I see the following:
I wonder if the problem is that
paragraphs-item.tpl.phpappears in here twice, at both ends. This would make that file "win" the selection process, regardless of which way the suggestions are checked.In my preprocessor, I needed to remove the duplicate suggestion, as follows:
I couldn't find where this extra suggestion is being added in paragraphs. Perhaps this is an entity_plus issue?