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) »
  • Help in using civicrm hooks
Pages: [1]

Author Topic: Help in using civicrm hooks  (Read 738 times)

leapywca

  • Guest
Help in using civicrm hooks
October 22, 2009, 01:44:18 pm
hi
I was using hooks to modify the homepage of my CiviCRM. So I implemented the modulename_civicrm_dashboard function in the module file. I was able to add new content to it. However I wanted to know if there is a way to add existing CiviCRM functionality like the Find Contacts functionality(which includes form with search fields whose values are pulled from database) without actually writing the same code again? I tried using the .tpl file associated with it but its giving me unexpected results. Any feedback on this would be really helpful.
Thanks!

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Help in using civicrm hooks
October 23, 2009, 09:58:25 am
Hi,


You can build the form itself from within the html template of the home page

To populate the group & tags, use the crmAPI  to fetch the lists, and loop on them to create the <select>

http://civicrm.org/node/599

You have apis to fetch the list of groups and list of tags
civicrm_group_get

{crmAPI entity='group' action="get" var="groups"}
<select name="group">
<option value="">-all groups...
{foreach from=groups item=group}
<option value="{group.id}">{$group.name}</
{/foreach}
</select>


The code hasn't been tested and the name of the attributes aren't right most probably, but you get the idea hopefully.

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Help in using civicrm hooks

This forum was archived on 2017-11-26.