This documentation relates to CiviCRM version 3.2. It's not maintained anymore.
Current version of documentation.

Add content to dashboard with Joomla extensions

Aller directement à la fin des métadonnées
Aller au début des métadonnées

This page refers to outdated version of CiviCRM. Check current version of documentation.


Documentation Search


CiviCRM 3.2 Documentation

Support and Participation

Developer Resources


CiviCRM book!

Make sure to check out Understanding CiviCRM as well! You can also support this project by ordering a hard copy.

Overview

I recently was working on a project where I wanted to add some additional content to the CiviCRM dashboard page. Using a creative mix of extensions, I was able to do this with virtually no need to write code. Here are the extensions and steps taken (which could easily be used in other similar ways).

Scenario:

The organization offers continuing education credits as part of their conferences. We chose to import existing data and structure each course as individual events, and used custom data attached to events to record how many credits each course was worth. Members want to login to the site and see what courses they've attended, and how much credits each is worth. I could have used the events block in the dashboard and modified it to include the additional fields. But they wanted something simpler and cleaner. They also host non-CEC events, and having those additional fields in that list would have cluttered things.

Basic solution outline:

I used a component called Table JX (http://www.toolsjx.com/) which let's me pull any content from my database and display in a sortable and searchable table. I liked this extension for two reasons – although I can't directly insert an SQL query when defining my list, it does allow me to create MySQL views and pull those into the grid; and it has a native function for filtering on the current user. So I could create a view with all relevant fields, including the logged in user's id, and when displayed on the site it can filter to show just that user's records.

I then defined a module position in my site template located below the component placeholder. I created an article that had some intro text and the plugin code for the grid defined above. I then used the content with plugins module (http://www.dioscouri.com/index.php?option=com_ambrasubs&view=categories&categoryid=34&Itemid=43) to insert this article into my module position on the dashboard page. I needed to use this extension because Joomla doesn't fire plugins in module positions natively (a decision made in J1.5 with the desire to reduce page load cost).

So...
Table is constructed and filtered by current user >
Inserted into an article with intro text >
Inserted into a module position.

At that point it was just a matter of cleaning up the css to match the dashboard styles.

Here is the SQL used to build the MySQL view that formed the list. The uf_match table joins Joomla users with the CiviCRM contact, which I needed to do to restrict the display to the current user. The rest joins the participant record with the event table and its corresponding custom data table, so that I can get at the custom fields.

Below find a screenshot of the lower portion of the dashboard (with standard events and membership blocks preceding).

Étiquette
  • Aucun

Creative Commons License
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-Share Alike 3.0 United States Licence.