Feeding “static” sites from Drupal nodes
Tuesday, February 26th, 2008This is about how I manage to create content for domains without CMS from a Drupal enabled domain without any manual work.
On address www.immobilien-spot.de I am running a community for real estate agents. It’s primary focused on Immobilien in München (that’s German for real estate in Munich).
Estate agents can become members, can show 10 of their best buildings and act like usual in communities (Blog, Forum, Contact…). Additionally the agents can book a special site to promote one of their offers, i.e. an office loft for rent. This office loft is shown in the offer list and also on a static site called officeloft.de (this is an example, I don’t own that domain). To feed the content of officeloft.de from the Drupal content on immobilien-spot.de, I’ve established a special node type called a “promotion”.
A promotion node consists of a node-ref (pointing to the estate offer node), an entry place (office-loft.de) and a booking period (March 2008). To render the promotion node completely different from all other nodes, I have installed the sections and pathauto modules for Drupal. With pathauto one can automatically create special paths for nodetypes, and with sections.module one can assign special page.tpl.php for this path.
What’s left is to have a nightly cronjob that copies the rendered promotion node to the special site’s http-root directory (what should be a subdirectory of the main domains http-root - else you have to struggle with your OS). And finally transpose all of the relative path’s inside the copy to be absolute.
Have fun!

