I suppose you're adding content_profile_theme_variables class to variables list in content_profile_theme_registry_alter() to allow themers to get access to all of the node fields in their theme. It was quite interesting discovery for me, but nobody can use it in current implementations, as you add it after all other preprocess functions. Much better will be if you'll add it before others. My patch does this.
Also, the issue with content_profile_theme_variables is that it doesn't handle CCK fields. To get rendered CCK fields in node object, you need to pass node to drupal_render(). My patch also solves this.
Hope you'll find this patch useful.
Thanks!
Comments
Comment #1
fagoWhy shouldn't it be usable in the theme as it is now? If it's running as the last one, still it's variables are available to the theme.
Also the 'view' operation is already run, so users can render CCK fields themself. But yes, a separate helper might make sense to get the rendered CCK fields, or also the whole node body/teaser.
Comment #2
neochief commentedIf it's running as is, the theme's preprocess function might be running before of it, so it doesn't have access to content_profile_theme_variables data. To avoid this, content_profile_theme_variables should be shifted to the beginning, so it's data available for each of later preprocess functions. Makes sense?
Comment #3
fagoAh you mean for the preprocessor - ok makes sense.
Comment #4
neochief commentedOkay, great! So, green light for commit?
Comment #5
fagoThis comment of #1 still applies:
So the second hunk should go in separate helpers, but I suppose that's better another issue?
Comment #6
ckngSecond hunk should be another issue.
+1 for making
$content_profileavailable for preprocessor.Tested 1st hunk, work as expected but encounter infinite loop in get_variables() as it is calling all node template preprocessors if one of them happen to be a node template preprocessor.
In my case, added
$conf['content_profile_extra_templates'] = array('user_picture'). user_picture happens to be in node template preprocessor list, when I try to access$content_profileinmytheme_preprocess_user_picture(), causes infinite loop WSOD.Any thoughts on solving that?
Comment #7
ckngChange the title to better reflect the feature requested.
And the patch.
Comment #8
neochief commentedComment #9
fagohm, that's a serious problem. Until we have not found a proper solution for that, this is a no-go.
Comment #10
neochief commentedI can't catch this, can you describe detailed explanation, please? This patch works fine for 3 production sites for me.