[development] install system

Adrian Rossouw adrian at bryght.com
Thu Jul 13 17:11:30 UTC 2006

On 13 Jul 2006, at 5:31 PM, Adrian Rossouw wrote:

> I just like the idea of user-1.object, node-2.object files more  
> than the idea of having to edit sql, especially when it comes to  
> creation of complex
> data types.
another thing i like about that .. heredoc syntax.

$node->body = <<<EOT
My entire contents of my node's body,
can very cleanly be put into this space here,
without having to mess around with 'escaping'

I believe this is simpler than trying to edit the default node content,
either within the sql statement, or within your usual strings.

Althought I know that's kind of frowned upon here, so whatever.

So you could create you initial node by just having a file that says :

file: node-1.object
$node->type = 'story';
$node->title = "Welcome to your new blogging site";
$node->body = <<<EOT
Thank you for installing the Drupal Blogging install profile.

Your first step would be to create your initial account, and then to  
post about whatever

In the case of the default variables, this would be :

$variables['site_name'] = $edit['site_name']; // if there was a field  
for it.
$variables['some variable'] = blah;

Same could be said for taxonomy, node types etc.

This is one of the reasons I think the programmatically submitting  
forms approach is far more powerful than
trying to duplicate all the checking that happens on forms, inside  

Oh. and this also gives us versioned content, and provides an  
abstraction layer that we can maintain between version changes.

Adrian Rossouw
Drupal developer and Bryght Guy
http://drupal.org | http://bryght.com

More information about the development mailing list