User login

Devmo

Overriding a string the second-simplest way in Drupal 7

Here's the situation: You don't need administrator-customizable strings like the String Overrides modules provide, but you'd like the changes in a more share-able (or consistently version controlled) place than settings.php, which details an easy $conf way of doing string overrides.

Well, here's how to do it with a variable set function that can go in a module's install or update hook:

How to fetch a file at a URL and set it as the default image in an image field

There's two separate cool things here that you might want to do. One, simply know how to save a file from a URL (there's a secret Drupal function for that in system module) and two, how to give an image field a default image when creating it programmatically (that part is outsourced to the fieldhelp module).

Syndicate content