jeudi 28 juillet 2016

Drupal node form - how implement hierarchical checkboxes based on taxonomy tree

I can't fix one a very difficult problem for me.

I use drupal 7 and have a custom content type with a taxonomy field with 2 level hierarchy, the path /node/add/mycontenttype.

I know the beautiful module http://ift.tt/TpuzQc and it works perfectly! But for my project, I must use checkboxes instead of select list or drop-down.

I already tried override theme_hierarchical_select_select and dependents, however, the hierarchical_select has own JS which works with "select" only.

Also, I tried drupal ajax API, to rerender the taxonomy field, but it doesn't work if I am doing attachment to a form like

'#ajax' => array(
  'callback' => 'MYMODULE_ajax_callback',
  'wrapper' => 'replace_taxonomy_field',
 ),

in hook_form_alter()!

Any idea or any help?

Thank everybody in advance.




Aucun commentaire:

Enregistrer un commentaire