User tests: Successful: Unsuccessful:
This pull request adds a conditional check before rendering the email form heading in
components/com_contact/tmpl/contact/default.php.
The email form heading (COM_CONTACT_EMAIL_FORM) is currently rendered unconditionally.
This causes the heading to appear even when the email form itself is hidden or disabled.
Examples:
show_email_form is disabled.This leads to unnecessary UI output and inconsistent layout behavior.
The email form heading is now displayed only when:
show_email_form).show_email_heading (default: 1) is enabled.Wrapped the heading inside a new conditional block:
<?php if ($tparams->get('show_email_heading', 1)) : ?>
<<?= $htag2 ?>><?= Text::_('COM_CONTACT_EMAIL_FORM') ?></<?= $htag2 ?>>
<?php endif; ?>| Status | New | ⇒ | Pending |
| Category | ⇒ | Front End com_contact |
Hi @richard67 , thank you for your review and feedback.
You’re right on all points. I will update the PR accordingly:
Wrong target branch
Since this is a new feature (not a bug fix), I will reopen the PR against the 6.1-dev branch instead of 5.4-dev.
Code style
I will fix the indentation and formatting using Joomla’s PHPCS standard so the file matches the rest of the codebase.
Missing parameter definition
I added the check for show_email_heading, but I did not add the parameter to the XML configuration.
I will add the parameter field in the appropriate XML file so the feature is complete.
I will push an updated version shortly.
Thanks again for the guidance!
| Title |
|
||||||
| Title |
|
||||||
| Labels |
Added:
Feature
Updates Requested
PR-6.1-dev
|
||
Hi @richard67 , thank you for your review and feedback. You’re right on all points. I will update the PR accordingly:
1. Wrong target branch Since this is a new feature (not a bug fix), I will reopen the PR against the 6.1-dev branch instead of 5.4-dev. 2. Code style I will fix the indentation and formatting using Joomla’s PHPCS standard so the file matches the rest of the codebase. 3. Missing parameter definition I added the check for show_email_heading, but I did not add the parameter to the XML configuration. I will add the parameter field in the appropriate XML file so the feature is complete.I will push an updated version shortly. Thanks again for the guidance!
@sshekhar563 As I have not seen any new PR yet, I have allowed myself now to rebase this PR to 6.1-dev.
The other things I had mentioned still need to be fixed.
@sshekhar563 Thank you for your pull request (PR). However, it has a few issues:
Please check your changes on GitHub here https://github.com/joomla/joomla-cms/pull/46477/files and verify with other places in that file.
Please check and fix or let us know if you have questions.
Thanks in advance.