I built a custom login module for my Drupal7.26 install.
Extending it, I've added a *.tpl.php locally
ls sites/all/modules/custom/jl_login/templates/
user-login-member-form.tpl.php
To get the tpl.php into theme registry, in "my_login_mod.module" I added
function jl_login_theme() {
return array(
'user_login_member_form' => array(
'render element' => 'form',
'template' => 'templates/user-login-member-form',
)
);
}
After module disable/uninstall/enable, and clear all caches, I load my site/page.
Checking output with
<?php print '<pre>'; var_dump(theme_get_registry()); print '</pre>'; ?>
I see the form in the registry
["user_login_member_form"]=>
array(6) {
["render element"]=>
string(4) "form"
["template"]=>
string(76) "sites/all/modules/custom/jl_login/templates/user-login-member-form"
["type"]=>
string(6) "module"
["theme path"]=>
string(43) "sites/all/modules/custom/jl_login"
["preprocess functions"]=>
array(1) {
[0]=>
string(19) "template_preprocess"
}
["process functions"]=>
array(2) {
[0]=>
string(16) "template_process"
[1]=>
string(14) "ctools_process"
}
}
Later in my .module, I use the form:
function _jl_login_login_block_view($delta='') {
$this_user_login_form = drupal_get_form('user_login_member_form');
...
But on load I see in drupal logs,
Feb 24 16:32:16 dev d7: http://dev.loc|1393288336|php|127.0.0.1|http://dev.loc/||0||Notice: Undefined index: user_login_member_form in drupal_retrieve_form() (line 771 of /home/jl/d7/includes/form.inc).
Feb 24 16:32:16 dev d7: http://dev.loc|1393288336|php|127.0.0.1|http://dev.loc/||0||Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'user_login_member_form' not found or invalid function name in drupal_retrieve_form() (line 806 of /home/jl/d7/includes/form.inc).
What do I need to change to be able to use/reference the local form?
user-login-alt-form.tpl.php
yet referencinguser-login-member-form
, eg-alt-
vs-member-
? – Jimajamma Feb 25 '14 at 1:47