4

I was wondering what the best approach would be to change the layout of a member listing. I'm using wordpress, and have inherited the maintenance of this association website - and believe civiCRM could really help with their internal processes, but a key to this is a public searchable list of members. I've mocked up in wix (don't judge me :) the sort of layout/styling and functionality I was hoping for.

https://sirbrad.wixsite.com/iakpproposal/IAKPPractitioner/find

I'm still getting my head around wordpress, and civicrm, and am not sure of the best practice/approach for creating something like this? Would this be an 'extension' that I would need to create? Or should I work out how to create a wordpress page that uses ajax to call the civicrm methods to retrieve the data and display it using javascript or something?

Any tips, or suggestions as to further reading would be much appreciated.

Warmly

Brad

1 Answer 1

4

@Brad that's a pretty broad question - I'm not sure anyone would be able to give you a complete guide here. However, a good first step would be to see if the CiviCRM Directory plugin fits your needs. It's not very well documented, but you should visit its Settings page (where you need to fill out API keys if you want mapping) and explore the "Directories" content type which the plugin creates.

Each "Directory" will allow you to use a CiviCRM Group as the source for the listings. Layouts can be templated in the usual WordPress manner of placing files in your child theme's directory to override the default markup. In combination with some CSS in your child theme, you should be able to get a long way towards your goal.

6
  • Thanks Christian. Yeah, looking at it now, it is a broad question. I guess I'm trying to get my head around where to start and more importantly HOW to start customising the display of data in CiviCRM. There's so much going on! :) Thanks for this. I'll check it out. Much appreciated
    – Brad
    Commented Mar 14, 2019 at 7:43
  • 1
    It can be complicated for sure. With the Directory plugin, customise the templates by copying the ones you want to change into a folder called "civicrm-directory" in your child theme's folder. You do have a child theme, right? ;-) Commented Mar 14, 2019 at 10:20
  • Nope! But I have been researching them, as I was considering making adjustments to the wordpress theme. Like I said - very new to wordpress, I code every day - just with .net, java, javascript, etc - never had to work with php or wordpress until now :) Thanks for your help and patience.
    – Brad
    Commented Mar 20, 2019 at 1:18
  • Hey Christian, this plugin is great - and your advice was spot on. It has helped a lot. I do have a further question though, and I hope this is the right forum for it - I can't seem to work out where the ajax call - that retrieves the civicrm data is set up. I gather it is an action 'civicrm_directory_search' that is passed to wordpress to handle. Is there a way I can alter the logic? I'm hoping to retrieve - the user image, multiple addresses for each contact for mapping, and expand the search criteria to include other fields. Any chance you could point me in the right direction?
    – Brad
    Commented Mar 29, 2019 at 8:30
  • 1
    @Brad You'll need to look at the civicrm_directory_contacts_get_for_group_params filter to modify the data that's asked for. See: github.com/christianwach/civicrm-directory/blob/master/includes/… Commented Apr 1, 2019 at 10:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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