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 »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • $nick_name to show next to Contact name in Default Basic Search
Pages: [1]

Author Topic: $nick_name to show next to Contact name in Default Basic Search  (Read 1951 times)

Gahanna-6.4

  • Guest
$nick_name to show next to Contact name in Default Basic Search
February 04, 2009, 07:14:26 am
Hello, new CiviCRM.

Version: 2.1.4

In the default basic search, from "Find Contacts -> Search" without entering any search criteria nets me an alphabetized listing of all my Contacts. This is fine, however, I'd like for their nickname ($nick_name) to appear next to their last, first name all the time. I dont need a seperate column to sort/organize them on by nickname, just a simple edit is in order I believe, I just cannot figure out where to do it.

This is what I want it to look like:

Name                                      Address                  City              State Postal   Country             Email                      Phone              Action
Publicson, Chris (nicknamehere)   12345 Some Street   Somewhere    AK    12345    United States    email@address.com    555-555-1212    View | Edit

I noticed that in the view after clicking on a contact, the tabbed version does show the nickname in parentheses. I simply want this same cosmetic effect in the basic search listing.

Thanks in Advance!


D.
================

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: $nick_name to show next to Contact name in Default Basic Search
February 04, 2009, 07:54:12 am

you will need to hack the code to achieve this effect. The place to start would be: CRM/Contact/Selector.php, function getRows( )

If you need more help, contact us on IRC

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: $nick_name to show next to Contact name in Default Basic Search
February 04, 2009, 07:55:28 am
You can apply following patch:

Quote
Index: CRM/Contact/Selector.php
===================================================================
--- CRM/Contact/Selector.php   (revision 19552)
+++ CRM/Contact/Selector.php   (working copy)
@@ -76,7 +76,7 @@
                                 'sort_name', 'street_address',
                                 'city', 'state_province', 'postal_code', 'country',
                                 'geo_code_1', 'geo_code_2',
-                                'email', 'on_hold', 'phone', 'status' );
+                                'email', 'on_hold', 'phone', 'status', 'nick_name' );
 
     /**
      * This caches the content for the display system.
Index: templates/CRM/Contact/Form/Selector.tpl
===================================================================
--- templates/CRM/Contact/Form/Selector.tpl   (revision 19552)
+++ templates/CRM/Contact/Form/Selector.tpl   (working copy)
@@ -66,7 +66,7 @@
                 {$row.status}</td>
             {/if}
             <td>{$row.contact_type}</td>   
-            <td><a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$row.contact_id`"}">{$row.sort_name}</a></td>
+            <td><a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$row.contact_id`"}">{$row.sort_name}</a>{if $row.nick_name}&nbsp;( {$row.nick_name} ){/if}</td>
             {if $action eq 512 or $action eq 256}
               <td>{$row.street_address|mb_truncate:22:"...":true}</td>
               <td>{$row.city}</td>


Kurund
Found this reply helpful? Support CiviCRM

Gahanna-6.4

  • Guest
Re: $nick_name to show next to Contact name in Default Basic Search
February 04, 2009, 08:24:26 am
Kurund,

MANY thanks to you. Works like a charm!

I'm really enjoying CiviCRM after fiddling around with several other CRM's. I found most to either be too 'heavy' or 'lite' for what I needed - CiviCRM has allowed me to be as complex or as simple as I need. I am happy that I settled on using CiviCRM, and our other club members seem to be very impressed with its functionality so far.

Again, many thanks for the cosmetic 'hack'.


D.
========

(CiviCRM 2.1.4 Standalone Version)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • $nick_name to show next to Contact name in Default Basic Search

This forum was archived on 2017-11-26.