I spent a little time looking at the bio module last night. I was impressed with it as compared to the previous nodeprofile version. This morning, I looked at the new nodeprofile version and it looks like it's nearly as good. The one thing bio does better, though, in my opinion is the integration with the user account screen.

Having the nodeprofile show up with its own tabs within the view tab looks awkward. I'd like to see an option like bio has to allow the nodeprofile to take over the entire tab. Also, the initial creation of the profile is confusing as you have to go into edit and then click on userprofile. I'd like to see "Edit Profile" be a separate edit tab to make it more intuitive.

Thanks for the update! Much less work involved in tying things together now.

Michelle

Comments

michelle’s picture

I stole the code from bio and kinda got it working:

function nodeprofile_profile_alter(&$account, &$fields) {
 // if (variable_get('bio_profile_takeover', 0) && $bio = bio_for_user($account->uid)) {
 //   $typename = node_get_types('name', variable_get('bio_nodetype', 'bio'));
    $typename = node_get_types('name', 'uprofile');
    foreach($fields as $key => $val) {
      if ($key != $typename) {
        unset($fields[$key]);
      }
    }
//  }
}

Left to do:

Need to get rid of my hardcoded 'uprofile' and pull the proper variable to find the nodeprofile.
Need to add the checkbox to the nodeprofile config and uncomment the if test.
Also still have the issue with the pesudo view tab on the nodeprofile and the title.

But it's a start :)

Michelle

David Lesieur’s picture

I had a look at the code and it seems like you should be able to change the profile display and get rid of the view tab by overriding the theme_nodeprofile_display_box() function.

michelle’s picture

Ah, thanks for looking. My toddler hasn't let me near the computer much today so I haven't had a chance. When I'm able to be on for more than 2 mins, I'll delve into it a bit more and see if I can implement this feature request myself and save fago some work. :)

Thanks for the pointer,

Michelle

fago’s picture

I've just tested the takeover functionality of the bio module, and I must say: I don't like it.
First of the user page isn't used only by the bio module - taking over the whole page might kill user interfaces provided by other modules.

Furthermore, it's not consistent. As long as you have no profile, the page isn't taken over. Then you create one and it will be taken over - that's just confusing for users.

Anyway that could be done by theming the user page. So it's impossible to make a interface that suits for everybody - that's why we have the possibility to theme something. But let's try to make a interface, that suffices for most users and that doesn't misuse drupal's API so that other modules may be affected.

I've built the current "nodeprofile tabs" because a lot of users requested tabs or tried building tab like interfaces - that's now possible easily and extensible - and of course it can be themed.

I've already considered an extra tab like the bio module creates one. I've not added it so far, because I thought it's intuitive, if one sees the nodeprofile output on the view tab, that edit leads to the possibility of editing it. Otherwise I feared it would not be clear - what can be edited under edit and what not?
Furthermore you can enable the "edit" tab for the profiles, which should be intuitive. The look of the tabs might not be the best - it's impossible to create tabs that fit into every theme - but yeah you can theme them... (yeah and of course you can remove them by theming..)

However I'd be very happy to receive suggestions, which settings are missing and functionalities are missing - for a better interface out of the box. Perhaps, an option to disable the "view" tab like it's possible with the "edit" tab would be a good idea - so one could disable the tabs as whole.

If you want to implement an extra tab like the bio module - that would be an easy task (I could help you), but I don't want to clutter nodeprofile too much with options, so I would suggest to create a short "contrib" nodeprofile module for that, that could live into a "contrib" nodeprofile folder, such as it exists in several other projects.

michelle’s picture

Well, it's an option in bio, so I figured it would be an option in nodeprofile as well. I like it because I hate that the view tab becomes a dumping ground for modules to stick stuff and it looks awful. As far as the inconsistancy, I plan on adding something to the effect of "this user hasn't created a profile yet" until they do, so that would take care of that.

I've built the current "nodeprofile tabs" because a lot of users requested tabs or tried building tab like interfaces - that's now possible easily and extensible - and of course it can be themed. [...] Perhaps, an option to disable the "view" tab like it's possible with the "edit" tab would be a good idea - so one could disable the tabs as whole.

I just don't like the look of tabs inside of a tabbed node like that. Maybe I'm alone in that? I don't know. I prefer all the tabs to be on top at the main level. An option to disable the view tab would be nice so they don't have to be themed away.

I've already considered an extra tab like the bio module creates one. I've not added it so far, because I thought it's intuitive, if one sees the nodeprofile output on the view tab, that edit leads to the possibility of editing it. Otherwise I feared it would not be clear - what can be edited under edit and what not?

I guess I didn't find it intuitive. Maybe it's because I'm so used to the edit tab editing the account but it took me a while to figure out where I had to go to edit the profile when the edit tab on the profile page was disabled.

What I would ideally like to see on the user page is tabs across the top like this:

View | Edit Account | Edit Profile

"View" would show either the screen as it is now with the nodeprofile embedded in it or, if the option is checked, just the nodeprofile as the entire node or "this user has not entered a profile" if none has been entered.
"Edit Account" would be the normal account stuff
"Edit Profle" would add or edit the node profile

To me, that's the most intuitive and doesn't require going to edit and then edit profile in order to add a profile. It's all right there up on top and easy to see what's what.

If this isn't a direction you want to go, I'd appreciate any help you have time to give me in order to do it myself. I have some code to add a "Profile" tab to the account screen that goes to the usernode but it literally goes to the usernode and you suddenly don't have any of the other tabs there anymore, which is confusing. I'd like it so it's a real tab so that when you are editing your profile, it still has the other two tabs on top.

I hope that makes sense... My son got me up way to early again so I'm half asleep.

Thanks for your time on this.

Michelle

fago’s picture

I agree with you that a interface like
- "Edit Account" would be the normal account stuff
- "Edit Profle" would add or edit the node profile
would make sense.

However, there is now "edit account", there is "edit". Core does intend to edit the profile as user categories - that's what's possible with nodeprofiles now too.

For building alternative interfaces, I use pageroute. That's most flexible - perhaps it could need a "drupal tab" integration patch as tab like submit buttons don't look nice per default - so instead of hacking around changing the core interface I would suggest to improve pageroute, to make an alternative better interface and/or trying the core interface for drupal 6.

But nodeprofile isn't going to overhaul the whole core user interface by default - that's not its task.

fago’s picture

ah I forgot the view tab issue: yep, I think I'll have a look at that.

michelle’s picture

But nodeprofile isn't going to overhaul the whole core user interface by default - that's not its task.

You're right; I think I'm putting too much on the shoulders of nodeprofile. So how about this: we can try to work in a few options that will make creating my "dream UI" easier and I'll write a tutorial to handle the things that nodeprofile shouldn't be doing such as changing the label on the "edit" tab.

The question is, which tasks should nodeprofile handle? Let's break this down into "things needed":

  1. Option to set the nodeprofile tabs to view, view and edit, or none.
  2. Function to let nodeprofile take over the entire user view tab
  3. Code to change the label of the edit tab to "Edit Account"
  4. Showing "Edit Profile" as a subtab on "Edit" tab should be optional
  5. Code to add an "Edit Profile" tab to the user screen that lets you edit the nodeprofile right there

My opinions of who should do what:
1 - Handled by nodeprofile
2 - Either an option to nodeprofile as bio does or tutorial only. I'm ambivalent about this one.
3 - Tutorial only
4&5 - These go together. If nodeprofile handles it, there could be a checkbox for "Move nodeprofile edit subtab to its own tab". If checked, nodeprofile would make the Edit Profile tab and not put it on the regular tab. That would be ideal for me but, if you think that's out of scope for nodeprofile, I could put the instructions to do that in the tutorial instead. I would need to find out how to remove it from the edit tab and how to add a proper tab for it.

As to pageroute, I honestly haven't even looked at it as I thought it was geared at multi node things and I've only ever dealt with one node per user. Given what I've layed out, I don't know that adding another module into this is necessary. I think this can be accomplished with just a couple more options in nodeprofile and a tutorial to handle the rest.

Michelle

fago’s picture

as discussed, I think 1 and perhaps 5 should go into nodeprofile.
However, I have to think a bit over this to make the options clear in all cases...

the rest could go into nodeprofile_bonus or such .. :)

michelle’s picture

Summarizing our IRC discussion:

1. Option to set the nodeprofile tabs to view, view and edit, or none.

There is already an option for "Include an edit link to the display". The module will be modified so that, if this is unchecked and we are showing the entire node, it won't show the view tab. Since this discussion is really about the full display option, that fits our purposes.

2. Function to let nodeprofile take over the entire user view tab

This will be separated out into a nodeprofile_bonus module that will be included in the package.

3. Code to change the label of the edit tab to "Edit Account"

This is overriding Drupal core functionality and may show up in the nodeprofile_bonus module or just as instructions as it is out of scope for the nodeprofile module.

4. Showing "Edit Profile" as a subtab on "Edit" tab should be optional

This is actually already possible by unchecking "Integrate this node profile with user categories."

5. Code to add an "Edit Profile" tab to the user screen that lets you edit the nodeprofile right there

This will be added to the nodeprofile_bonus module.

Michelle

michelle’s picture

Status: Active » Closed (won't fix)

I'd forgotten all about this issue. I have the code doing what I want on my site and in my tutorial. As far as I'm concerned, that's good enough. If fago wants to set this back to active, that's fine but, for me, the problem is solved.

Michelle

johnhanley’s picture

Apparently the change #1 (as previously described by Michelle) has never been implemented:

The module will be modified so that, if this is unchecked and we are showing the entire node, it won't show the view tab.

The desired and expected behavior should be:

1) "Display it as full node view" is checked
2) "Include an edit link to the display" in unchecked

the "View" tab should not appear with the corresponding user profile.

I found this recent article, which proposes a patch to remove the "View" tab. However, contrary to the article, you only want to remove it when "Include an edit link to the display" is unchecked AND "Display it as full node view" is checked. For example:

'#tabs' => nodeprofile_get_settings('edit_link', $type) ? array('view', 'edit') : ($style != 'full' ? array('view') : array()),