For modules, for instance, when the xml configuration file contains fieldsets inside a fieldset, the top fieldset attribute 'description' is ignored when rendered. Only fieldsets without fieldset children have their description rendered.
Because fieldset descriptions are important and help users understand what is the content of the tab.
With just a few additional lines of code in the joomla.edit.params layout.
if (!$hasChildren) { [1] } else { [2] }
where
[1] existing code: create fieldset html tag, add legend and div (if description exists)
[2] additional code: add the div if a description exists
Rendering of the fieldset description attribute.
Labels |
Added:
?
|
Thank you!
What I am suggesting:
// Directly add a fieldset if we have no children
if (!$hasChildren)
{
...
} else {
// Include the description when available
if (isset($fieldSet->description) && trim($fieldSet->description))
{
echo '<div class="alert alert-info">';
echo '<span class="fas fa-info-circle" aria-hidden="true"></span><span class="sr-only">' . Text::_('INFO') . '</span> ';
echo Text::_($fieldSet->description);
echo '</div>';
}
}
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-08-21 16:36:32 |
Closed_By | ⇒ | infograf768 |
Sorry, I misunderstood.
Both issues are different. One is for the top fieldset (which result in tabs) and one is for fieldsets inside a tab.
I created 2 posts because I assumed one suggestion might be accepted but not the other.
Status | Closed | ⇒ | New |
Closed_Date | 2020-08-21 16:36:32 | ⇒ | |
Closed_By | infograf768 | ⇒ |
I am confused. Sorry. Reopening.
I cannot find a use case in the core, but I do have the issue in third-party extensions.
In the following example, this third-party extension has a description for the tab 'Picture' (top-most fieldset) but it does not show if there are several children fieldsets inside the tab.
The fix would allow the description to show while it does not now.
To test in the core:
<fieldset name="filtering" label="MOD_ARTICLES_CATEGORY_FIELD_GROUP_FILTERING_LABEL" description="Top most description">
<fieldset name="filtering_child1" label="Child 1">
[some fields]
</fieldset>
<fieldset name="filtering_child2" label="Child 2">
[the remaining fields]
</fieldset>
</fieldset>
Without the updated code, the description won't show. With the updated code, it will.
I am confused. Sorry. Reopening.
Sorry about the confusion, I hope it is more clear now.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-08-22 07:48:52 |
Closed_By | ⇒ | infograf768 |
Let me first correct
layouts/joomla/edit/params.php
for the [1] part as it is wrongthen, after merge, let's discuss this here.
To help, please suggest the code to add IN CORE to create the situation you describe.