custom theme template.php assigning node-form.tpl.php breaks conditional fields

rburgundy - November 7, 2009 - 04:24
Project:Conditional Fields
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

I am having trouble getting conditional fields to work on my theme. It works fine on Garland, however.

After troubleshooting I see that calling the below code in template.php breaks conditional fields functionality.
Removing the code allows conditional fields to work perfectly on my theme, but I am unable to customize the profile-node-form page without using the .tpl.php

From template.php:

<?php
function mytheme_theme() {
  return array(
   
'profile_node_form' => array(
     
'arguments' => array('form' => NULL),
     
'template' => 'profile-node-form',
    ),
  );
}
?>

Additionally, in Garland, looking at Firebug, it seems that the div that includes "conditional-field controlled-field" gets a style="display: none;" dynamically added to it (Changes to display: block;). This makes it work perfectly in Garland and my theme without the above code in template.php, but for some reason this style="display: none;" doesn't get added to the controlled field div when the code is included in template.php

Could anyone give me any pointers on this issue? I appreciate it.

#1

trupal218 - November 10, 2009 - 00:47

subscribing

#2

katiusha - November 26, 2009 - 13:22

I have the same problem, customizing the .tpl.php file for a content type with conditional fields breaks the conditional fields. Any pointers on how to fix this would be welcomed.

#3

peterpoe - November 28, 2009 - 00:06

Looks like rburgundy's and #2 problems are different:

I can't look into rburgundy's problem right now because it's a compatibility issue with a contributed module (to be addressed after 1.0 release). With the last dev updates I made the javascript more permissive when looking for conditional fields. Before it looked only inside the "node-form" div, now it searches everywhere. Maybe rburgundy this change solved at least the second part of your problems?

#2's problem is maybe different: katiusha are you referring to a node-type template suggestion that is used when viewing the node or to a node form template?

#4

rburgundy - November 28, 2009 - 01:44

peterjoe - I tried the newest Dev and it seems to have fixed the problem! =) thanks for letting me know!
will be setting up my site with the conditional fields this weekend

 
 

Drupal is a registered trademark of Dries Buytaert.