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) »
  • Editing the RelatedContact.tpl
Pages: [1]

Author Topic: Editing the RelatedContact.tpl  (Read 643 times)

NASACT

  • I post frequently
  • ***
  • Posts: 289
  • Karma: 9
    • National Association of State Auditors, Comptrollers and Treasurers
  • CiviCRM version: 4.2.2
  • CMS version: Drupal 7
  • MySQL version: 5.1.58 (ubuntu)
  • PHP version: 5.3.5
Editing the RelatedContact.tpl
January 30, 2013, 07:35:55 am
I am trying to add the job_title field to the tpl but without luck.

I started by copying the OnBehalfOf.tpl code into the RelatedContact.tpl which worked just fine since it was simply an include before.

I then tried adding <td>{$form.job_title.label}</td> and <td>{$form.job_title.html}</td> just below the name suffix entries.

This did not result in seeing the label or the field/value.

I am assuming that there is some form of subroutine being called here but I cannot find where this would be coming from so that I can add it in as well.

I wish I was a code guy cause I would know what the $form.xxx.label and .html referred to.  Any help is always appreciated and thanks in advance.
-AJ
My GChat - azon21@gmail.com -  This is where you can find me most days!

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Editing the RelatedContact.tpl
January 30, 2013, 07:47:24 am
Hi,

stick a {debug} into the template, it will show you all the variables that are available and their name (99% sure job title is assigned but not displayed by default)

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

NASACT

  • I post frequently
  • ***
  • Posts: 289
  • Karma: 9
    • National Association of State Auditors, Comptrollers and Treasurers
  • CiviCRM version: 4.2.2
  • CMS version: Drupal 7
  • MySQL version: 5.1.58 (ubuntu)
  • PHP version: 5.3.5
Re: Editing the RelatedContact.tpl
January 30, 2013, 09:01:00 am
I did that and in the Array (17) where those fields come from $form, job_title is not listed.  Any idea how I would go about adding that.  Seems kind of odd that it is missing altogether and not just hidden.

It also says at the bottom:

{$wizard}
Array (6)
steps => Array (1)
  0 => Array (7)
    name => "RelatedContact"
    title => "ERROR: Title is not Set"
    link => null
    step => true
    valid => true
    stepNumber => 1
    collapsed => false
currentStepNumber => 1
currentStepName => "RelatedContact"
currentStepTitle => "ERROR: Title is not Set"
stepCount => 1
style => Array (8)
  barClass => ""
  stepPrefixCurrent => "&raquo;"
  stepPrefixPast => "&radic;"
  stepPrefixFuture => " "
  subStepPrefixCurrent => "&nbsp;&nbsp;"
  subStepPrefixPast => "&nbsp;&nbsp;"
  subStepPrefixFuture => "&nbsp;&nbsp;"
  showTitle => 1
« Last Edit: January 30, 2013, 09:06:22 am by NASACT »
-AJ
My GChat - azon21@gmail.com -  This is where you can find me most days!

NASACT

  • I post frequently
  • ***
  • Posts: 289
  • Karma: 9
    • National Association of State Auditors, Comptrollers and Treasurers
  • CiviCRM version: 4.2.2
  • CMS version: Drupal 7
  • MySQL version: 5.1.58 (ubuntu)
  • PHP version: 5.3.5
Re: Editing the RelatedContact.tpl
February 05, 2013, 08:30:06 am
Just bumping this for a possible help/solution to this issue.  Seems like Job Title should be here in this template.  Would people consider this bug report worthy?

Thanks.
-AJ
My GChat - azon21@gmail.com -  This is where you can find me most days!

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: Editing the RelatedContact.tpl
February 05, 2013, 08:55:07 am

The php code only exposes things that are needed by the template.

If we dont use job_title, we do not expose it as a form element or a value.

You will need to use hooks to add elements that you want shown in the template

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

NASACT

  • I post frequently
  • ***
  • Posts: 289
  • Karma: 9
    • National Association of State Auditors, Comptrollers and Treasurers
  • CiviCRM version: 4.2.2
  • CMS version: Drupal 7
  • MySQL version: 5.1.58 (ubuntu)
  • PHP version: 5.3.5
Re: Editing the RelatedContact.tpl
February 06, 2013, 09:33:36 am
Thanks, any good starting point for adding this one value in?  I am not a programmer so if this is better handled by a one off by someone else that I pay please tell me that too. I really see this as a field that would be included rather than a special hook. Can we MIH this :) I am happy to get approval to fund as a MIH since I see it as a field that makes sense to be there since it is in a lot of the other templates used for editing an individual. That's assuming this is like a 1-2 hour billable gig.
-AJ
My GChat - azon21@gmail.com -  This is where you can find me most days!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Editing the RelatedContact.tpl

This forum was archived on 2017-11-26.