Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-3448

Add group descriptions to groups in profiles

    Details

    • Type: Improvement
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 2.2.0
    • Fix Version/s: 2.2.0
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      If for example a profile is being used to allow users to signup for your many email newsletters you are going to want a description next to the name for each newsletter. I had to do this in a really hack way:

      function oa_custom_civicrm_buildForm($form_id, &$form) {
      switch ($form_id) {
      case 'CRM_Profile_Form_Dynamic':
      foreach($form->_elements as &$element) {

      // Add the group descriptions to the newletter form elements.
      if ($element->_name == 'group') {
      db_set_active('civicrm');
      foreach($element->_elements as &$option) {
      if ($description = db_result(db_query('SELECT description FROM civicrm_group WHERE id = %d', $option->_attributes['name'])))

      { $option->_text .= '<div style="font-weight:normal">'. $description .'</div>'; }

      }
      db_set_active();
      }

      }
      break;
      }
      }

        Attachments

          Activity

            People

            • Assignee:
              sushant Sushant Paste
              Reporter:
              dalin dave hansen-lange
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: