### Steps to reproduce the issue
Insert a checkbox filed type into a filter definition XML file such as filter_model.xml to the effect:
<field name="layout_checkbox"
type="checkbox"
label="JFIELD_ALT_LAYOUT_LABEL"
description="JFIELD_ALT_MODULE_LAYOUT_DESC"
onchange="this.form.submit();"
/>
When the filter bar is activated, a checkbox field appears with text to the right which says "Alternative Layout" (english)
When the filter bar is activated a checkbox appears, but no text is displayed. The check action does execute the form submit.
PHP 8.1.25
Joomla 5.0
Windows 10
WAMP on a local machine
I believe this should be as simple as adding a line to:
\layouts\joomla\form\field\checkbox.php
to the effect of:
<?php echo $label; ?>
However I am unsure of the ramifications throughout the rest of the project.
The issue is likely with Joomla 4.x as well, however only the 4.4 checkbox.php file was inspected.
Labels |
Removed:
?
|
Labels |
Added:
No Code Attached Yet
|
I think it is preferred to use select
over checkbox
/radio
in the filter.
It will be a simple yes/no drop down, kind of:
<field name="layout_checkbox"
type="list"
label="JFIELD_ALT_LAYOUT_LABEL"
description="JFIELD_ALT_MODULE_LAYOUT_DESC"
onchange="this.form.submit();"
/>
<option>JFIELD_ALT_LAYOUT_LABEL</option>
<option value="1">JYES</option>
</field>
Thank you for the suggestion Fedik. The reason I want to use checkbox is because they are more compact and do not require the user to click list dropdown to see all of the options. One thing I did in the short term is to use checkboxes because I can fit 2 checkboxes in the space of 1 drop down list.
Labels |
Added:
bug
|
The label is already there - its just that the filter layout gives all labels a class of visually hidden.
Sorry I dont know an easy way to resolve this for your specific case but your proposed solution would not be correct