Setting pathauto default settings for a new CCK content type?

Tatsh - August 13, 2009 - 07:59

Upon installation of my module, I want to set default settings for content types that are created with CCK (which are created by my module upon installation). Right now these are under 'Node page settings' in their respective fields, which are blank by default because node_pathauto() (which is defined in pathauto_node.inc) is not set to do anything with these (as it never knew these would exist).

In pathauto_node.inc, a $settings array (typecasted to object when returned) is returned with the properties for the 'node' module alias settings, in the hook *_pathauto($op), where $op == 'settings' for the settings page of Pathauto. It populates all content types (CCK-defined ones are part of this array), then it makes that number of input fields and leaves them blank as default, so a user can define them later with their own patterns.

So, say I created a content type named 'Y' with my new module. This is what the Pathauto module settings page would say for that by default under 'Node page settings':

Pattern for all Y paths:
<input type="text" value="" /> or blank text box

How would I go about making that pattern defined upon my module's installation? Anyone ever dealt with this issue? Does not seem to be an easy way unless I can get access to the $settings object that creates the page (which would definitely require modifying node_pathauto(), something I do not want to do).

 
 

Drupal is a registered trademark of Dries Buytaert.