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) »
  • What file controls the front end User Dashboard?
Pages: [1]

Author Topic: What file controls the front end User Dashboard?  (Read 1573 times)

nightlrd

  • I post occasionally
  • **
  • Posts: 62
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: Joomla 1.5
What file controls the front end User Dashboard?
January 07, 2010, 03:50:15 pm
I would like to hide or at the lease change the order of the groups that show on the front-end user dashboard. What file would I need to look at?

Yashodha Chaku

  • Forum Godess / God
  • Ask me questions
  • *****
  • Posts: 755
  • Karma: 57
    • CiviCRM
Re: What file controls the front end User Dashboard?
January 07, 2010, 11:30:45 pm
You might want to look at :
templates/CRM/Contact/Page/View/UserDashBoard/GroupContact.tpl

I recommend using custom templates to achieve the same.
For more details, refer : http://wiki.civicrm.org/confluence/display/CRMDOC/Customize+Built-in,+Profile,+Contribution+and+Event+Registration+Screens


HTH
-Yashodha
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

nightlrd

  • I post occasionally
  • **
  • Posts: 62
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: Joomla 1.5
Re: What file controls the front end User Dashboard?
January 11, 2010, 09:40:10 am
Thanks for the reply. I looked at the file and I don't think it is the one that I am looking for.
I have attached a screenshot of the front end dashboard on our site. as you can see the only thing that is truely being used is the PCP element on the dashboard. How can I "hide" the other elements or at the very least change the weight of them so the PCP element is at the top? Thanks for the advice and help.
« Last Edit: January 11, 2010, 10:22:56 am by nightlrd »

Yashodha Chaku

  • Forum Godess / God
  • Ask me questions
  • *****
  • Posts: 755
  • Karma: 57
    • CiviCRM
Re: What file controls the front end User Dashboard?
January 12, 2010, 04:52:03 am
nightlrd :

Here is a simple fix to put PCP on the top :

Code: [Select]
Index: CRM/Contact/Page/View/UserDashBoard.php
===================================================================
--- CRM/Contact/Page/View/UserDashBoard.php (revision 25842)
+++ CRM/Contact/Page/View/UserDashBoard.php (working copy)
@@ -129,7 +129,15 @@
         $this->_userOptions  = CRM_Core_BAO_Preferences::valueOptions( 'user_dashboard_options' );
 
         $components = CRM_Core_Component::getEnabledComponents();
-
+        if ( $this->_userOptions['PCP'] ) {
+            require_once 'CRM/Contribute/BAO/PCP.php';
+            $dashboardElements[] = array( 'templatePath' => 'CRM/Contribute/Page/PcpUserDashboard.tpl',
+                                          'sectionTitle' => ts( 'Personal Campaign Pages' ),
+                                          'weight'       => 40 );
+            list( $pcpBlock, $pcpInfo) = CRM_Contribute_BAO_PCP::getPcpDashboardInfo( $this->_contactId );
+            $this->assign( 'pcpBlock', $pcpBlock );
+            $this->assign( 'pcpInfo', $pcpInfo );
+        }
         foreach( $components as $name => $component ) {
             $elem = $component->getUserDashboardElement();
             if ( ! $elem ) {
@@ -153,6 +161,7 @@
             $dashboardElements[] = array( 'templatePath' => 'CRM/Contact/Page/View/Relationship.tpl',
                                           'sectionTitle' => ts( 'Your Contacts / Organizations' ),
                                           'weight'       => 40 ); 
             $links =& self::links( );
             $currentRelationships = CRM_Contact_BAO_Relationship::getRelationship($this->_contactId,
@@ -162,18 +171,8 @@
             $this->assign( 'currentRelationships',  $currentRelationships  );
         }
 
-        if ( $this->_userOptions['PCP'] ) {
-            require_once 'CRM/Contribute/BAO/PCP.php';
-            $dashboardElements[] = array( 'templatePath' => 'CRM/Contribute/Page/PcpUserDashboard.tpl',
-                                          'sectionTitle' => ts( 'Personal Campaign Pages' ),
-                                          'weight'       => 40 );
-            list( $pcpBlock, $pcpInfo) = CRM_Contribute_BAO_PCP::getPcpDashboardInfo( $this->_contactId );
-            $this->assign( 'pcpBlock', $pcpBlock );
-            $this->assign( 'pcpInfo', $pcpInfo );
-        }
       
         require_once 'CRM/Utils/Sort.php';
-        usort( $dashboardElements, array( 'CRM_Utils_Sort', 'cmpFunc' ) );
         $this->assign ( 'dashboardElements', $dashboardElements );
 
         if ( $this->_userOptions['Groups'] ) {
Index: templates/CRM/Contact/Page/View/UserDashBoard.tpl
===================================================================
--- templates/CRM/Contact/Page/View/UserDashBoard.tpl (revision 25848)
+++ templates/CRM/Contact/Page/View/UserDashBoard.tpl (working copy)
@@ -1,4 +1,13 @@
 <table class="dashboard-elements">
+
+    {foreach from=$dashboardElements item=element}
+    <tr>
+        <td>
+            <div class="header-dark">{$element.sectionTitle}</div>        
+            {include file=$element.templatePath}
+        </td>
+    </tr>
+    {/foreach}
 {if $showGroup}
     <tr>
         <td>
@@ -11,12 +20,4 @@
     </tr>
 {/if}
 
-    {foreach from=$dashboardElements item=element}
-    <tr>
-        <td>
-            <div class="header-dark">{$element.sectionTitle}</div>        
-            {include file=$element.templatePath}
-        </td>
-    </tr>
-    {/foreach}
 </table>
You can apply the above patch using custom templates.

HTH
-Yashodha
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: What file controls the front end User Dashboard?
January 12, 2010, 12:13:28 pm
Otherwise you may just need to visit /civicrm/admin/setting/preferences/display&reset=1 and uncheck the parts that you don't want exposed?
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

nightlrd

  • I post occasionally
  • **
  • Posts: 62
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: Joomla 1.5
Re: What file controls the front end User Dashboard?
January 15, 2010, 01:29:15 pm
Quote from: nightlrd on January 07, 2010, 03:50:15 pm
I would like to hide or at the lease change the order of the groups that show on the front-end user dashboard. What file would I need to look at?

Peter,
You make me feel sooo small.  ;D
I don't know why I did not see that. I am always looking at the most difficult things for what many times turns out to be something small. Thanks.

Yashodha-
Thank you too for your reply. I was going through the files to try to implement your patch but Peters comment is exactly what I needed.

Thank you both for the responses and help.

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: What file controls the front end User Dashboard?
January 15, 2010, 04:05:51 pm
No sweat - i don't have a coders brain so I tend to look for uncode-type solutions  :P glad it helped
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • What file controls the front end User Dashboard?

This forum was archived on 2017-11-26.