Drupal/Omega Newbie Question - Register function to the registry

Events happening in the community are now at Drupal community events on www.drupal.org.
frankytown's picture

Hi,

I have been trying to customize the html output of the user login block using Drupal 7 and my Omega sub-theme.

By reading Omega documentation, I thought what I needed to do if to create a file block--user_login.tpl.php in my templates subdirectory and Omega will take care of registering this new file to the theme registry. Apparently, that's not how it works.

Second, I tried registering myself the fucntion in my template.php file in my sub-theme directory think the block--user_login.tpl.php will be picked up. No chances again.

function mytheme_theme() {
$items = array();

$items['user_login'] = array(
'render element' => 'form',
'path' => drupal_get_path('theme', 'mytheme') . '/templates',
'template' => 'user_login',
'preprocess functions' => array(
'mytheme_preprocess_user_login'
),
);

return $items;
}

What am I missing here?

Thanks!

Comments

This tutorial actually

What is the difference?

frankytown's picture

Hi Jeb,

Thanks for your answer.

I actually want to understand a bit better the mecanic. It looks like to approach are possibles : altering the form as your tutorial suggest or using the theme system as described here.

http://drupal.org/node/350634

For my own knowledge, I would like to know how to override templates in my templates sub-folder.

Omega Framework

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: