[development] load node globally
arthur
arthur at 24b6.net
Thu Jan 15 21:55:11 UTC 2009
On Jan 15, 2009, at 4:50 PM, Ashraf Amayreh wrote:
> Hello All,
>
> Since I see so many node loads in block visibility and in modules
> that do $node manipulations and so forth, which would make me think
> that sometimes many node loads might occur on some pages and tens
> perhaps when you add contributed modules on that, I was wondering
> why not just load $node globally on node/<num>/* pages like we do
> with $user to avoid any extra node_loads? Developers would only need
> to global $node and it would either be null or populated and ready.
node_load() stores nodes in a static variable already- see
http://api.drupal.org/api/function/node_load
best,
a.
>
>
> --
> Ashraf Amayreh
> http://aamayreh.org
---------------------------------------------------
arthur at civicactions.com
More information about the development
mailing list