Can I add a contact form for each location?

If you want to add, for example, a contact form that will send an email to you or your location's email address you can follow the steps below using the Locator Component alongside Fabrik, a form generator component.

This is covered in two videos:

Part 1:

Part 2:

Step 1: Install, configure Fabrik and set up your Form. You have to install the Fabrik Component and the Fabrik Joomla Content Plugin. Be sure the Fabrik Content Plugin is published, it does not publish by default.

Create your form, and use this code in the form submission plugin.

$db->setQuery('select value from #__location_fields_link where location_fields_id=10 and location_id=' . JRequest::getInt('id'));
return $db->loadResult();

Create your fields and include a special LocationID field that contains this code in the "Default" option:

return JRequest::getInt('origid');

Ensure your Elements (fields), Forms and Tables are all published in Fabrik.

Step 2: Set up your locations to include an Email and the Fabrik plugin code as shown in the video. Your description field for your location might look like:

<p>Sample Description</p>
<hr id="system-readmore" />
<p>{fabrik view=form id=2}</p>

Step 3: Set up your menu items to "Trigger Content Plugins" and also set "Display only Introtext" to "Yes". You may also optionally alter the position of the {description} tag in the "Item address format" so it appears last in the list.

That's it!