Automatically update drupal nodes at submit time -
is possible automatically update drupal node's content @ submit time?
when adding images node, stored <img src="http://myserver/sites/....">
however, distribute content customer servers, , 'myserver' therefore incorrect. if used <img src="/sites/...."> can foresee issues (drupal installed @ root level).
if not cause issues, can automated, when new content added, scans 'http://myserver/sites' , replaces '/sites' ?
thanks in advance,
martin
i think gritty details depend on how uploading images... either default upload module or combination of filefield , imagefield (i'd recommend latter).
either way.. should able make adjustments node automatically implementation of hook_nodeapi() (when $op == 'presave'). doing require custom module, don't deterred that, it's pretty straightforward set up.
to see what's going on during hook, can make sure you're file info there , ready edited.. (on development server!):
drupal_set_message("<pre>".print_r($node,true)."</pre>") that should show what's going on in $node object, , if can find filepath should able edit before gets database.
you alter output same hook, when $op=='view'.
Comments
Post a Comment