I have this working if some of the cck content-profile form is complete but should the block be shown if a content-profile node has never been created by the user? (ie the user has never visited and saved the form) I can't see how to do that.
Thanks

Comments

pvhee’s picture

A block will only be shown if content of the specified type is created at this moment. I might put a link to "create content of that type" in the box, thanks for the suggestion.

pvhee’s picture

A block will only be shown if content of the specified type is created at this moment. I might put a link to "create content of that type" in the box, thanks for the suggestion.

Patroclas’s picture

Thanks for your reply.

That facility would certainly be very useful for my application.

pvhee’s picture

Status: Active » Closed (won't fix)
liliplanet’s picture

Yes, subscribe thx! This is for users to create their profile and have not filled in any fields as yet ..

texas-bronius’s picture

Note: If you're using Content Profile, you could use something like this php snippet to detect for a profile or show a link to prompt the user to create it:

global $user;
$node->type = 'profile';
$node->language = 'en';
if(content_profile_profile_exists($node, $user->uid)) {
  print ("<strong>Profile exists</strong>");
} else {
  print (
    l('Create your Profile', 'user/'. $user->uid .'/edit/profile')
  );
}

I adapted this from #720904: code to check if content profile 'profile' exists but am not sure why language might be required. I assume that it should relatively as simple to check for another node's existence.

gregoiresan’s picture

This is interresting, but it still won't make it clear in term of completion. For e.g. : They are 3 content types to make a full profile. One content type if 50% completed. The Content Complete module will say that : Your profile is 50% complete, please complete... bla bla bla. But actually, it might be 15% completed only.

If we could sum up content types, then we could easily mix it to the page route module and having a coherent view of what is completed or not. Having choice to skip steps in the route and update the missing content later.

just an idea...

texas-bronius’s picture

From what I recall, my proposed php snippet was merely an on-off check to provide an easy link into completing the profile-- the Content Complete module should be configured to allow it to determine actual completeness (I think).

gregoiresan’s picture

Actually, I found a roundabout to solve this issue. Espacially for none coders.
(@ Texas-bronius: Your code looks great, but I'm not confident with coding even if it seems simple).

Required modules : Rules & Trigger (core)

Trick : Create Content Profile nodes if user haven't created them

Set new trigger rule : User has logged in - this rule is active

Condition : User has profile (Negate)

Do :

  • + redirect to the page you want (option but should be done before if you have multiple roles)
  • + add node (Content profile / repeat this step for every Content Profile Types)
  • + show message (just to welcome your user option)

save

Voilà !

Now, your newly registered users have the Content Profiles created. And Content Complete can therefore aggregate the data beautifully.