문제

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