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) »
  • Displaying Relationships
Pages: [1]

Author Topic: Displaying Relationships  (Read 1114 times)

cincyKid

  • Guest
Displaying Relationships
February 26, 2009, 07:36:57 am
I'm using CiviCRM 2.1 and Drupal  6.6.  I've nearly got the website ready to launch, but there are 3 things that I've run into that I can't seem to find an answer for:

1.)  How do I show relationships on a profile?  Each of my contacts have 2 relationships: spouse and assistant.  I need this info to display on the contact's profile.

2.)  When doing an export I need to be able to export the 2 relationships (spouse and assistant) with the contact.  This is very important.

3.)  I cannot find a way to hide empty fields when displaying a profile.

Any help on these 3 items would be greatly appreciated.  I've spent a lot of time researching and the best I could find was something referring to BIRT.  I'm not a programmer and I'm not sure the web host even supports this.

Thanks very much in advance ~



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: Displaying Relationships
February 26, 2009, 08:08:04 am

you will need some programming expertise to do the below.  Since you are not a programmer, you should hire someone from http://civicrm.org/professional/

with regard to your specific queries: (all 3 items require some programming expertise)

1. There is no built in way to do this. However, you should be able to implement the 'pageRun' hook (http://wiki.civicrm.org/confluence/display/CRMUPCOMING/CiviCRM+hook+specification#CiviCRMhookspecification-hookcivicrmpageRun) along with a modified view template to display relationships or any other type of data

2. You will need to write a custom search for this and include all the fields you want exported in the search.

http://wiki.civicrm.org/confluence/display/CRMDOC/Custom+Search+Components

3. You can modify the template (Dynamic.tpl) to hide fields if the value is empty or null

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

cincyKid

  • Guest
Re: Displaying Relationships
February 27, 2009, 08:51:40 am
Thanks for the reply lobo...

I guess I should have clarified that i do have some programming experience but fairly new to php.  I have fixed #3 by modifying the dynamic.tpl (thank you) and am currently working on #1.  I am assuming I use the hooks just like in drupal where i create a custom module and enable/install it...

as a follow up question, if i could, how/where would i get the variable names to use when i use $page->assign for the relationships?

thanks again ~



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: Displaying Relationships
February 27, 2009, 09:26:11 am

1. your hook assumptions are right :)

2. you can use any variable names (that dont conflict) and assign them to your smarty template. In the template you reference those variables with the same name

3. Your hook will require code to take the contact id from the view page and use it in queries to the db to retrieve all relationships (or use some internal functions).

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

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

This forum was archived on 2017-11-26.