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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Custom search: how to pass additionnal variables to the template ?
Pages: [1]

Author Topic: Custom search: how to pass additionnal variables to the template ?  (Read 846 times)

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Custom search: how to pass additionnal variables to the template ?
June 12, 2009, 02:43:06 am
Hi,

I'd like to assign more variables than those by default (title,rows...), but can't find the smarty object in the custom php.

Blindness ?

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

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Custom search: how to pass additionnal variables to the template ?
June 12, 2009, 04:47:31 am
This is not an elegant way but it works, check http://fisheye.civicrm.org/browse/CiviCRM/branches/v2.2/CRM/Contact/Form/Search/Custom/ActivitySearch.php?r=18662
We pass activity_id and activity_type_id which are not displayed in the selector.

Kurund
Found this reply helpful? Support CiviCRM

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: Custom search: how to pass additionnal variables to the template ?
June 12, 2009, 06:16:02 am

you can also assign via the form, if you hve the form object:

$form->assign

alternatively you can do:

$template =& CRM_Core_Smarty::singleton( );
$template->assign

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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Custom search: how to pass additionnal variables to the template ?

This forum was archived on 2017-11-26.