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 (Moderator: Dave Greenberg) »
  • email addresses not showing in profile if there is both a home and a work.
Pages: [1]

Author Topic: email addresses not showing in profile if there is both a home and a work.  (Read 3655 times)

exodist

  • Guest
email addresses not showing in profile if there is both a home and a work.
April 21, 2008, 09:43:20 am
Drupal 5.7
Civicrm 2.0.1

I need my users to be able to specify and edit their work e-mail address through their user page. The work e-mail can be different than their primary/drupal e-mail. I have a profile for work e-mail, that is the only field in the profile. The profile shows up on the user edit page, however it is empty even if there is a work e-mail address set. If I type one in and submit then it is still empty. The user does have a work e-mail address set in the civicrm contact entry. If I try to type an e-mail address in the user edit page it will ADD an additional work e-mail address instead of changing the one that was there, and the user edit page still shows the field as empty.

Thank you in advance.
« Last Edit: April 21, 2008, 09:52:10 am by exodist »

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: email addresses not showing in profile if there is both a home and a work.
April 22, 2008, 01:30:25 am
Please try and recreate this on the public demo (http://drupal.demo.civicrm.org) - and if it's reproducible file an issue in the issue tracker w/ exact steps to reproduce. thx!
Protect your investment in CiviCRM by  becoming a Member!

Ilan

  • I’m new here
  • *
  • Posts: 16
  • Karma: 0
Re: email addresses not showing in profile if there is both a home and a work.
November 30, 2008, 09:42:30 pm
I recreated the problem in the demo page:

http://drupal.demo.civicrm.org/civicrm/profile?gid=5&reset=1&force=1&search=0

Any Ideas?
Ilan

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: email addresses not showing in profile if there is both a home and a work.
November 30, 2008, 11:36:29 pm
Ilan:

Looks like a bug. For tracking purpose: http://issues.civicrm.org/jira/browse/CRM-3882

Fix will be part CiviCRM v2.1.3 or you can get it from: http://fisheye.civicrm.org/changelog/CiviCRM/?cs=18382

thanx

Kurund
« Last Edit: December 01, 2008, 12:01:05 am by Kurund Jalmi »
Found this reply helpful? Support CiviCRM

brotherhutch

  • Guest
Re: email addresses not showing in profile if there is both a home and a work.
January 01, 2009, 06:23:09 pm
Just a quick note: this fix worked for me as well, when all I wanted to display was name, last name, and email address (primary) and a few custom fields for all contacts through a front end search -- the email was not showing up in the listing even though it was showing up in the profile itself (i.e. after clicking 'view' on the listing).

nikkislaw

  • Guest
Re: email addresses not showing in profile if there is both a home and a work.
January 13, 2009, 09:37:22 am
Thank you for this fix.  It worked for me as well, but the email addresses do not appear as links in my listing.  I might be missing an option there, though.

nikkislaw

  • Guest
Re: email addresses not showing in profile if there is both a home and a work.
January 14, 2009, 01:21:41 pm
I still haven't found a way to make the email addresses in the listing appear as links.  Is there an option I'm missing or some code I can add to the fix posted above?

Any help would be greatly appreciated.  Thanks!

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: email addresses not showing in profile if there is both a home and a work.
January 14, 2009, 03:00:50 pm
Not sure what type of "link" you want - but if for example you want to format email addresses in profile listings (search results) as "mailto:" links - you can do so by creating a custom copy of the corresponding template and modifying it to conditionally add the HTML tag around the value.

The template you need to edit for listings is templates/CRM/Profile/Page/Listings.tpl

You'll need to use some "smarty" conditional to figure out which iteration of the foreach loop is your email column.

Doc on custom templates is here:
http://wiki.civicrm.org/confluence/display/CRMDOC/Customizing+CiviCRM+Screens
Protect your investment in CiviCRM by  becoming a Member!

cincyKid

  • Guest
Re: email addresses not showing in profile if there is both a home and a work.
January 15, 2009, 03:59:40 pm
Ok, I am working on the same thing and I am a PHP/Smarty noob.  All I need is the syntax to find the email column.  I have spent a few hours trying with no luck.  Here is what I have:

{foreach from=$row item=value}   
        {if email} 
         <td><a href='mailto:{$value}'>{$value}</a></td>
      {else}
                <td>{$value}</td>     
      {/if}
{/foreach}

The red line is what I need help with.  I have tried many different things like

{if contact.email}
{if $row == 'email'}
{if $value == 'email'}

to name a few.

Any help on the syntax here?

TIA - Cincy

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: email addresses not showing in profile if there is both a home and a work.
January 15, 2009, 04:51:06 pm
Unfortunately the field name is not included in the rows array - so the easiest (although not terribly robust) way to hack this that I can think of is to figure out which column NUMBER your email is in the row (e.g. the 4th column) - and use that number as your handle. Of course if you modify the Profile listings column order - you'll break this....

Code: [Select]
// note that i've added a "name" attribute to the foreach tag below
{foreach from=$row item=value name=listings}   
      {if $smarty.foreach.listings.iteration EQ 4}
         <td><a href='mailto:{$value}'>{$value}</a></td>
      {else}
         <td>{$value}</td>     
      {/if}
{/foreach}
Protect your investment in CiviCRM by  becoming a Member!

cincyKid

  • Guest
Re: email addresses not showing in profile if there is both a home and a work.
January 15, 2009, 05:31:27 pm
That worked!

Thanks for the help and the quick reply Dave ~

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • email addresses not showing in profile if there is both a home and a work.

This forum was archived on 2017-11-26.