Modify HTML output from block
Permalink
Is there a way a block can intercept and modify the output of the page where it is placed? I know it could be made client-side with javascript, but I would rather prefer to do it server side with PHP so that it could benefit from the page caching.
I have been trying with php output buffering with no luck.
Any idea?
I have been trying with php output buffering with no luck.
Any idea?
Many thanks for your reply, JohntheFish!
If that cannot be made for given pages, but using a handler (for what I have seen so far that means every page in the site) then it will be maybe too much overload, so I will finally use the client side solution.
However, I will take a deeper look at that mechanism since it seems it can have a bunch of interesting uses.
If that cannot be made for given pages, but using a handler (for what I have seen so far that means every page in the site) then it will be maybe too much overload, so I will finally use the client side solution.
However, I will take a deeper look at that mechanism since it seems it can have a bunch of interesting uses.
If you are looking at events, I recommend Mnkras's event tester addon. Its great for learning as well as testing.
(I think this may be how some of the email scrambling addons do it - have not looked inside them for a long time, so cant be sure)
Another way to do it would be to modify the area output section of a theme to catch the area content and then process it before outputting.