Hi Frederic,
what your are looking for is more like a very small inline form than a multi column form. Out of the box it is not possible to create an inline form with Visforms, but I think you could create a template override for this.
To achive this, is a bit difficult but maybe you are up to it. I assume you only want to display the one input and the submit button in your form.
1) Allow alternative layout in module (this is a feature which I should already have had implemented because it is Joomla! standard and which I have added to my changes for the next Visforms release, so that you will not loose these changes with the next update to Visforms 3.5.1 or higher).
Open the file
modules/mod_visforms/mod_visforms.xml
Scroll to the end and find the
Code:
<fieldset
name="advanced">
<field
name="moduleclass_sfx"
type="text"
label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL"
description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" />
</fieldset>
Replace it with
Code:
<fieldset
name="advanced">
<field
name="layout"
type="modulelayout"
label="JFIELD_ALT_LAYOUT_LABEL"
description="JFIELD_ALT_LAYOUT_LABEL" />
<field
name="moduleclass_sfx"
type="text"
label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL"
description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" />
</fieldset>
2) Create override files
Go to
modules/mod_visforms/tmpl and copy all files from this folder
Go to
templates/myTemplateName/html/mod_visforms
Most probably the folder will not jet exist, so you may have to create the html and/or mod_visforms folder in your template folder.
Paste the copied files in this folder.
3) Create alternative Layout files
Rename the copied files
default.php -> defaultinline.php
default_btdefault.php -> defaultinline_btdefault.php
and so on (so you change the leading "default" to "defaultinline").
4) Change the layout
I would use the default bootstrap layout as a basis for this override. So you have to make some changes to the
defaultinline_btdefault.php file in the override folder in your template.
Find the code section
Code:
//then inputs, textareas, selects and fieldseparators
for ($i=0;$i < $nbFields; $i++)
{
$field = $visforms->fields[$i];
if ($field->typefield != "hidden" && !isset($field->isButton))
{
echo $field->controlHtml;
}
}
Replace it with
Code:
//then inputs, textareas, selects and fieldseparators
echo '<div class="row-fluid">';
for ($i=0;$i < $nbFields; $i++)
{
$field = $visforms->fields[$i];
if ($field->typefield != "hidden" && !isset($field->isButton))
{
echo '<div class="span6">';
echo $field->controlHtml;
echo '</div>';
}
}
Find
Code:
<div class="form-actions">
<?php
//all button on the bottom of the form
for ($i=0;$i < $nbFields; $i++)
{
$field = $visforms->fields[$i];
if (isset($field->isButton) && $field->isButton === true)
{
echo $field->controlHtml;
}
}
Replace it with
Code:
<div class="span6">
<?php
//all button on the bottom of the form
for ($i=0;$i < $nbFields; $i++)
{
$field = $visforms->fields[$i];
if (isset($field->isButton) && $field->isButton === true)
{
echo $field->controlHtml;
}
}
//close row fluid
echo "<div>";
Basically this will display the submit button in one line with the input field. But it's very much "hard coded" so that the layout will not work with more input fields. If you want to use two inputs and the submit button in one row change span6 to span4.
Kind Regars and good luck!
Aicha