Now that the data structures developed for forms are being used for other data structures, particularly nodes, is there any reason why the #pre_render callback is available only in forms? I suggest moving the code that calls #pre_render callbacks from drupal_render_form() into drupal_render(). In particular I would like to add #pre_render hooks in my hook_view, so that I can tweak the node's content structure before it gets themed. Right now I see no reliable way to do this, short of making a special module with a very heavy weight so that it's nodeapi hooks are guaranteed to be called last. If there is positive feedback to this suggestion, I will submit patches for drupal-5.x and head. Thanks. -Dave
No, there's no reason it should be for forms only. In fact there's a patch by gordon in the queue that adds both pre_render and post_render optional callbacks for any drupal_render()'able structure. It's a good patch. +1! ;-) http://drupal.org/node/147662 This patch also makes it possible to take full advantage of hook_elements() default properties when building non-form structures that will ultimately be passed through drupal_render(). --Jeff On Jun 16, 2007, at 1:04 PM, Dave Cohen wrote:
Now that the data structures developed for forms are being used for other data structures, particularly nodes, is there any reason why the #pre_render callback is available only in forms?
I suggest moving the code that calls #pre_render callbacks from drupal_render_form() into drupal_render().
In particular I would like to add #pre_render hooks in my hook_view, so that I can tweak the node's content structure before it gets themed. Right now I see no reliable way to do this, short of making a special module with a very heavy weight so that it's nodeapi hooks are guaranteed to be called last.
If there is positive feedback to this suggestion, I will submit patches for drupal-5.x and head. Thanks.
-Dave
I've noticed some funky problems with in HEAD rendering #prefix or #suffix markup or just markup items within form collapsible fieldsets (at least). Are there any other open issues for dealing with form rendering? -Peter On 6/16/07, Jeff Eaton <jeff@viapositiva.net> wrote:
No, there's no reason it should be for forms only. In fact there's a patch by gordon in the queue that adds both pre_render and post_render optional callbacks for any drupal_render()'able structure. It's a good patch. +1! ;-)
This patch also makes it possible to take full advantage of hook_elements() default properties when building non-form structures that will ultimately be passed through drupal_render().
--Jeff
On Jun 16, 2007, at 1:04 PM, Dave Cohen wrote:
Now that the data structures developed for forms are being used for other data structures, particularly nodes, is there any reason why the #pre_render callback is available only in forms?
I suggest moving the code that calls #pre_render callbacks from drupal_render_form() into drupal_render().
In particular I would like to add #pre_render hooks in my hook_view, so that I can tweak the node's content structure before it gets themed. Right now I see no reliable way to do this, short of making a special module with a very heavy weight so that it's nodeapi hooks are guaranteed to be called last.
If there is positive feedback to this suggestion, I will submit patches for drupal-5.x and head. Thanks.
-Dave
Not that I'm aware of. if there aren't, and you've found issues like that, there SHOULD be open issues. :) --Jeff On Jun 16, 2007, at 2:35 PM, Peter Wolanin wrote:
I've noticed some funky problems with in HEAD rendering #prefix or #suffix markup or just markup items within form collapsible fieldsets (at least). Are there any other open issues for dealing with form rendering?
-Peter
Am Samstag, den 16.06.2007, 13:54 -0500 schrieb Jeff Eaton:
No, there's no reason it should be for forms only. In fact there's a patch by gordon in the queue that adds both pre_render and post_render optional callbacks for any drupal_render()'able structure. It's a good patch. +1! ;-)
thanks for that interesting pointer. It's great to see that this is the direction, that drupal takes. I think this kind of structured arrays can be useful in many cases. E.g. I've also used them for representing configured conditions and actions in workflow-ng. So I benefit from the existing element defaults system and further I got easy rendering with drupal_render() for free! regards, fago
Hi, This was removed from HEAD, but I have a patch pending which adds this into drupal_render() see http://drupal.org/node/147662 Gordon. Dave Cohen wrote:
Now that the data structures developed for forms are being used for other data structures, particularly nodes, is there any reason why the #pre_render callback is available only in forms?
I suggest moving the code that calls #pre_render callbacks from drupal_render_form() into drupal_render().
In particular I would like to add #pre_render hooks in my hook_view, so that I can tweak the node's content structure before it gets themed. Right now I see no reliable way to do this, short of making a special module with a very heavy weight so that it's nodeapi hooks are guaranteed to be called last.
If there is positive feedback to this suggestion, I will submit patches for drupal-5.x and head. Thanks.
-Dave
!DSPAM:1000,4674272249538992556831!
participants (5)
-
Dave Cohen -
fago -
Gordon Heydon -
Jeff Eaton -
Peter Wolanin