Hi,
I am trying to use a themename_alpha_hook() function (in particular, hook=user-register-form), and it is not working. If I place this preprocess function in my template.php, it works without a hitch.
I created a file called "preprocess-user-register-form.inc" in my preprocess folder, and the following are it's contents:
<?php
/**
* Implements hook_preprocess_user_register_form(&vars);
* Used to override default registration form.
*/
function themename_alpha_preprocess_user_register_form(&$vars) {
kpr($vars);
$vars['intro_text'] = t('This is my super awesome registration form.');
}
This does work in my template.php file. Furthermore, this is what I had in my template.php file:
/**
* Implements hook_theme()
* Used to customize the user registration page.
* @return items array
*/
function themename_theme($existing, $type, $theme, $path) {
$items = array();
$tpl_path = drupal_get_path('theme', 'themename') . '/templates';
$items['user_register_form'] = array(
'render element' => 'form',
'path' => $tpl_path,
'template' => 'user-register-form',
'preprocess functions' => array(
'themename_alpha_preprocess_user_register_form'
),
);
return $items;
}
Could it be because of the preprocess function within the themename_theme()?
Regardless, I saw that many users were having similar issues and figured that I would ask here for support.
Thanks in advance!
Comments
Comment #1
Elijah LynnConfirmed, same here.
Comment #2
candelas CreditAttribution: candelas commentedsame here
Comment #3
candelas CreditAttribution: candelas commentedComment #4
candelas CreditAttribution: candelas commentedi kept reading and searching and it looks that if you have context module, the preprocess-node.inc or preprocess-page.inc will not work.
https://drupal.org/node/1317110
so i am going to try in the template.tpl.php since i have all the site already made...
Comment #5
candelas CreditAttribution: candelas commentedComment #6
candelas CreditAttribution: candelas commentedComment #7
candelas CreditAttribution: candelas commentedhello and sorry for my bad english :)
i just realize that must be something with the $varibables scope because if i make print, it is made.
what i pretend to do is to hide the nodes from the taxonomy/term/tid
if i uncoment print "hola"; it gets printed.
if i uncoment //dpm($vars, "vars") ;
i see that it shows $vars['page']['content']['content']['system_main']['nodes']
i have tried also (with and without the extra ['content']) with not success
i have disable context i this happens also. so i think this module it is not the reason...
do you have any clue about this, please? or how can i find the reason?
at the moment i have resolved the nodes with the node.tpl.php and with css the pager and no_content, but i would like to be able to use theme functions of this kind (other functions that doesnt use $variables work).
thanks :)
Comment #8
candelas CreditAttribution: candelas commentedmore on it :) (thinking in other people having this problem)
i found that if i am not logged, it works with
but not if i am logged
so some module its making me crazy :(