2

I have a custom select option field with about 35 options. I'd like to be able to sort the field in Drupal Views by weight instead of value or name.

I looked around for the views integration in the core files but couldn't find the section that exposes custom field option groups to views.

I would assume that it is in all/modules/civicrm/drupal/modules/views/components/civicrm.core.inc but I don't see any mention there.

Custom option groups appear to be exposed in all/modules/civicrm/drupal/modules/views/civicrm.views.inc but I don't see any mention of the option_value table to add the weight column.

Any suggestions on how to expose the weight of individual custom select options in Views?

Thank you!

  • it may be evident based on your links but worth being clear if D7 or D8 – petednz - fuzion Sep 10 at 23:53
  • This particular install is D7. – pmoz Sep 11 at 3:37
0

You can use the Views CiviCRM Expose Tables module to join to CiviCRM tables and columns that aren't otherwise exposed.

| improve this answer | |
  • Thanks Jon. I might try that if I could figure out how to use the module! But after install, I don't see any links to it and clicking on the configure link in modules just takes me to the main views screen. However, the table is already joined somewhere because it's getting the list of options when I add it as an exposed filter. – pmoz Oct 1 at 22:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.