This may be something simple that I am overlooking, but is there a way to tweak the final rendered out HTML for each page? I want to do a find a replace on a few items and am wondering if there is some way I can tweak the rendered page.

Thanks!

Comments

karschsp’s picture

You'll need to create a custom input format/filter.

A good resource on the basics of input formats/filters is over at Lullabot. They list several input format modules at the bottom, you can probably look at their code and get enough info to get you started.

Here's another good article at zivtech. And here's the actual hook_filter API documentation.

good luck!
steve

slayerment’s picture

I am familiar with filters and this could work to a degree, but I am looking for something that will have control over the complete output from [html] to [/html]. I would also want to control pages besides just nodes.

Thanks!

karschsp’s picture

In that case I think you'll need to do some custom theming (maybe in combination with filters).

sunset_bill’s picture

I'd start in page.tpl.php for the full page layout. You can do finer-scale tweaks in other .tpl.php files.

cheers,
Bill

Zero4ffect’s picture

I know this post targets D5 *shudder*, but since it was near the top of the list I figured I'd post how to accomplish this when using Drupal 7. Of course, if anyone knows of a better way to do this, please post it.

In the page.tpl.php file, the the following code:
print render($page['content']);
with:
print str_replace($search, $replace, render($page['content']));

Easy as pie :)