سؤال

I created a template, my-node-form.tpl.php, to theme a particular form. If this is the template content, then drupal_render works fine:

<?php
?>
<?php 
    dsm ("debug.  inside my-node-form.tpl.php");
    foreach ($fieldnames as $fieldname){
      print drupal_render($form[$fieldname]);
    }
    return;
?> 

However, if there is a blank line between the two sets of php-tags, then drupal_render returns nothing:

<?php
?>

<?php 
    dsm ("debug.  inside my-node-form.tpl.php");
    foreach ($fieldnames as $fieldname){
      print drupal_render($form[$fieldname]);
    }
    return;
?> 

Anyone know why this is?

هل كانت مفيدة؟

المحلول

I had a bug which corrupted some of the formfield data. I fixed the bug and drupal_render now works fine.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top