Pageroute kills node form theme override
Tannerjf - March 2, 2009 - 06:37
| Project: | Pageroute |
| Version: | 5.x-1.1 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Hello, I've got my registration process setup using a pageroute. The 2nd step of the pageroute goes to the add nodeprofile form, and I would like to theme it per this guide: http://drupal.org/node/101092 However, the override isn't working. As far as I can tell, it's because the override relies on arguments passed through the URL, which aren't there with the pageroute setup. I've only been able to find one solution, but it involves using a small hacked-together module instead of pageroute (http://drupal.org/node/237225). How can I get this to work using pageroute? I really need to be able to theme the nodeprofile form.
Code used in template.php:
//Profile-Add Override//
// Add Form
if ((arg(0) == 'node') && (arg(1) == 'add') && (arg(2) == 'profile')){
function phptemplate_node_form($form) {
return _phptemplate_callback('node-profile-add', array('user' => $user, 'form' => $form));
}
}
#1
Update: As I've received no help on this matter, I've continued to try a couple things. I did find in regards to another module (og user roles) which also affects the form's arguments, that I am able to get template.php to override the specific form id value. Example:
//OG Node Form Overrides//// Add Form
if ((arg(0) == 'node') && (arg(1) == 'ognodeadd')){
function phptemplate_node_form($form) {
if ($form['form_id']['#value'] == 'meeting_node_form') {
return _phptemplate_callback('node-meeting-edit', array('form' => $form));
}
if ($form['form_id']['#value'] == 'project_storyboard_node_form') {
return _phptemplate_callback('node-project_storyboard-edit', array('form' => $form));
}
}
}
However, when I try something similar pageroute, it still ignores it!
//Profile Add Overridefunction phptemplate_node_form($form) {
if ($form['form_id']['#value'] == 'profile_node_form') {
return _phptemplate_callback('node-profile-edit', array('form' => $form));
}
}
I found the Drupal for Firebug module and was able to also find the form "pageroute_page_step2_form" in effect. I tried overriding this as well with no luck. I also tried overriding "$form['page_form']['#id'] == 'profile_node_form" with no luck.
I am absolutely confused as to why pageroute is killing *any* override I try to make. Using the Profile Add Override code example above works flawlessly when viewing the node profile outside of pageroute. I would very much appreciate any help that could be offered with this, as I am at a loss.