Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When I try to subtheme corporateclean i have trouble with search block.
Function in teplate.php search image in my theme.
$form['actions']['submit'] = array('#type' => 'image_button', '#src' => base_path() . path_to_theme() . '/images/search-button.png');
The problem is path_to_theme(). API.D.O
One of posible solutions is using drupal_get_path($type, $name):
$form['actions']['submit'] = array('#type' => 'image_button', '#src' => drupal_get_path('theme', 'corporateclean') . '/images/search-button.png');
Comments
Comment #1
gtsopour CreditAttribution: gtsopour commentedHello 5n00py,
thank you for this report.
5n00py, since you deal with CorporateClean subtheming, is it easy for you or anyone else who has free time to write a mini-documentation about CorporateClean subtheming. In this way we can help also other people about CorporateClean subtheming like
Thanks
/George
Comment #2
5n00py CreditAttribution: 5n00py commentedAny progress?
Comment #3
alexandreracine CreditAttribution: alexandreracine commentedThis is mostly a support request, not a bug.
If I am wrong, change it back.
Comment #4
mstrelan CreditAttribution: mstrelan commentedThis is a bug. Subthemes should work out of the box and not require workarounds. The approach in the OP is correct, simply replace path_to_theme() with drupal_get_path('theme', 'corporateclean'). The call to path_to_theme() is not safe in this instance. Same in corporateclean_preprocess_html().