How to display profile listings in CiviCRM on Joomla. …
Note: For now, this is where I jot my notes as I try to get profile listings to display as I require. Once I figure it out, I'll turn these notes into a more practical how-to. Reader comments wanted.
CiviCRM has extensive documentation, but I find it hard to locate what I need. (This might be more a reflection of my lack of familiarity with the subject than on the quality of the project documentation.) Of what I do find, much of it is Drupal-specific with no clear indication of how to use it in Joomla. Here is what I am learning on the subject.
Example (retrieved 16.3.2012) of how one user did it, using unknown versions of Civi and Joomla. Hacking the URL, the parameters appear to be:
- option=com_civicrm: Tells Joomla to use CiviCRM
- view=Profiles: Seems to have no effect and can be omitted
- layout=search: Seems to have no effect and can be omitted
- Itemid=102: Corresponds to (WHAT EXACTLY? THE RELEVANT CIVI PROFILE? A JOOMLA MENU ITEM?)
- force=1: Causes results to be shown; omitting it causes only a search box to be shown
However, placing similar parameters in my domain fail, presumably because I use a different version of Civi and/or Joomla.
The closest I can get is a search form, which when used with null parameters gives me what I want at this URL:
The parameters appear to be:
- option=com_civicrm: Omitting it generates a 404
- task=civicrm/profile: Omitting it gives no error, but null content
- Itemid=170: Joomla's menu item ID; omitting it gets what I want except that Joomla loses its place in the navigation and thinks it's at the docroot (breadcrumbs, menu)
- _qf_Search_display=true: Omitting it seems to have no effect
- qfKey=d11564cffc8765b90bb223d248d9ec58_8685: Omitting it seems to have no effect
So one solution would be to link directly to the URL using "External Link" in Joomla:
…but because the URL references the menu ID, the referenced menu item must be published and public. If unpublished, Joomla again loses its place in the navigation; if not public, Joomla will not display the data and prompts for login.
This document (very useful) suggests that the following parameters are available in Civi 4.1:
- reset=1: If you don't use this, then after viewing one profile you won't see any other profile but the first one. Perhaps it means "we need a new cookie here, so throw away any old ones you have and get a new one"?
- gid=N: Profile number N (see Administer – Customize – CiviCRM Profile)
- force=1: Have the group members appear automatically; don't require the visitor to perform a search
- search=0: Suppress search form
It does not mention the parameter task=civicrm/profile, which as noted above is needed. So what works is a menu item which is a Joomla external URL pointing to:
…with Joomla's lost navigation, as noted above.
Still to do:
* Deal with Joomla's lost navigation. Idea: Turn off breadcrumbs module for that menu item from within the menu item. DONE, works.
* Suppress the unsightly "Mostrar contactos donde:
Contactos 1% Emprendimientos Cane AND Estado del Grupo – "Added"" that comes before the contact list. Ideas: Use CSS to suppress its display. Look at source of the example cited above.
CiviCRM user and administrator guide: Organising your data: Profiles. See in particular the section "Linking to Your Directory".
"Profile Search and Listing" in Linking Profiles