Create views fields from taxonomies for my module

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by walkero on December 1, 2010 at 11:11am

Hello to all.

I would like to ask you a solution, and of course your help, for a problem that I have.

  • I created one module where I create some forms for the users to complete. There are also fields with terms from taxonomies.
  • I created a tables in the database called "cvprofile" which among others has the following fields "cvid, uid, ..."
  • I created a second table which has the relationship between "cvprofile" and "term_data". There are three fields, "cvid, tid, vid". Here I store the terms the user selects in the forms.
  • I also made one of the fields to work with views by using the following code (a part of the whole code, at least)

    $data['cvprofile_terms']['table']['group'] = t('CV Terms');
    $data['cvprofile_terms']['table']['join'] = array(
    'term_data' => array(
    'left_field' => 'tid',
    'field' => 'tid',
    ),
    );
    $data['cvprofile_terms']['tid'] = array(
    'title' => t('Terms'),
    'help' => t('The terms user selected.'),
    'filter' => array(
    'handler' => 'hs_taxonomy_views_handler_filter_term_node_tid',
    ),
    );

The "hs_taxonomy_views_handler_filter_term_node_tid" is a handler from the "Hierarchical Select" module. This works just great even if I want this field exposed. But the problems started when I tried to add the second taxonomy in the views. If I add a second code like the above, it overrides the first and the view does not work good.

Is there a solution on that? Is there any dosumentation or example code that I should read to find the solution?

Thank you all for your time...

Categories: ,

Views Developers

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /