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 Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Using the User Dashboard in parts
Pages: [1]

Author Topic: Using the User Dashboard in parts  (Read 572 times)

danaskallman

  • I’m new here
  • *
  • Posts: 12
  • Karma: 0
    • Tadpole Collective
  • CiviCRM version: 4.5.6
  • CMS version: WordPress
  • MySQL version: 5.5
  • PHP version: 5.5
Using the User Dashboard in parts
September 18, 2014, 11:12:15 am
I'm exploring ways in which we could use the User Dashboard page, but in parts, meaning the different parts of the user dashboard appear on different pages. Specifically we'd like to be able the separate the following:
  • Groups or Subscriptions: this is useful to have a subscription page on the website to show all subscriptions in one place
  • Assigned Activities: this allows me to have a front-end space to have non-admin staff see activities without members or donors seeing it too
  • Event history: useful for organizations that have large numbers of events and can be seen separate from the memberships and donations

I imagine it could be useful for each section of the user dashboard as it is now.

I will note that Views & Webforms is NOT an option, I am looking at the user dashboard itself that can be used on WordPress or any CMS for that matter. Any thoughts, ideas on how this could be accomplished or what changes can be made for this to be possible in future versions?

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Using the User Dashboard in parts
September 18, 2014, 11:34:05 am
Hey Dana,

Each one of those dashboard sections is its own template.  So you should be able to write an extension that implements hook_civicrm_xmlMenu to call each section as its own URL.  At that point, you could just drop those URLs into a navigation block or somesuch.
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

danaskallman

  • I’m new here
  • *
  • Posts: 12
  • Karma: 0
    • Tadpole Collective
  • CiviCRM version: 4.5.6
  • CMS version: WordPress
  • MySQL version: 5.5
  • PHP version: 5.5
Re: Using the User Dashboard in parts
September 18, 2014, 04:33:19 pm
Jon, I only saw one for Groups, where are the templates?

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Using the User Dashboard in parts
September 18, 2014, 06:09:29 pm
Hi Dana,

I wasn't sure, so I looked!  I'm documenting the process here...I'm not sure who'll come across it, but whatevs.

* I did "View Source" on this page in my browser, searched for ".tpl", found the name of the parent template for the user dashboard.
* I saw this
Code: [Select]
{foreach from=$dashboardElements item=element} which seems to load the various other templates.
* I turned on debugging from the Administer > System Settings > Debugging and Error Handling menu.
* Added
Code: [Select]
&smartyDebug=1 to the URL for the user dash and reloaded the page.
* In the list of Smarty variables that popped up, I searched the page for "$dashboardElements".


I got this:
Code: [Select]
Array (6)
0 => Array (4)
  class => "crm-dashboard-civicontribute"
  sectionTitle => "Your Contribution(s)"
  templatePath => "CRM/Contribute/Page/UserDashboard.tpl"
  weight => 10
1 => Array (4)
  class => "crm-dashboard-civipledge"
  sectionTitle => "Your Pledge(s)"
  templatePath => "CRM/Pledge/Page/UserDashboard.tpl"
  weight => 15
2 => Array (4)
  class => "crm-dashboard-civievent"
  sectionTitle => "Your Event(s)"
  templatePath => "CRM/Event/Page/UserDashboard.tpl"
  weight => 20
3 => Array (4)
  class => "crm-dashboard-civimember"
  sectionTitle => "Your Membership(s)"
  templatePath => "CRM/Member/Page/UserDashboard.tpl"
  weight => 30
4 => Array (4)
  class => "crm-dashboard-pcp"
  templatePath => "CRM/Contribute/Page/PcpUserDashboard.tpl"
  sectionTitle => "Personal Campaign Pages"
  weight => 40
5 => Array (4)
  class => "crm-dashboard-permissionedOrgs"
  templatePath => "CRM/Contact/Page/View/RelationshipSel..."
  sectionTitle => "Your Contacts / Organizations"
  weight => 40
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

danaskallman

  • I’m new here
  • *
  • Posts: 12
  • Karma: 0
    • Tadpole Collective
  • CiviCRM version: 4.5.6
  • CMS version: WordPress
  • MySQL version: 5.5
  • PHP version: 5.5
Re: Using the User Dashboard in parts
September 24, 2014, 07:40:14 am
Thanks Jon, really helpful.

What I am still confused on is there a way to view each template as you list them now outside of the user dashboard, is there a Civi URL? So if I wanted to see just activities, is there a way to do that?

Code: [Select]
'class' => 'crm-dashboard-assignedActivities',
'templatePath' => 'CRM/Activity/Page/UserDashboard.tpl',
'sectionTitle' => ts('Your Assigned Activities'),
'weight' => 5,

I know there are issues with hooks & WP, there is one alternative we are working around to try get into core to fix that issue, I believe this is the plugin for that as of now: https://github.com/christianwach/civicrm-wp-hook-tester & it may be related to https://issues.civicrm.org/jira/browse/CRM-15298 too, where we can't display more than one piece of civi content at a time with WP.


JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Using the User Dashboard in parts
September 24, 2014, 09:18:31 am
You have to create a handler to view those templates - that should be doable with hook_civicrm_xmlMenu, which lets you say, "someone going to mysite.org/civicrm/userdash/memberships should see a page built with x.tpl".
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Using the User Dashboard in parts

This forum was archived on 2017-11-26.