Hi, is there any reason for this HTML inconsistency:
modules/mod_login/tmpl/default.php
<?php if (PluginHelper::isEnabled('system', 'remember')) : ?>
<div class="mod-login__remember form-group">
<div id="form-login-remember-<?php echo $module->id; ?>" class="form-check">
<label class="form-check-label">
<input type="checkbox" name="remember" class="form-check-input" value="yes">
<?php echo Text::_('MOD_LOGIN_REMEMBER_ME'); ?>
</label>
</div>
</div>
<?php endif; ?>
components/com_users/tmpl/login/default_login.php
<?php if (PluginHelper::isEnabled('system', 'remember')) : ?>
<div class="com-users-login__remember">
<div class="form-check">
<input class="form-check-input" id="remember" type="checkbox" name="remember" value="yes">
<label class="form-check-label" for="remember">
<?php echo Text::_('COM_USERS_LOGIN_REMEMBER_ME'); ?>
</label>
</div>
</div>
<?php endif; ?>
I am not primarily asking about the naming of classes, etc. But about the inclusion of individual elements: Once the input is in the label, once it is next to the label.
Thank you, Jan
Labels |
Added:
No Code Attached Yet
|
hello,
In order to make a pull request for this issue, I wanted to talk about something. I was curious what you thought the ideal method for nesting the HTML elements for label and input was. whether they should be nested as in the module section or whether they should be done as in the main login page.
Personally, I believe it is preferable to retain the input tag outside of the label tag because it allows more flexibility when styling with CSS, for example changing the width, and because this bootstrap guide does so as well:
https://getbootstrap.com/docs/4.0/components/forms/#checkboxes-and-radios
Also, the parent-child relationship of the tags in the markup structure should correspond to the confinement in the visual output which means an element surrounding another element in the code should reflect in the browser. Hence the label should be the input's sibling and not its parent. This will also help other coders comprehend the code better.
As in default_login ( the input tag outside of the label tag)
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-01-26 18:19:15 |
Closed_By | ⇒ | richard67 |
probably just legacy reasons