SoC: Test the nodeprofile modules!

Events happening in the community are now at Drupal community events on www.drupal.org.
fago's picture

SoC is ending soon and a lot of code has been written. So I would appreciate if you could help testing my modules!

The modules I've built are:

All this modules are compatible with drupal 4.7, so use a recent 4.7 install to test.
All modules except of the nodeprofile module have been built generally, so that they are useful for all nodes, not only for nodeprofiles!

So how to build a user profile with this stuff?

I describe a simple user profile here, which consists only of one content type:

  • Install the nodeprofile, usernode and nodefamily modules by copying them to your modules folder and activate them.
  • Create your content type you want to use for your profile, e.g. with the CCK.
  • Mark your content type as user profile at 'admin/settings/content-types'
  • If you don't like the usual node forms for editing the profile remove the usual 'create content' link using the menu module. Use a new link pointing at 'nodefamily/CONTENT_TYPE' or an url alias of it.
  • For building user listings and user searches use the views module together with the usernode module. If the view should also contain profile information use the views fusion module.

For user profiles, which consist of several nodes use the pageroute module to provide an userfriendly wizard for filling out a profile. You can find detailled instructions for this in the nodeprofile readme.

Futher information & Demo
Note that I'm updating the site http://more.zites.net/soc with the latest news. You can also find a simple demo on this site.

Thanks,
fago

Comments

demeester_roel@drupal.be-gdo's picture

Use Case.

Aim: Keep track of children, their classes, their tutors and their parents.
Currently i'm exploiting the 'profile' module to tag children as 'pupil' (checkbox) in some 'class' (listbox).

So i can get list of all pupils /profile/pupil or list of users of class A /profile/class/classA, and from this list i can than get their phonenumbers etc..

Problems.
* Listing is not sortable
* Pupils are defined as users but never really access the site. Only their parents do this. but i'm currently unable to 'attach' a pupil to one/more parents.
* I would like to only define a single contact info block (address + phonenumber) and attach that to the pupil and their parent. [Changing address/phone number should only involve a single change!
* I'm unable to query on all users that are tutors in classA. Profile module only allows filtering on a single variable

So i'm very interested in your module(S) and will surely test it to see if it can solve my problems. I'm even interested in co-developing whenever needed

great

fago's picture

this sounds like a really fine application of the modules. Don't hesitate to ask specific questions.

of course, any enhancements are appreciated :)

Profile sections as Tabs

kiteatlas's picture

Hi,

is it or would it be possible to have the different "sections" of profiles displayed as tabs similarly to how the actual core profile module does?

IMO is not semantically correct to list the profile node (one time only type) togheter with all the other reusable content-types of a site. Sounds more logic to me to have the profile fields associated and binded with the myprofile (/user) page.

pageroute

fago's picture

Yeah, with the latest version of pageroute it's possible to create "tabs", however the tabs are submit buttons. Imho the core profile module does no good job with its tabs. If you submit a tab you are redirected away from the profile, then you have to go back yourself to reach another tab...
While with the "nodeprofile tabs" you are able to submit the actual form and reach the next tab.

Just try the nodeprofile demo

@one time only type:
The nodeprofile module uses the nodefamily module to restrict the population of the nodeprofile content type to one, so users are ably to create only one node. Like it's desired for profiles.

User Profile + User Location Module.

Anonymous's picture

Hi,
I am currently using the regular user profiles module. I am also using the location and gmap modules aswell and want to do user location stuff.
My problem though, is that my User profiles have address/location fields(street, city, state, country fields).
To support user locations the user has to go an enter this information again in user location tab. I want to avoid this. I want the user to enter his location information only once.

I am considering moving to the usernode module that you have developed to solve my problem. I would like to know if it would address the problem.

Here is my solution.
1. I use your modules.
2. Create a content for user profiles through CCK.
3. Enable "node location" support for this content type.

This would mean that when they create the user node they also enter location information that is associated with the node.
Will this mean that the user does not have to provide separate user-location information thrugh a separate tab.

Thanks,
Sarvi

yes

fago's picture

yes, that sounds like an convenient solution.

I've been waiting for this, but...

Anonymous's picture

Hi Fago,

I've just started with Drupal a few weeks ago setting it up for a rather small community of PhD students with different profiles for student, staff and alumni and found dealing with the profiles very difficult. I've played around with your new modules to see whether that would be an easier approach. Generally I would say: great!!! That is definitely the right direction. But I have some problems. But first, what I wont to do is the following:

I want a page for each user which contains all his user data, pulling it out of the usernode content type data sets plus the data that are available through the user account (picture, history, blog, etc...)
I have three different kinds of users and each user type is supposed to fill in 2 different usernode content types. All users have to fill in the unsernode type 1 which is personal data. And additionally each group has a seperate usernode content type2 to fill in.

my problems are:

  • how do I configure what the node "usernode" displays?
    What I currently get when I click "my usernode" is a page that links to the CCK content types that I've set up and defined as usernode plus a link to the "user page" (the old profile page). I would actually prefer a page that contains the data of the old "user page" plus the data of the CCK usernodes rather than links

  • the other problem relates to CCK asking for a title: Imagine I have a usernode content type called personal data. So, when the user clicks "create content/personal data" a page opens that has a field on the top named "title". I understand that each node needs a title. But what is the user supposed to do? Why should he give this page a title? (arguing from a user point of view). So this is confusing. Well, I went back and renamed the title field and turned it into a part of the data set. So now the title field of the usernode type "personal data" is called "name". Now Lets say the user types "john" into the name field. If he then goes back to "My usernode" he finds a link called "john". So that doesn't work either. The title field in this case should be preset to "personal data" but there is no way I can do that.

I hope I made myself clear. Thanks for the great work and for any suggestions

sorry...

Anonymous's picture

...I didn't realise I wasn't logged in. My name is Axel. BTW: I tried log in to your site with my Drupal ID which for some reason did not work.

Clever guys you are!!!

Anonymous's picture

Okay, I found the Automatic Nodetitle module. So that problem is solved then. Maybe the other one is as easy. I'm getting really excited now...

Axel

That is it now.

Anonymous's picture

Okay. I've solved the other problem as well. I hadn't got into theming yet. There are still a few things I got to find out but generally things are starting to work and I can just repeat: great job. Well done!
Axel

It is a treat but two questions...

Anonymous's picture

Hi Fago,
again, very well done! I'm currently using nodefamily, nodeprofile and usernode and they work like a treat. I tried page route as well which also looks very nice but I have to put a bit more time into that one. However I've got two questions so far:
1. I'm using your CVS version with 4.7. I haven't experienced any problems so far but are you planing a 4.7 version or are you only publishing it under 5.0?
2. Since I have installed those modules any change in account details (my account) automatically has the status "not published". This is the case even for a change in the superadmin account. The "usernode" content type settings show me a "published" by default and there is nothing I can find in the access control which would help. Any ideas?

yes

fago's picture

ad 1: yeah all modules are 4.7 compatible. I'll tag them as 4.7 as soon as I've a bit more docs, especially for pageroute.
ad 2: hm, that shouldn't be as long as your account isn't blocked. Please update your usernode module and submit a bug report to it if the problem persists.

views for individual profiles

Anonymous's picture

Hi Fago,

the latter problem isn't solved yet but it is currently not that urgent because I only have a small group of users and not so much fluctuation. I have to look at that sooner or later though.

Now I want to do the following: I have all these nice lists with users listed by role. And each user has a profile containing three different content types (CCK). At the moment I've used your node-family module to display those content types all on one page. But I am trying to arrange the personal profile page in a way that all three content types are organized in tabs next to each other. In my case: personal data | contact data | research profile. Is there an easy way?
(I'm not really a PHP wizard as you might have guessed)

Axel

just theme the links

fago's picture

you list links to your nodes and theme the links appropriate:

this example puts the links in a list:

    $children = nodefamily_relation_load($node);
    if ($children) {
      echo '<ul>';
      foreach ($children as $profile) {
        echo '<li>'. l($profile->title, 'node/'. $profile->nid) .'</li>';
      }
      echo .= '</ul>';
    }

I don't want the content types as a list, I want them as tabs.

Anonymous's picture

Hi Fago,
I'm not sure whether you read my post properly or maybe it is because I don't really know a lot about theming. However: I don't want to have the content types in a list form because I've already managed that. I want to have them as tabs (for more detailed description see my earlier post).

It is easy to make lists

Anonymous's picture

It is easy to make lists into tabs using CSS (that is actually how most Drupal themes make tabs).
http://css.maxdesign.com.au/listamatic/ gives lots of options here - good luck!

Great resource!

Anonymous's picture

That seems to be exactly what I need. Thanks a lot!
Axel

cool

fago's picture

cool that you solved your problems already.

have you still problems with the login? verify that you have cookies enbaled and login with DRUPALNAME@drupal.org and your drupal.org password.

finally got it working. this

Anonymous's picture

finally got it working. this should be a package instead different modules.
Some ideas to improve...

  1. I have created a CCK content type to be as a child of usernode where there is all the information for the user profile ..with some pictures and banners.. and descriptions html fields... and such. But I want this to be only for some specific roles. And for the general user when I go to the usernode I don't want to see the usernode.. just going to the standard user profile view.. is it possible?

  2. this is my node.tpl.php... I didn't want to see the usernode containter.. just the cck node.. and the $links of the usernode. so you can add comments to the general usernode.

    <?php $children = nodefamily_relation_load($nid); ?>
       <?php
          
    if ($children){
          foreach (
    $children as $childnode) {
            print
    node_view($childnode);
          }
       print
    $links;
        } else{
      
    ?>

      <div class="node<?php if ($sticky) { print " sticky"; } ?><?php if (!$status) { print " node-unpublished"; } ?>">
        <?php if ($picture) {
          print
    $picture;
        }
    ?>

        <?php if ($page == 0) { ?><h2 class="title"><a href="<?php print $node_url?>"><?php print $title?></a></h2><?php };?>
        <span class="submitted"><?php print $submitted?></span>
        <span class="taxonomy"><?php print $terms?></span>
        <div class="content"><?php print $content?></div>
        <?php if ($links) { ?><div class="links">&raquo; <?php print $links?></div><?php }; ?>
      </div>
    <?php } ?>
  3. It is confusing that you can add comments to the CCK node... (I have disabled them now for that content type) and then the comments also to the usernode.

  4. also it is a bit confusing for users if they want to edit the profile... they have to go inside the CCK user entry.. and then Edit. Because if they press edit when seeing the user, they go to edit the usernode instead of the CCK user content. There should be a link .. something like.. "Edit your profile" somewhare in "my account" settings... the problem is how to know which node is that one. I don't know if I am explaining myself very wel...

5.. now I have the problem of customizing the CCK template... with contemplate yes... but maybe the user want to change colours or where the fields go.. but this is not your issue... is a CCK / contemplate issue.. not sure if the template can be changed per specific node but it would be nice.

Thank you very much for this modules!

the project consists of

Anonymous's picture

the project consists of several modules, because each module is useful on its own and doesn't need all the other modules to work.

  1. hm, you could use a drupal_goto() in your usernode view, if there are no child nodes...

  2. yeah disabled and it's fine..

  3. read the nodeprofile README. you can use the pageroute module, or the url provided by nodefamily module (read its README) and create a menu item for it by using the menu module.

thank you... I don't know

Anonymous's picture

thank you...

  1. I don't know how to implement the drupal_goto function. a little more help with this would be appreciated. thanks.

  2. nodefamily/"CONTENT-TYPE" links me to a "Page not found" page. I'm sure I'm doing something wrong...

try nodefamily/content_[name

Anonymous's picture

try

nodefamily/content_[name of cck content type]

i read in the original plans that "It should be possible to define multiple profiles, each of them assignable to user roles". I haven't found a way to do this yet. It's key for the successful adoption of usernodes IMO.

thank you... I was

Anonymous's picture

thank you... I was forgetting the "content_"

access control

fago's picture

Access to the cck content types can be restricted by user roles by using the access control page - so you get a role dependend nodeprofile.

Further if you use the pageroute module, the access to the route (and so for the menu item) is also controlled by role.

thx, i figured it must've

Anonymous's picture

thx, i figured it must've been something like that. I guess it makes sense but it wasn't too obvious for me.

Delete

sym's picture

I think that profiles should get deleted, or at least uppublished when a user is deleted. It messes up views that list users and profile fields after a user is deleted.

Do most people have a reason for the profile nodes to be published after the user is deleted?

I will make a patch if this is something people want...

yep

fago's picture

yep, that would make sense.

the usernode get's already unpublished or deleted, however nodeprofile's don't.

So we need to extend the nodefamily module to react on this changes to the usernode and care for propagation of the changes through all related nodes. The question is, would it be sane to have this as default?

I think the core profile module deletes its profile values on user deletion, so I think it would be a useful default behaviour. Or do do you think this should be configurable? Can you think of any use-cases for not propagating changes?

Issue

sym's picture

I think this should become an issue soon, but the question is, what module should it be for?

I think that nodeprofile should do the deleting, rather than nodefamily - because unless I'm wrong, nodefamily can be used without usernodes or nodeprofiles. It is not the case that removing a nodefamily node should always remove a the other nodefamily nodes.

I have made a module that allows a user to delete its account if for some reason they don't want to be a member any more. I think that some people would want to keep the profile to get stats about all the members of the site, no matter if they exits any more. In short, it should be an option, that is on by default.

yeah

fago's picture

I agree, that this should sit in the nodeprofile module. :) So it just has to be done..

http://drupal.org/node/90838

list view of user nodes

Anonymous's picture

With the help of your great node profiles and CCK I have been able to set up very detailed user profiles but now I'm facing a new challenge:

My user profile contains three node types (personal data, contact data and research profile). Obviously each user will only fill in one of each node types. At the moment those nodes are presented one after the other on a single page. I will later organize them in tabs. However I want to add another node: each user should be able to upload files, mostly pdfs or Word documents. This means the profile will have the additional node type "files". The problem I face now: how do I present all the files of an individual user in one view fitting to the profile that was called. I know how to produce a view for one specific fixed UID but I don't have a clue how to do that for a dynamic UID. E.g.: When I click on the link to the profile "Peter", I should see all of Peter's profile nodes plus a table view with the files that Peter has uploaded.
Maybe this is simple but I'm not a PHP guy. I've played around with arguments but didn't get it to work. Any ideas?

Axel

problem solved

Anonymous's picture

For the moment I've just added a mySQL query (a modified version of this code: http://drupal.org/node/38538) to my node-usernode.tpl.php. That does the job.

No access to the demo?

Anonymous's picture

Hi Fago,

I tried to access your demo at more.zites.net again but it will not work. I use myusername@drupal.org with my Drupal password and I get the following error message:

Error -503 : Service Temporarily Unavailable

Sorry. Unrecognized username or password

Axel

hm

fago's picture

hm, for me it works.

Its username@drupal.org and not username@Drupal.org

Anonymous's picture

everything fine now. I used ...@Drupal.org. It has to be lowercase d. Sorry to bother you.

Profiles as nodes

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week