views:

42

answers:

2

The title is probably not the best description. I want two functions:

getHeader();
getFooter();

The header must return all the content in the template.php file BEFORE

print $content;

And the latter must return everything after it.

Is this possible?

+1  A: 

Instead of trying to get the all except $content and wrap your display in it, why don't you just take your content and theme it (put it into $content). That will be a lot easier, Drupal was meant for this.

googletorp
I'll need to find a hook that returns the content for WHMCS. This might not be a bad idea. :-)
RD
Ah. This will bring in quite a few problems. The links that WHMCS generates, won't work if the content was pulled into Drupal. I will definitely need a getHeader and getFooter command.
RD
A: 

Drupal makes use of "regions". What you can do is give your site three regions (header, content, footer).

Regions are defined in the theme's .info file in the form "region[backend_name] = Title that shows up in frontend". Having the regions "header", "content", and "footer" could be defined thus:

region[header] = This is the Header
region[content] = This is the Content
region[footer] = This is the Footer

After defining the regions in the .info file and enabling the theme, each region can be printed using the backend name thus:

print $header;
print $content;
print $footer;     

Blocks are assigned to a region at /admin/build/block

David L
I need the inverse of this. I.e. Give me the rendered page, excluding such and such block.
RD
Are you doing this from inside drupal or parsing the rendered page externally?
David L