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 Profiles (Moderator: Dave Greenberg) »
  • Inter-dependent multi-select input fields.
Pages: [1]

Author Topic: Inter-dependent multi-select input fields.  (Read 1260 times)

Scott

  • Guest
Inter-dependent multi-select input fields.
February 12, 2010, 06:35:34 am
I'm not sure if this has been addressed before, but I couldn't find anything when searching the forum.

The Scenario:
I'm a complete newbie to CiviCRM, and I'm essentially 'playing' with it to try and determine whether it could be adapted for use in my business, which has a database of journalists and related media.
Every journalist has a topic (or 'beat' as is known in the industry) that he/she covers, e.g. motoring.
My database has over 120 different beats, divided into various sub-beats. For example, the beat 'business' has sub-beats such as 'current affairs', 'finance/markets', 'management', etc. But, journalists frequently cover many different beats. For example, a journalist may cover business>current affairs, management as well as lifestyle>travel, wine (beat>sub-beat).

The Proposal:
I'd like to have a multi-select field, dependent on another multi-select field, which seems to be the case with the default 'country' and 'state' fields. So ideally my main beats will display on the profile, with the relevant sub-beats hidden until the appropriate beat is selected. For example, the initial profile page will display the main beats, such as 'business', 'lifestyle', 'sport' and once I select either, or all of them, the related sub-beats will appear for me to select. This saves space on the profile page, and logically arranges the beats, as opposed to a sinlge multi-select list of 120 options.

Is this possible? If so, what is the simplest way to implement it, bearing in mind I have near-zero knowledge of CiviCRM and PHP. For what it's worth, I've created a test environment on my local machine, which consists of Windows 7, Xampp 1.7.1, Drupal 6.15 and CiviCRM 3.1.2.

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: Inter-dependent multi-select input fields.
February 12, 2010, 06:55:34 am

this is currently not possible. There is potentially a sponsored project to add hierarchical multi-select support for 3.2, but it is not definite as yet

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

Scott

  • Guest
Re: Inter-dependent multi-select input fields.
February 12, 2010, 07:05:26 am
Thanks for the quick response.

Having 4 or 5 select boxes for the main beats, with their corresponding sub-beats will still be more logical and presentable than a huge multi-select list. Would it be possible to create a custom input field which works the same as the country - state fields? For example...

Business > Current Affairs
               Finance/Markets
               Investment

Lifestyle > Entertainment
               Travel
               Technology/Gadgets

Or are there other alternative solutions I may not have thought of?

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: Inter-dependent multi-select input fields.
February 12, 2010, 07:45:26 am

not via the UI

you can potentially do this via javascript and custom fields and callbacks if you are familiar with jQ and php. i've not tried it, but i do think its possible. if u do so, please share your code

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

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Inter-dependent multi-select input fields.
February 12, 2010, 01:45:59 pm
Have you checked out and rejected using Tags which are hierarchical?

Depends which of this you want for just backend v profiles v Views type exposure
« Last Edit: February 12, 2010, 02:33:46 pm by Dave Greenberg »
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Scott

  • Guest
Re: Inter-dependent multi-select input fields.
February 13, 2010, 08:53:25 am
Thanks, I have thought of using tags and will apply my mind to the possibility and implications next week.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • Inter-dependent multi-select input fields.

This forum was archived on 2017-11-26.