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 »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Hook or Template??
Pages: [1]

Author Topic: Hook or Template??  (Read 736 times)

aspagarino

  • I post occasionally
  • **
  • Posts: 89
  • Karma: 10
  • San Diego Joomla
    • California Center for Sustainable Energy
  • CiviCRM version: CiviCRM 4.3
  • CMS version: Drupal 7
Hook or Template??
June 18, 2010, 04:51:58 pm
I need to modify a template (Contribute\Page\DashBoard.tpl) so that one particular administrator would see a custom template for the Contribution Dashboard on the back end.

The manual states that I might be able to use the {$session} variable to get information about the user.

However, when I access the available variables with debug on, I do not see how I can identify the particular user id... the $session on the Smarty Debug have $session =  CRM_Core_Session Object (0)

I was hoping to do something like this:

{if $session->get('userID') = 2235}
Insert your modifications here
{/if} 

Do I need to use a custom hook instead?... If I am not mistaken hook_civicrm_dashboard is only for the front-end dashboard right?

Thanks,

Andres
Andres

Open Source is Green

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Hook or Template??
June 19, 2010, 07:26:35 am

that should work, can you give it  a shot

i dont think smarty is very smart when displaying objects

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

aspagarino

  • I post occasionally
  • **
  • Posts: 89
  • Karma: 10
  • San Diego Joomla
    • California Center for Sustainable Energy
  • CiviCRM version: CiviCRM 4.3
  • CMS version: Drupal 7
Re: Hook or Template??
June 23, 2010, 09:22:12 am
Thanks Lobo... you are right as always... it works even though smart templates does not show it.

I am buying you another beer! ;)
Andres

Open Source is Green

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Hook or Template??

This forum was archived on 2017-11-26.