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) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions »
  • Usability Improvements (Moderator: Dave Greenberg) »
  • Drupal Views Glossary Mode
Pages: [1]

Author Topic: Drupal Views Glossary Mode  (Read 4176 times)

kurosevic

  • I’m new here
  • *
  • Posts: 25
  • Karma: 1
Drupal Views Glossary Mode
January 05, 2011, 10:38:43 am
Drupal views (2) has an argument string handler called "Glossary mode" that allows you to make dynamic single pages of views output based on a letter of the alphabet.

This handler doesn't appear to be included for CiviCRM views, and would be a really nice thing to have, since it works with all standard drupal fields.

bouton

  • Guest
Solved: Drupal Views Glossary Mode
October 27, 2011, 03:08:49 am
I know this is old but I was looking for glossary and views and found an answer which might help others.

In Drupal 7/civiCRM 4.0.7 editing civicrm/drupal/modules/views/civicrm.views.inc
<code>
    $data['civicrm_contact']['display_name'] = array(
                 'title' => t('Display Name'),
                 'help' => t('Full Name of the Contact with prefixes and suffixes'),
                 'field' => array(
                       'handler' => 'civicrm_handler_field_contact_link',
                                 'click sortable' => TRUE,
                  ),
                  'argument' => array(
                  'handler' => 'views_handler_argument_string', 
                             // hack to allow display name show glossary mode in views attachment http://drupal.org/node/577442
                             // 'handler' => 'views_handler_argument',
                       ),
                   'filter' => array(
                          'handler' => 'views_handler_filter_string',
                           'allow empty' => TRUE,
                   ),
                  'sort' => array(
                        'handler' => 'views_handler_sort',
                   ),
                  );
</code>

bouton

  • Guest
Re: Drupal Views Glossary Mode
October 27, 2011, 03:28:37 am
Or better yet, as I just learned - rather than hacking put it into your own module

<code>
function myModuleName_views_data_alter(&$data) {

//DISPLAY Name for the Contact (Full Name with Prefixes and Suffixes)
// see civicrm.views.inc around line 238
    $data['civicrm_contact']['display_name'] = array(
        'title' => t('Display Name'),
        'help' => t('Full Name of the Contact with prefixes and suffixes'),
      'field' => array(
         'handler' => 'civicrm_handler_field_contact_link',
         'click sortable' => TRUE,
        ),
        'argument' => array(
         'handler' => 'views_handler_argument_string'
      ),
      'filter' => array(
         'handler' => 'views_handler_filter_string',
         'allow empty' => TRUE,
      ),
      'sort' => array(
         'handler' => 'views_handler_sort',
        )
   );
}
</code>

Daniel Strum

  • I’m new here
  • *
  • Posts: 3
  • Karma: 0
Re: Drupal Views Glossary Mode
April 19, 2013, 05:04:43 pm
Hi bouton... Thanks so much for this module. I have been using it for about a year but I just upgraded civi to 4.3.1 and it no longer seems to enables glossary views for CiviCRM data. Might you be able to take a quick look? Thanks in advance.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions »
  • Usability Improvements (Moderator: Dave Greenberg) »
  • Drupal Views Glossary Mode

This forum was archived on 2017-11-26.