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 »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • [SOLVED] Add a list button to tagset fields
Pages: [1]

Author Topic: [SOLVED] Add a list button to tagset fields  (Read 380 times)

TeNNoX

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 0
  • CiviCRM version: v4.4.x
  • CMS version: Drupal v7.x
  • MySQL version: newest
  • PHP version: PHP 5
[SOLVED] Add a list button to tagset fields
August 22, 2014, 01:59:25 am
Hello,

I want to have a button next to the field for a tagset (e.g. on the "new contact" page) to display all the existing tags.
Because if you don't have an overview of the tags, some will call the activity "cooking" and some will call it "kitchen" and another person enters "helping in the kitchen"...
This way there will be multiple tags for the same thing. :/

What would be the best way to implement that?
(What hook can I use? How could I display the tags (Javascript alert is not the best idea, I think)?...)

Thanks in advance,
TeNNoX :)
« Last Edit: August 25, 2014, 07:47:47 am by TeNNoX »

TeNNoX

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 0
  • CiviCRM version: v4.4.x
  • CMS version: Drupal v7.x
  • MySQL version: newest
  • PHP version: PHP 5
Re: Add a list button to tagset fields
August 25, 2014, 07:47:27 am
Solved:
I added this:
http://pastebin.com/jQDrSUt5
to customtemplates\CRM\common\Tag.tpl at the very beginning after <label>{$tagset.parentName}</label>

It's not perfect, but it works :)
« Last Edit: August 25, 2014, 10:04:58 am by TeNNoX »

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: [SOLVED] Add a list button to tagset fields
August 25, 2014, 11:06:15 am
In 4.5 tagsets use the new EntityRef type field which supports setting minimumInputLength to 0, which would result in the select box popping open and showing all available options without the user typing any letters. We do that for e.g. the events list on the backend "New Participant" form.
http://wiki.civicrm.org/confluence/display/CRMDOC/EntityRef+Fields

Regarding your code, you do not need to include a separate copy of jQuery, CiviCRM already ships with that. You can access it as cj in 4.4 and CRM.$ in 4.5.
https://wiki.civicrm.org/confluence/display/CRMDOC/Javascript+Reference
Try asking your question on the new CiviCRM help site.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • [SOLVED] Add a list button to tagset fields

This forum was archived on 2017-11-26.