1

I want to list all members by zip-code or city. Then the resulting page to be editable & linkable.

Also, want the resulting page to have "exposed filter" where someone can choose a city from dropdown filter and only list items for that city etc.

By all members i mean: display: [name, membershp status, zipcode and city].

I tried Drupal views, but then couldn't get the address data (zipcode and city) to show up and also couldn't get the resulting page to be editable/linkable (i.e when you click on a contact, to be taken to page where you can edit membership info (set expired to something else etc).

I have done : advanced search -> made it smart group, but couldn't get the resulting page to be linkable. In addition, the results were too much (I just want name, membership status, zip and city).

By "be linkable" i mean i want access the final page as : http://myDomain.com/civicrm/some-link.

Using Drupal 8/9 and civicrm 5.42

Thanks for the directions

2
  • 1
    Answers below are good, but you should be able to just do using Views, use Relationships to get the Addresses in, then build your link to go to the civi record itself, or a webform if you want less options shown to the user
    – petednz - fuzion
    Dec 8 '21 at 3:58
  • That's exactly how I would do it. Dec 8 '21 at 5:31
3

You can build this with CiviCRM Entity https://www.drupal.org/project/civicrm_entity

Enable the "CiviCRM Contact" entity type at the settings page, /admin/structure/civicrm-entity/settings

You can start with a list of contacts, and add a Views Relationship to CiviCRM Addresses to get the state / zip

Use Views field rewrites to make one of the fields linkable to /civicrm-contact/[contact-id]

You can manage what fields show for the contact page at: /admin/structure/civicrm-entity/civicrm-contact/display

3

A CMS-agnostic way to accomplish this is with SearchKit. It ships with CiviCRM 5.42 but is disabled. Enable it at Administer menu » System Settings » Extensions. You'll also want to enable the Afform extensions.

Then, go to Search menu » SearchKit and start a new search. It's very SQL-like. Start with contacts, join address and membership, and at the bottom you can select which fields you'd like to appear. Ignore filters for now, unless you have some "non-exposed" filters.

Once you've got the basic search down, save the search, and create a new display of type "Table" based on the search. On this screen you can add exposed filters, rewrite any URLs you need, and make fields inline editable.

This is a broad overview because what you want to do has several moving parts, but if you're comfortable with Views and you watch the SearchKit videos on the CiviCRM YouTube channel you should have no problem.

3
  • Is the Afform extention a must? link says, archived repo: lab.civicrm.org/extensions/afform
    – salah-1
    Dec 8 '21 at 21:11
  • In search kit membership data not showing up when try to use "where" to join it with contacts
    – salah-1
    Dec 8 '21 at 21:17
  • @salah-1 afform ships with CiviCRM now. If you edit your question to include the URL generated by SearchKit I can look at it on my local machine. Dec 9 '21 at 16:46

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.