Closed (won't fix)
Project:
Node Profile
Version:
5.x-1.1
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 May 2007 at 14:20 UTC
Updated:
10 May 2007 at 11:14 UTC
I want only to show one picture on the profile pages, but to display user pictures on nodes in general.
If I view a node profile as a seperate page, the picture should be displayed. When it's integrated into the profile or usernode, additional pictures shouldn't be displayed because one is already displayed by the profile or usernode.
Comments
Comment #1
schnizZzla commentedBy additional I mean the duplicates.
Comment #2
fagosry, I'm not used with core user pictures.
Which part of the template adds it to the node? (http://api.drupal.org/api/5/function/theme_node)
Comment #3
fagohttp://groups.drupal.org/node/3984#new
Comment #4
schnizZzla commentedno problem, it's solved, for anyone who is interested, i shouted this on g.d.o
Comment #5
schnizZzla commentedI'm re-opening this, because of my detectives work. Someone should read this. I found a solution without changing the template files. But I believe this doesn't work without a patch to the nodeprofile.module. At least in my case, it seems a bug.
I don't want to add more code to the templates. So instead I used the override _phptemplate_variables in template.php like this:
But whenever I viewed the node whether it was integrated in the profile or alone. Every time the page variable was set to true.
I saw that in nodeprofile.module the following call is used in both functions theme_nodeprofile_display_full and theme_nodeprofile_display_teaser:
After switching the third argument for node_view to false, which is the page value, it finally worked:
To remove avatars from the profile, but leave them on node profile nodes, when displaying as a page NOT integrated, with this setting, I do NOT need:
I hope that change can be reviewed. If I get this right the nodeprofiles theming functions where called, when the nodes are integrated into the profile.
sry, I'm not used with core user pictures.
Which part of the template adds it to the node? (http://api.drupal.org/api/5/function/theme_node)
You can see what the problem is, in this code in phpTemplate.engine:
It calls the user.modules theme_user_picture function where the check if $account->picture is true happens.
At the end a themed $picture is passed as a template variable. I don't see any other variable for that. Maybe some ninjas can help...
Comment #6
schnizZzla commentedWhen true is passed everything seems fine...
Comment #7
fagohm, yeah. I've done that, because so the user page looks nicer if one uses default settings.
$page = FALSE will print a quite big node title link - which doesn't suit there much as there are already user categories titles. So I think it's better to leave it as it is, however if you want to change the parameters just create an template for your used function (teaser / full node view) and adapt the parameters.
Comment #8
schnizZzla commented"So I think it's better to leave it as it is, however if you want to change the parameters just create an template for your used function (teaser / full node view) and adapt the parameters."
Thanks for the explanation.
Yeah, you're right, overriding is also possible. On the other hand, by default there are already too much h2 titles in the profile.
At least I have gained more "esoteric knowledge" of the Theme System now...