Hi,

I am very glad to finally have found this module. Very helpful, thank you very much!

To create a form I used hook_form_alter with email field in a custom module just to add a contact form to single nodes. Works as wished.

My problem now is, that I need three different contact forms (different form fields) depending on a per contenttype-field created taxonomy term. I am sort of no-coder, so this is quite difficult to me.
I place the form via panels so my first idea was, to create different panels and to hide them based on a visibility rule in panels. Of course I would have to create three custom modules which contains the needed forms. Propably not the best solution, I know. But it don't work anyway because I just use the email field in panels and views contact form can be addressed only with form id "views_contact_form_contact_form". So I don't have the possibility to address the wished module. But that wouldn't be a professional solution anyway.

What I really need is a way to add a rule to every form field, to hide the field if the taxonomy term of the current node/URL is not 'xy'. I can't find a proper solution anywhere. I think, $node is not available because the form is not related to the node. Might be a problem.
Is here somebody who can give me a small code snippet how I can get this done in my module? Maybe this question would be better in a hook_form_alter-forum but I think, my problem might be related to the views contact forms module.

thank you in advance!
Best regads
Andi

Comments

Likos73 created an issue. See original summary.

balajidharma’s picture

Status: Active » Closed (outdated)

This feature available in Drupal 8 Views Contact Form module.