Answers.Body: <p>I sort of did just this.  Because there is a lot of white space next to the name, we display the membership info after the name.  </p>
  
  <p>Because some of our contacts have multiple memberships and we care about the start and end on some of them, I created a view on membership to concatenate the info we wanted to show.  </p>
  
  <p>So it shows something like John Smith - Gold '16, Alumni class of '05.</p>
  
  <p>The code for the hook is straight forward.  (I can't say the same for the sql for the view):</p>
  
  <pre><code> function ccas_hooks_civicrm_contact_get_displayname(&amp;$displayname, $contactId, $objContact) {
  
   $sql = "select affiliations 
           from ccas_affil_alum
           where contact_id = $contactId";
  
   $affiliations = CRM_Core_DAO::singleValueQuery($sql);
  
   $displayname = $displayname . ' - '.$affiliations;
  </code></pre>
  
  <p>}</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-21T17:21:51.857Z
Answers.LastActivityDate: 2015-07-21T17:21:51.857Z
Answers.UserDisplayName: Paul-Tahoe
Answers.Body: <p>Alternative if you're just displaying data is to attach some extra smarty code to the end of the summary template using <em>templatename</em>.extra.tpl: </p>
  
  <p><a href="https://civicrm.org/blogs/dave-greenberg/now-its-easier-add-custom-behaviors-templates" rel="nofollow">https://civicrm.org/blogs/dave-greenberg/now-its-easier-add-custom-behaviors-templates</a></p>
  
  <p>You can grab the data from the API in this file using smarty api commands. Then use jQuery to insert it into the summary tab where appropriate.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-21T17:09:19.697Z
Answers.LastActivityDate: 2015-07-21T17:09:19.697Z
Answers.UserDisplayName: Andrew West
Answers.Body: <p>Create a new extension and use hook_civicrm_summary which should be of more use and you can add value at any place </p>
  
  <p>Please refer to the following link for more reference 
  <a href="http://wiki.civicrm.org/confluence/display/CRMDOC43/hook_civicrm_summary" rel="nofollow">http://wiki.civicrm.org/confluence/display/CRMDOC43/hook_civicrm_summary</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-21T15:59:56.410Z
Answers.Text: Agreed with this - use API calls in your hook to handle pulling in the membership info.
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-21T16:21:29.337Z
Answers.Text: I dont need to be able to edit the details from there, just display things like membership type and end date, all editing will still be done from within the membership tab.
  
  Clients hey?
  
  I haven't done any work with extensions and hooks yet so this will all be new to me going down this route.
Answers.UserDisplayName: Scott
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-21T15:45:20.517Z
Answers.LastActivityDate: 2015-07-21T15:45:20.517Z
Answers.UserDisplayName: Ramesh - ARTECH Consultancy
Body: <p>I would like to pull through some of the membership details into the summary tab (don't ask... clients...!)</p>
  
  <p>What is the easiest way to do this, as when you are on the summary tab, none of the membership info is assigned to smarty.</p>
  
  <p>This is civicrm 4.5.4</p>
  
  <p>Cheers.</p>
  
Tags: <civimember>
Title: Add membership details to summary tab
ThreadText: # Add membership details to summary tab
  
  (Asked by: username_0 on 2015-07-21)
  
  I would like to pull through some of the membership details into the summary tab (don't ask... clients...!)
  
  What is the easiest way to do this, as when you are on the summary tab, none of the membership info is assigned to smarty.
  
  This is civicrm 4.5.4
  
  Cheers.
  
  **Tags:** civimember
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_3 on 2015-07-21. Score: 3 | Accepted answer
  
  Create a new extension and use hook\_civicrm\_summary which should be of more use and you can add value at any place
  
  Please refer to the following link for more reference
  <http://wiki.civicrm.org/confluence/display/CRMDOC43/hook_civicrm_summary>
  
  > **Comments:**
  > **username_4**: Agreed with this - use API calls in your hook to handle pulling in the membership info.  
  > **username_0**: I dont need to be able to edit the details from there, just display things like membership type and end date, all editing will still be done from within the membership tab.  Clients hey?  I haven't done any work with extensions and hooks yet so this will all be new to me going down this route.  
  
  ---
  
  ### Answer by username_1 on 2015-07-21. Score: 1
  
  I sort of did just this.  Because there is a lot of white space next to the name, we display the membership info after the name.  
  Because some of our contacts have multiple memberships and we care about the start and end on some of them, I created a view on membership to concatenate the info we wanted to show.  
  So it shows something like John Smith - Gold '16, Alumni class of '05.
  The code for the hook is straight forward.  (I can't say the same for the sql for the view):
   function ccas_hooks_civicrm_contact_get_displayname(&$displayname, $contactId, $objContact) {
  
   $sql = "select affiliations 
           from ccas_affil_alum
           where contact_id = $contactId";
  
   $affiliations = CRM_Core_DAO::singleValueQuery($sql);
  
   $displayname = $displayname . ' - '.$affiliations;
  
  }
  
  
  ---
  
  ### Answer by username_2 on 2015-07-21. Score: 1
  
  Alternative if you're just displaying data is to attach some extra smarty code to the end of the summary template using *templatename*.extra.tpl:
  
  <https://civicrm.org/blogs/dave-greenberg/now-its-easier-add-custom-behaviors-templates>
  
  You can grab the data from the API in this file using smarty api commands. Then use jQuery to insert it into the summary tab where appropriate.
  
  
  ---
  
  