I'm working with the Domain Access module, but one problem I have is that the same contact form is shared within all domains.
It would be good if I could use a different contact form for each domain, and have separated contact categories for each domain.
I'm sending an adaptation of Contact module with this support.

CommentFileSizeAuthor
domain_contact.tar_.gz4.82 KBpablolmiranda

Comments

avpaderno’s picture

Status: Needs work » Active
pablolmiranda’s picture

Assigned: pablolmiranda » Unassigned
agentrickard’s picture

Status: Active » Closed (won't fix)

Simpler fix: Use Domain Prefix and table prefix the {contact} table. We use this as a demo for Domain Prefix sometimes.

Anonymous’s picture

The solution I went with was to remove categories on a theme by theme basis. So in theme 1 I have this in template.php

function hhp_form_alter(&$form, &$form_state, $form_id) {  
  switch ($form_id)  {
    // this removes TTC contact categories from the HHP contact form
    case 'contact_site_form':
  	  unset($form["cid"]["#options"]["4"]);
  	  unset($form["cid"]["#options"]["5"]);
    break;
  }
}

and in theme 2 I have this in template.php

function ttc_form_alter(&$form, &$form_state, $form_id) {  
  switch ($form_id)  {
    // this removes HHP contact categories from the TTC contact form
    case 'contact_site_form':
  	  unset($form["cid"]["#options"]["1"]);
  	  unset($form["cid"]["#options"]["2"]);
  	  unset($form["cid"]["#options"]["3"]);
    break;
  }
}

Works great.

Jenechka’s picture

#3 Thank you it works.