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.. Thank you all!!
I'm not sure if this is possible. However, I'm working on a patch for Drupal core to allow the rewriting of file URLs. It's included in my CDN integration module [1]. We're discussing how to improve it [2]. Please give it a look. If it's what you're looking for, feel free to ask me questions in IRC or in CDN integration's issue queue. [1] http://drupal.org/project/cdn [2] http://drupal.org/node/212376 Wim Leers ~ http://wimleers.com/work On Jan 23, 2008, at 00:43 , Iñaki Lopez 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..
Thank you all!!
On Jan 23, 2008 12:43 AM, Iñaki Lopez <inaki.lopez@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. Cheers, Arto [1] http://drupal.org/project/boost -- Arto Bendiken | http://bendiken.net/
Hi Arto.. Yes, I'm looking it right now! I found the module and was doing some code sniffing to see the way it works when I received this email. Thanks a lot, I'm going to test some magic and I'll reply as soon as I find my way in this.. if Also Wim, let me take a look to the cdn and find if my needings may help you or if the module may help me.. I'll take in strict sense that about the irc!! thanks.. On 1/23/08, Arto Bendiken <arto.bendiken@gmail.com> wrote:
On Jan 23, 2008 12:43 AM, Iñaki Lopez <inaki.lopez@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.
Cheers, Arto
[1] http://drupal.org/project/boost
-- Arto Bendiken | http://bendiken.net/
participants (3)
-
Arto Bendiken -
Iñaki Lopez -
Wim Leers