Answers.Body: <p>Since you are using Drupal would recommend you to build view page by using Views module where you can get organization information of an individual using relationship. This will involve no coding. </p>
  
  <p>If you still want to use Civi Profile than you can over-ride id by using hooks.</p>
  
  <p>Cheers</p>
  
  <p>Pradeep</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-10T20:16:39.710Z
Answers.Text: I'm using profiles in most of my project and I would like to preserve the look across the system, so I'm stuck with profiles :)
  Can you please write more on the hooks idea?
  As I understand I should add `id` query parameter to the string somewhere at the beginning of the request processing, right? I already tried in hook_init and hook_boot (setting `$_GET['id']` to the proper id) but no luck - nothing happens. I don't know much about Drupal programming though :/
  Any advice here?
Answers.UserDisplayName: Michał Grabowski
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-09T23:47:32.957Z
Answers.LastActivityDate: 2019-06-09T23:47:32.957Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>What is the best (or recommended) way to display related organization information in a profile? 
  I use organizational membership so after registration I have an individual record (with Drupal account) and an organization record (related to the individual).</p>
  
  <p>I use Civi profiles to display stored information to my users. It's easy and straightforward when showing the individual's own data. But a profile that shows the related organization's data is what I'm looking for - right now the profile shows empty fields.</p>
  
  <p>I came up with one solution: if I add <code>id=[org_contact_id]</code> to the profile view url, everything is OK. To get Drupal to generate proper link in menu, I'm planning to use <code>menu</code> hook and through CiviCRM API find user's related organization contact id. It seems complicated though (for such a simple task). </p>
  
  <p>Is there an easier way to do that?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-06-10T22:00:45.783Z
Comments.Text: At this point I managed to do it using `hook_menu` with argument wildcards and `drupal_goto` function - it's a bit cleaner version of my idea from the question. It seems to be working fine :)
Comments.UserDisplayName: Michał Grabowski
Tags: <profile><relationships>
Title: Display related organization information using a profile
ThreadText: # Display related organization information using a profile
  
  (Asked by: username_0 on 2019-06-09)
  
  What is the best (or recommended) way to display related organization information in a profile?
  I use organizational membership so after registration I have an individual record (with Drupal account) and an organization record (related to the individual).
  
  I use Civi profiles to display stored information to my users. It's easy and straightforward when showing the individual's own data. But a profile that shows the related organization's data is what I'm looking for - right now the profile shows empty fields.
  
  I came up with one solution: if I add `id=[org_contact_id]` to the profile view url, everything is OK. To get Drupal to generate proper link in menu, I'm planning to use `menu` hook and through CiviCRM API find user's related organization contact id. It seems complicated though (for such a simple task).
  
  Is there an easier way to do that?
  
  **Tags:** profile, relationships
  
  > **Comments:**
  > **username_0**: At this point I managed to do it using `hook_menu` with argument wildcards and `drupal_goto` function - it's a bit cleaner version of my idea from the question. It seems to be working fine :)  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-06-09. Score: 1
  
  Since you are using Drupal would recommend you to build view page by using Views module where you can get organization information of an individual using relationship. This will involve no coding.
  
  If you still want to use Civi Profile than you can over-ride id by using hooks.
  
  Cheers
  
  Pradeep
  
  > **Comments:**
  > **username_0**: I'm using profiles in most of my project and I would like to preserve the look across the system, so I'm stuck with profiles :) Can you please write more on the hooks idea? As I understand I should add `id` query parameter to the string somewhere at the beginning of the request processing, right? I already tried in hook_init and hook_boot (setting `$_GET['id']` to the proper id) but no luck - nothing happens. I don't know much about Drupal programming though :/ Any advice here?  
  
  ---
  
  