How to avoid duplicate the almost same contact form?

Hello everybody,
I'm working on a site which displays services.
There are 10 services.
Each service is a Joomla! article.

I would like to display at the bottom of each article a contact form for requesting more info about the service.

My fisrt question:
How could I avoid to create 10 forms?
Each form share the same fields: name, firstname, email, message?
The only paramater that is changing is the recipient email.
So I have 10 recipient emails, each related to the service (and the Joomla! article).

My second question:
I would like to avoid user to select the topic of the form.
In an ideal world, the topic should dynamically be linked to the Joomla! article the form is embeded in.

Any help would be greatly appreciated
Regards
 
When you say "the recipient email", do you mean just a (possibly) hidden field you set, or the email used by an email form plugin (which uses that hidden field)?

The topic could probably be done with an eval'ed default on a field element (set to read only), which does something like:

Code:
$app = JFactory::getApplication();
$articleId = (int) $app->input->get('id', 0);
if (!empty($articleId)) {
   $myDb = JFactory::getDbo();
   $myQuery = $myDb->getQuery(true);
   $myQuery->select('title')->from('#__content')->where('id = ' . $articleId);
   $myDb->setQuery($myQuery);
   return $myDb->loadResult();
}

return '';

-- hugh
 
Hello cheesgrits,

Thank you for your reply.
And for the the hint about my Topic question.

About the recipient email:
Is there a way inside the Joomla! Services articles to fill the recipient email field?
So that the client could write the article and simply add/change the contact email from whithin the Joomla! edit interface?
May be there is something to do with the new Joomla! custom field.

Regards
 
If the 10 articles will always stay the same (so the id does'nt change), now that he have the article id in a field element, maybe a little php script (if id=1 then, if id=2 then, etc...) in a calc element could return the right email adress, and after that you could use this calc element as a placeholder in the email form plugin To adress.

rodeokid
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top