Active
Project:
Content Profile
Version:
6.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
21 Feb 2010 at 11:40 UTC
Updated:
9 Jun 2010 at 08:56 UTC
Hello,
I was wondering if someone could help me with the code to check if content profile (named "profile") exists on the page.tpl.php
I am wanting to print a link for "Create Profile" if content profile does not exist, and print a link for "Edit Profile" if the content profile exists.
Many thanks!
Comments
Comment #1
YK85 commentedwould anyone be able to help with this?
im not able to find this in the documentation anywhere
thanks!
Comment #2
kpv commentedNot sure about $node->language but it works.
For more details see: http://drupalcontrib.org/api/function/content_profile_profile_exists/6
http://drupal.org/node/49768
http://api.drupal.org/api/global/language
Comment #3
texas-bronius commentedThanks for that snippet. A step further is to link right into the authenticated user's edit or create Content Profile form:
Comment #4
YK85 commentedThanks for sharing!
I was wondering what the $node->language = 'en' is needed for?
Also, I found that 'user/'. $user->uid .'/edit/profile' doesn't work, but 'user/'. $user->uid .'/profile/profile' does work.
Is there a way to change the url of the profile edit page to '/profile/edit' without the 'user/'. $user->uid . on the site url?
Comment #5
krisis commentedThe language part is only used in the query for translation purposes. When the translation module is found and the $node->type (in this case content type 'profile') allows for duplicating in different languages, the query will explicitly search for the user profile in that language.