Hi all,
I'd like to alter the content of specific nodes on my site, and I'd like to do it by providing a module, not by subtheming an existing theme like bartik. So in my crazy fantasy, I add some nodes, look at their node IDs, and write a custom template for each ID. My template filenames would look like this:
- mycontent--7.tpl.php
- mycontent--15.tpl.php
and so on. Every time I create content for a node that I would like my module to alter, I would add a mycontent--(nodeID).tpl.php file. In one file, maybe I would access the content, and stick a whisker-face like >^..^< after every instance of the word "cat". In another file, maybe I would put a picture of a cat before the content and after the content. And in yet another file, maybe I would link the first instance of the word "dog" to the wikipedia page on dogs. The point is that I would somehow alter the content.
I have a vague idea that this involves preprocess functions, but I'm not sure how. But I do know that I have to start with a module info file, so I already have this:
mymodule.info:
name = MyModule Fun Pages
description = "Alters the content on certain pages to add all sorts of interesting things."
package = Fun
core = 7.x
files[] = mymodule.module
php = 5.2
My questions are: