I created Custom fields in Mail form and they showed up after Captcha field and before Send button
Captcha should be last field in form before Send button
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-01-05 09:40:14 |
Closed_By | ⇒ | alikon |
It seems that we can't override, I have tried chaneging order of fields in tempaltes/mytemplate/html/com_contact/contact/default_form.php
`<?php
/**
defined('_JEXEC') or die;
JHtml::('behavior.keepalive');
JHtml::('behavior.formvalidator');
?>
<?php $fields = $this->form->getFieldset($fieldset->name); ?>
<?php if (count($fields)) : ?>
<fieldset>
<?php if (isset($fieldset->label) && ($legend = trim(JText::_($fieldset->label))) !== '') : ?>
<legend><?php echo $legend; ?></legend>
<?php endif; ?>
<?php foreach ($fields as $field) : ?>
<?php echo $field->renderField(); ?>
<?php endforeach; ?>
</fieldset>
<?php endif; ?>
<?php if ($fieldset->name === 'captcha' && !$this->captchaEnabled) : ?>
<?php continue; ?>
<?php endif; ?>
<?php endforeach; ?>
<div class="control-group">
<div class="controls">
<button class="btn btn-primary validate" type="submit"><?php echo JText::_('COM_CONTACT_CONTACT_SEND'); ?></button>
<input type="hidden" name="option" value="com_contact" />
<input type="hidden" name="task" value="contact.submit" />
<input type="hidden" name="return" value="<?php echo $this->return_page; ?>" />
<input type="hidden" name="id" value="<?php echo $this->contact->slug; ?>" />
<?php echo JHtml::_('form.token'); ?>
</div>
</div>
</form>
Her is suggested that only way to archive this is hardcode custom field in override template
Your text to link here...
yes, maybe not the most easy/clean override, but the way to go
There is a problem with multilingual sites, you have to create 2 overrides
You can use this override to move captcha to bottom https://gist.github.com/SharkyKZ/592cc44c68eac9b3ef7e0b3abb2699f3.
If the function like now exists in Joomla! 4 for adding custom fields, it's should not be an override, but should be fixed in the Core of Joomla.
Absolutely agree with @svermassen @petrovicivan
This is a layout and UX bug.
@alikon
Please, re-open this issue.
Any chance to get a solution into J!4.2 ?
Thanks in advance.
Status | Closed | ⇒ | New |
Closed_Date | 2020-01-05 09:40:14 | ⇒ | |
Closed_By | alikon | ⇒ | |
Labels |
Added:
No Code Attached Yet
Removed: ? |
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-08-26 10:08:29 |
Closed_By | ⇒ | richard67 |
Nice work !!!
its only nice if it is accepted and for that it needs people to test it
For me it works.
But it's a YooTheme-site.
So I had to copy part of the code (changes) in the file from the template self.
So it's not the repro as it should be for the testing :-(
@petrovicivan can you take a look at #38607 and test the patch? Thank you!
this can be solved with https://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core