Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The user profile page from core uses the "label" class. With default bootstrap styles this is white text on a transparent background. We need to modify this markup to be more Bootstrap friendly. Perhaps the most appropriate would be a description list, possibly the horizontal variant.
Here is the markup that is currently produced:
<!-- THEME DEBUG -->
<!-- THEME HOOK: 'user' -->
<!-- BEGIN OUTPUT from 'core/modules/user/templates/user.html.twig' -->
<article data-quickedit-entity-id="user/1" typeof="schema:Person" about="/user/1">
<!-- THEME DEBUG -->
<!-- THEME HOOK: 'form_element' -->
<!-- BEGIN OUTPUT from 'themes/bootstrap/templates/input/form-element.html.twig' -->
<div class="form-item js-form-item form-type-item js-form-type-item form-item- js-form-item- form-no-label form-group">
<h4 class="label">Member for</h4> 1 month
</div>
<!-- END OUTPUT from 'themes/bootstrap/templates/input/form-element.html.twig' -->
</article>
<!-- END OUTPUT from 'core/modules/user/templates/user.html.twig' -->
Comment | File | Size | Author |
---|---|---|---|
#3 | bootstrap-2761137-member-for-label-is-invisible.patch | 1.14 KB | mstrelan |
Comments
Comment #2
mstrelan CreditAttribution: mstrelan commentedAnother option would be a static form control.
It looks like the label is hardcoded by user.module
It may be tricky to group it with other items inside a description list, but it could be in a list of its own. Are there ever any other items? The only other instance in core of
<h4 class="label">
is in filter-guidelines.html.twig. In that instance Bootstrap should probably override the template to use a description list.Comment #3
mstrelan CreditAttribution: mstrelan commentedI think core should render the "Member for" consistently with other user profile fields, but until then this patch will make it looks similar to Bartik.
Comment #4
mstrelan CreditAttribution: mstrelan commentedSorry for all the noise. Just found the core issue.
Comment #5
markhalliwellYes, this is a core issue.