0

I am using template_preprocess_block() to introduce a theme function like this:

$variables['theme_hook_suggestions'][] = 'block_system_main_front';

but adding MY_THEME_block_system_main_front() to my template.php file does not change anything, MY_THEME_block_system_main_front() is not being called.

How can I introduce a custom theme function using theme_hook_suggestions and then use it like I use theme_image_formatter() ?

1 Answer 1

1

theme_hook_suggestions is not for function suggestion, it is for template suggestion.

In your case:

$variables['theme_hook_suggestions'][] = 'block_system_main_front';

Drupal will try to load the file:

your_theme/templates/block-system-main-front.tpl.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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