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) »
  • separate links for CheckBox custom fields in profiles
Pages: [1]

Author Topic: separate links for CheckBox custom fields in profiles  (Read 2304 times)

thebenedict

  • Guest
separate links for CheckBox custom fields in profiles
April 11, 2008, 08:45:42 am
I have several alpanumeric custom fields where users provide input using check boxes. I want this input to be searchable, so I've set the field visibility to Public User Pages and Listings. Seach works as expected, but now the checkbox input string is one long search link when the profile is viewed. For example, if I had:

What colors do you like? [X]red [X]orange [ ]yellow [X] green

Then the profile would display red, orange, green as a single seach link, rather than letting me click the colors invidivudally to search for others who like that color.

I am looking for a way to either 1) separate the links, or 2) eliminate the links while the field remains searchable. Any help appreciated!

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: separate links for CheckBox custom fields in profiles
April 11, 2008, 11:58:09 am
Quote from: thebenedict on April 11, 2008, 08:45:42 am
I am looking for a way to either 1) separate the links, or 2) eliminate the links while the field remains searchable. Any help appreciated!

This has come up a few times already.:-(

Regarding 2) - eliminating the links  - I don't see a good reason why "Searchable" and Visibility = "Public User Pages and Listings" need to be linked. But even if you removed the form rule in CRM/UF/Form/Field.php - the field doesn't show up in the search form w/ Visibility = "Public User Pages".

I've filed issues for 2.2 to allow "Searchable" with "Public User Pages":
http://issues.civicrm.org/jira/browse/CRM-2976

.. AND to give separate links for multiple-select values:
http://issues.civicrm.org/jira/browse/CRM-2977

... If you want to see this sooner, you could contribute a patch for 2.1 (OR you could solve your immediate problem by creating a custom version of the profile view template which eliminates the link for fields with a given name(s) - i.e. brute force hack).
Protect your investment in CiviCRM by  becoming a Member!

thebenedict

  • Guest
Re: separate links for CheckBox custom fields in profiles
April 11, 2008, 12:43:22 pm
Thanks for the reply. I'm using a custom profile already, so it might be easiest to use an inline style for now.

That said, I'm happy to take a stab at it. I don't have a sense of how hard it is and would need at least some advice about where to look.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: separate links for CheckBox custom fields in profiles
April 11, 2008, 01:49:51 pm
If you want to get into the code which formats the values / links for your profile checkbox field(s)... look at CRM_Core_BAO_UFGroup::getValues() - esp where CRM_Core_BAO_CustomField::getDisplayValue is called (around line 753 in trunk version) - and then the wrapping w/ the link tags starting around line 819 of that same file ...
Code: [Select]
if ( $field['visibility'] == "Public User Pages and Listings"...
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) »
  • separate links for CheckBox custom fields in profiles

This forum was archived on 2017-11-26.