CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • How to change "User ID" field output on View Contact page
Pages: [1]

Author Topic: How to change "User ID" field output on View Contact page  (Read 596 times)

drupleg

  • I post occasionally
  • **
  • Posts: 39
  • Karma: 2
    • Drupal.org Profile
  • CiviCRM version: 4.1
  • CMS version: Drupal 7
  • PHP version: 5.3
How to change "User ID" field output on View Contact page
November 24, 2010, 01:48:45 pm
Hello, I'm looking to remove or change the "User ID" field when viewing a contact record in CiviCRM.  I think this will confuse the non-technical users I unleash this CiviCRM site upon - as the "CiviCRM ID: xxxx" is actually the record ID they need to be concerned with. I've dug in to tpl files and found $drupalID, crm_uf_get_uf_id, uf_id, etc, but now I'm getting pretty deep down the rabbit hole and I'm seeking advice from someone who might know the best practice on this issue.  I've looked into a few ways in no particular order:

  • simply hide the field with css, but the <td> tag as no class to target :(, even nth child won't work because IE doesn't support it :(
  • wordreplacement - change "User ID" to "Website User ID", this works, but is still confusing.
  • customizing the .tpl file somehow, which I've done for Contribute pages no problem, but all I see is variables in these Summary.tpl files related to viewing contact records, I don't see HTML output that I can target or remove.
  • lastly - I think it might be neat to wordreplacement the 'User ID" with "Website Username" and show the username rather than the Drupal ID.

Thank you!
-Tony
« Last Edit: November 24, 2010, 01:51:30 pm by agroff »

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: How to change "User ID" field output on View Contact page
November 24, 2010, 04:20:28 pm
You can definitely customize Summary.tpl and remove those two columns OR add css classes to them. Look for the code section below.  I do think we should add classes to most / all of the cells in the contact summary to allow more css manipulation. If you want to work on a patch which does this for 3.3 that would be cool. I actually added classes in the snippet below to show the pattern we usually use for this type of selector ("crm-$fieldName-label", "crm-$fieldName-value").
 
Code: [Select]
{if $userRecordUrl}
     <td class="label crm-userRecordId-label">{ts}User ID{/ts}</td><td class="crm-userRecordId-value"><a title="View user record" class="user-record-link" href="{$userRecordUrl}">{$userRecordId}</a></div>
{/if}

Some folks also suggested Username (User ID) would be a good improvement (we'd want to keep the ID in parentheses since some people find it useful). A patch for that would also be welcome.
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • How to change "User ID" field output on View Contact page

This forum was archived on 2017-11-26.