[development] modifying the drupal final output..

Arto Bendiken arto.bendiken at gmail.com
Wed Jan 23 10:20:20 UTC 2008

On Jan 23, 2008 12:43 AM, Iñaki Lopez <inaki.lopez at gmail.com> wrote:
> Hi all.. I'm trying to create a module to modify the final content of
> the request being sent to the client. which is the best way to do
> that? I've done some test with the hook_exit hook, but can access the
> content.. and hook_filter only is being executed for the node's
> content.. The idea for the module is to change the paths for the
> themeing files (images and css files) to a) local folder of system, b)
> another path in the web server..
> As files (images and so) may not be referenced using drupal code but
> just with simple html output from any module I just would like to
> modify the final result after the rendering process..

Call ob_start() in hook_init, and ob_get_clean() in hook_exit to
obtain the full page contents and do your magic on it. Have a look at
the Boost module [1] for an example.


[1] http://drupal.org/project/boost

Arto Bendiken | http://bendiken.net/

More information about the development mailing list