Add a conditional if statement before the hardcoded echo of the email form heading in components/com_contact/views/contact/tmpl/default.php to allow for flexible display control, such as based on user permissions, layout parameters, or custom overrides.
In the current implementation of default.php within the Joomla Contacts component (com_contact), the email form heading is rendered unconditionally using the following code:
<?php echo '<' . $htag2 . '>' . Text::_('COM_CONTACT_EMAIL_FORM') . '</' . $htag2 . '>'; ?>This outputs a heading (e.g., <h3>Email Form</h3>) regardless of context, which can lead to unnecessary UI elements in certain scenarios, such as:
Introduce a simple if condition before the echo statement to make its rendering optional. This could check against:
$display_email_heading).$this->contact->params->get('show_email')).if ($this->contact->params->get('show_contact_form', 1)).<?php if ($this->contact->params->get('show_email_heading', 1)) : ?>
<?php echo '<' . $htag2 . '>' . Text::_('COM_CONTACT_EMAIL_FORM') . '</' . $htag2 . '>'; ?>
<?php endif; ?>show_email_heading to the contact form's XML parameters (default: 1) for backend control.true or using an existing related parameter.components/com_contact/views/contact/tmpl/default.php (primary).components/com_contact/views/contact/tmpl/form.php (if form-specific).components/com_contact/contact.xml.If this aligns with the component's roadmap, I'd be happy to submit a PR or provide more details!
| Labels |
Added:
No Code Attached Yet
|
||
joomla-cms/components/com_contact/tmpl/contact/default.php
Line 139 in dae20eb