Feature Updates Requested PR-6.1-dev Pending

User tests: Successful: Unsuccessful:

avatar sshekhar563
sshekhar563
20 Nov 2025

Summary #46445

This pull request adds a conditional check before rendering the email form heading in
components/com_contact/tmpl/contact/default.php.

Problem

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:

  • When show_email_form is disabled.
  • When contact has no email assigned.
  • When templates or accessibility rules require hiding the heading.

This leads to unnecessary UI output and inconsistent layout behavior.

What This PR Changes

The email form heading is now displayed only when:

  1. The email form is enabled (show_email_form).
  2. The contact has either an email or assigned user.
  3. A new optional parameter show_email_heading (default: 1) is enabled.

Implementation

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; ?>
avatar sshekhar563 sshekhar563 - open - 20 Nov 2025
avatar sshekhar563 sshekhar563 - change - 20 Nov 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 20 Nov 2025
Category Front End com_contact
avatar sshekhar563 sshekhar563 - change - 20 Nov 2025
The description was changed
avatar sshekhar563 sshekhar563 - edited - 20 Nov 2025
avatar richard67
richard67 - comment - 20 Nov 2025

@sshekhar563 Thank you for your pull request (PR). However, it has a few issues:

  1. As it is not a bug fix but a new feature, the PR should be made for the 6.1-dev branch.
  2. Your code style is not nice (indentation of the PHP id and endif).
    Please check your changes on GitHub here https://github.com/joomla/joomla-cms/pull/46477/files and verify with other places in that file.
  3. I think this PR is not complete. It adds the check for the new parameter "show_email_heading'", but it does not add the parameter to some form. Where does that parameter come from?

Please check and fix or let us know if you have questions.

Thanks in advance.

avatar sshekhar563
sshekhar563 - comment - 20 Nov 2025

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!

avatar HLeithner HLeithner - change - 24 Nov 2025
Title
Feature: Add conditional check for email form heading in com_contact default.php
[5.4] Feature: Add conditional check for email form heading in com_contact default.php
avatar HLeithner HLeithner - edited - 24 Nov 2025
avatar richard67 richard67 - change - 5 Dec 2025
Title
[5.4] Feature: Add conditional check for email form heading in com_contact default.php
[6.1] Feature: Add conditional check for email form heading in com_contact default.php
avatar richard67 richard67 - edited - 5 Dec 2025
avatar richard67 richard67 - change - 5 Dec 2025
Labels Added: Feature Updates Requested PR-6.1-dev
avatar richard67
richard67 - comment - 5 Dec 2025

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.

Add a Comment

Login with GitHub to post a comment