I love how this theme takes ubercart fields and puts them in their own node variables in node_preprocess.
However, I'm wondering if there is a more efficient way of doing it? By the time the node_preprocess function gets a hold of the node, the node->content is already all rendered. So fusion executes node_build_content again and then fills out some nice variables by individually rendering fields.
So everything is rendered twice. I'm still swimming thru all the node rendering functions and hooks, but it seems like the only way to get around this is to use hook_nodeapi for the operation "view" to mess around with the $content array before it gets rendered.
I'm just wondering if anyone has any thoughts on this process at all? Obviously a theme can't invoke hook_nodeapi so it does indeed seem it has to re-render the node. Is this true?
Thanks!
Comments
Comment #1
BM commentedIs there anyone no other way to do this?
fusion_core_preprocess_node in template.php calls the node_build_content function which causes the node to be rendered twice.
I am using uc_option_image which uses Drupal.Settings, and because the node is rendered twice, all the values set in Drupal.Settings are duplicated and come in arrays.
I wonder what this does to performance ?
Comment #2
sheena_d commentedConsidering the operations that are available to a theme, there is not really any more efficient way to accomplish this functionality. When initially building Fusion, we did not notice any significant performance issue with this approach to rendering Ubercart products. On any site with moderate caching enabled, the issue of duplicate processing should be moot.
Either way, no further features are being developed for Fusion in Drupal 6.x.