How do I set the weight of a new module? I tried weight = 5 in the .info file but no good. I remember seeing a mention of this in a forum post but I can't find it now!

Paul

Comments

modul’s picture

To what extent would the idea of "weight of a module" make sense? Drupal modules are constructions of php code, serving any purpose the programmer wants it to serve, such as designing a view, allowing users to flag a node as offensive, inserting a picture in a node or, if need be, providing a user's horoscope or the correlation between his shoesize and the gross national income of Paraguay. How would you give weight to a module, knowing that "weight" means: "relative importance of something with regard to something else"? Is a horoscope less important than a View or a shoesize?

The idea of "weighing" is a moderately useful approach with regard to blocks, probably also with regard to nodes, but imho it has nothing to do with modules.

Ludo

ninetwenty’s picture

Weight of modules sets the order in which modules are executed, this is useful when a module expects another module to have done some work before it is run. The information to do this is found here http://drupal.org/node/110238

scrypter’s picture

After a nights sleep, I found that node via a google search. Setting weight is vital as I want to "form_alter" the stuff "form_altered" by taxonomy and without a higher weight, there was nothing in the $form[] to alter!

www.scryptik.com - Javascript editor with syntax error checking
www.purpleoar.co.nz - Web development, Drupal consultancy

www.purpleoar.co.nz/scryptik - Javascript editor with syntax error checking
www.purpleoar.co.nz - Web development, Drupal consultancy

modul’s picture

I stand corrected :-) . Thanks for the clarification!

Ludo