I am trying to get 6.x-1.x-dev working with my own ddblock theme so that I can change the image sizes. I set the Block Admin Template drop-down to "Custom". I populated the Custom Template text field with my custom theme name "uprightfg1" and created a pair of .tpl.php files under mytheme/custom/modules/ddblock called ddblock-cycle-block-content-uprightfg1.tpl.php and ddblock-cycle-pager-content-uprightfg1.tpl.php.
I also created my own CSS under mytheme/custom/modules/ddblock/uprightfg1 called ddblock-cycle-uprightfg1.css.
However when I cleared the cache and displayed the page with my block on, I got no output from the theme call in ddblock.module.
$block_content = theme(
'ddblock_cycle_block_content',
$settings,
$content
);
I debugged through the theme()
function and found that the .tpl.php files were not being discovered, because - I think - the $settings['template'] array item was still set to 'custom' and the name of my custom theme was in $settings['custom_theme'] which I don't think theme()
recognises.
Changing the line that sets $settings['template']
to do this:
'template' => ($template == 'custom' ? $custom_template : $template),
resulted in my .tpl.php files being discovered.
Can anyone confirm this issue?
Comments
Comment #1
sp3boy CreditAttribution: sp3boy commentedInvestigating a different problem, I spotted this code in ddblock.module function
template_preprocess_ddblock_cycle_block_content()
. I'm wondering if my previous workaround was hitting the problem in the wrong place and the candidate template files are not being discovered because $vars['ddblock_template'] is never set?The equivalent code in
template_preprocess_ddblock_cycle_pager_content()
looks more sensible:Comment #2
sp3boy CreditAttribution: sp3boy commentedWell my second idea is OK as long as all the references to $settings['template'] in the custom .tpl.php files are changed to $settings['custom_template'], otherwise the custom CSS is not loaded and the DIV.ddblock-cycle-custom template class will not match the CSS.
Comment #3
ppblaauw CreditAttribution: ppblaauw commentedAt the Create a new custom ddblock theme part of the advanced slideshow tutorial you can read what steps have to be done when creating your own custom ddblock theme. One of the steps is changing $template to $custom_template.
Using 'ddblock_template' in the code below is a bug
It should be:
Thanks for finding this bug.
I think this will solve the issue, please let me know.
Comment #4
sp3boy CreditAttribution: sp3boy commentedThanks for the link to the tutorial - I think your code suggestion matches my thoughts except for the first line - shouldn't that be
$settings['template']
, as in:Comment #5
ppblaauw CreditAttribution: ppblaauw commentedYou are right, it should be:
Thanks again
Committed this to the dev release
That it still work, comes from the line