Hello again.
Only a little enhacement. If you want to open the form in a modal windows, you can add the modal class to a link to the forms page and then add &tmpl=component too for show nothing but the form.
The problem is that when submiting the form, the messages url that inform us that the form was successfully/unsuccessfully send is hardcoded on controller.php and does not honour the existence of the &tmpl=component url param.
Here you have a diff from the original controller.php file and a modified one that respects this url param.
Code:
--- controller.original.php 2015-03-31 09:53:18.197815731 +0200
+++ controller.php 2015-03-31 10:32:10.242415655 +0200
@@ -243,9 +242,13 @@
else if ((isset($visform->redirecturl) == false || $visform->redirecturl == "")
&& ((isset($visform->textresult) == true && $visform->textresult != "")))
{
+ $input = JFactory::getApplication()->input;
+ if ( $tmpl = $input->get('tmpl','') ) {
+ $tmpl = "&tmpl=" . $tmpl;
+ }
$message = JHTMLVisforms::replacePlaceholder($visform, $visform->textresult);
$app->setUserState('com_visforms.form' . $visform->id . '.message', $message);
- $this->setRedirect( "index.php?option=com_visforms&view=visforms&layout=message&id=".$visform->id);
+ $this->setRedirect( "index.php?option=com_visforms&view=visforms&layout=message&id=".$visform->id . $tmpl);
}
else
{
You need too to include an override template of visforms form to include the url param &tmpl=component or a hidden input field named tmpl and with "component" as value for this to work when sending form.