[development] Front page module - The way it should be.[tm]
Allie Micka
allie at pajunas.com
Wed Feb 1 00:30:07 UTC 2006
On Jan 31, 2006, at 5:51 PM, Darrel O'Pry wrote:
> And where could I look to see this cascading goodness... I'm using
> something similar in a modified thumbnail module I'm working on... I
> would like to compare implementation...
It's in _send_value() at http://cvs.drupal.org/viewcvs/drupal/
contributions/modules/send/send.module?sortby=log&view=markup , and
I'm storing the value within _send_nodetype_settings() in http://
cvs.drupal.org/viewcvs/drupal/contributions/modules/send/send.inc?
sortby=log&view=markup by hijacking them from the variables table,
saving them to my own handler, and deleting them.
The key difference between your implementation and mine is that I
wanted to be able to store it on a per-node level, so I wrote my own
storage and skipped the variable table for all but a few settings.
It's specific to my use, which overrides in order of default, module,
nodetype, node. I suppose that's pretty generic, but not universal.
Mine is a neat approach because it minimizes storage requirements by
refusing to store a value if it's the same as the value it's
overriding. There's some cost on retrieval because you're running a
moderately-complex query for each setting. I coded the module to
retrieve settings ONLY on the send or admin pages, so it doesn't
affect the site at large.
You'd have to do some fancy efficiency footwork if you wanted to
reuse this concept more globally.
Allie Micka
pajunas interactive, inc.
http://www.pajunas.com
scalable web hosting and open source strategies
More information about the development
mailing list