I'm using hook_menu to build a series (100+) of pages where the code uses a basic page "master template" and replaces strings in the "master template" node with elements of the URL that reaches the Drupal menu page callback routine.
Once the appropriate strings are replaced, the page callback routine uses node_view() to create the render array, and returns it for further processing and transmission to the client.
The "master template" page is at URL mysite/whatever-string. The problem is that Drupal sticks whatever-string into the page the client receives, and it looks like this:
<div class="content"> <div id="node-1196" class="node node-page contextual-links-region clearfix" about="/whatever-string" typeof="foaf:Document"> <h2 class="title"> <a href="/whatever-string"></a> </h2> ....
I'm using dd($var, 'description') to look at data structures and elements as a debugging tool. From the callback routine, dumping the unprocessed and processed "master template" node and the render array returned by node_view() and searching for whatever-string returns no results. The string isn't there. Thinking that perhaps the render array produced by node_view() didn't have all of the elements that the page contained, I implemented hook_page_alter($page) to see if the render array that it gets as a parameter might contain the string. It doesn't. Is there some other hook that's available to a module which will have everything that goes into rendering the page ?
As a last resort, I'm sure I can work around this by writing theme/template code to wander through the html (or DOM) and make the changes needed. I've done this a lot before, but I think it's cleaner (and marginally more efficient) to do it all when the page is generated, rather than looking at all the nodes that get rendered to see if it's a generated one, and make the changes to the HTML directly.