CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Joomla Extensions (Moderator: lcdweb) »
  • Adding to the User Contact Dashboard
Pages: [1]

Author Topic: Adding to the User Contact Dashboard  (Read 2146 times)

RachelWright

  • I post occasionally
  • **
  • Posts: 78
  • Karma: 3
  • CiviCRM version: 4.2.7
  • CMS version: Joomla 2.5.17
  • MySQL version: 5.5.37
  • PHP version: 5.4.26
Adding to the User Contact Dashboard
January 16, 2013, 08:35:29 pm
I'd like to add some information to the user dashboard. I was thinking of trying a hook, but cannot find a function related to the user dashboard.  I found this link: http://forum.civicrm.org/index.php/topic,22114.msg92633.html#msg92633

but need some help with the two suggestions.

1. is to use the pageRun hook and the customize the template. (I've done some poking but couldn't find an example to start from or a helpful push)
2.xxx.extra.tpl works great to inject more stuff. IN conjunction with crmAPI   

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Adding to the User Contact Dashboard
January 16, 2013, 09:10:15 pm
yes, I would take that approach. something like this (inside your plugin):

Code: [Select]
function civicrm_pageRun( &$page ) {
  if ( $page->getVar('_name') == 'CRM_Contact_Page_View_UserDashBoard' ) {
    require_once 'api/api.php';

    $config = CRM_Core_Config::singleton();

    //we only care about frontend display
    if ( !$config->userFrameworkFrontend ) {
      return;
    }

    //construct content for the user
    //can use $page->_contactId to filter api calls and queries on the user

    //now assign content to a smarty variable so I can iterate through in the tpl file
    $page->assign('myStuff', $myStuff);
  }
}
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

RachelWright

  • I post occasionally
  • **
  • Posts: 78
  • Karma: 3
  • CiviCRM version: 4.2.7
  • CMS version: Joomla 2.5.17
  • MySQL version: 5.5.37
  • PHP version: 5.4.26
Re: Adding to the User Contact Dashboard
January 17, 2013, 07:32:42 am
Oh my gosh, you're a life saver, exactly what I needed!!!!!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Joomla Extensions (Moderator: lcdweb) »
  • Adding to the User Contact Dashboard

This forum was archived on 2017-11-26.