Description of the need
My current use case is that I'd like to add a title field to some paragraphs. In theory, I can use CSS to style these title fields to look like titles, but as I think about accessibility it occurs to me that I shoudl be semantically tagging these titles with <h3>
tags for screen readers. They are legitimate sub-titles on the page and should appear as such to screen readers.
I can't figure out how to do this properly with core features and have been looking for a contrib module that might help.
It seems like the Fences module would be the Drupal 7 solution to this problem. We have a port of the Fences module, but it isn't working for me. https://github.com/backdrop-contrib/fences
While, I would be satisfied with a contrib solution to this problem. Given the accessibility concerns (assuming I understand them correctly), this might be a good feature to have in core.
NOTE: I'm very nervous that I'm missing an obvious existing solution and/or misunderstanding the value/accessibility concerns. Please, let me know if my logic is incorrect. I look forward to what others have to say?
Proposed solution
When creating a text field the user would have the option to wrap the field in a choice of logical html elements that would help improve the semantic markup of the site. I suppose this might be part of the display formatter or a basic field setting.
Alternatives that have been considered
- Fences module (no stabile release)
- Field Wrappers module - (stabile release)
Additional information
This was the closest thing I could find to a current core issue where this is being discussed, but that issue is much broader. https://github.com/backdrop/backdrop-issues/issues/2608#issuecomment-503...
I also asked about this in the forum: https://forum.backdropcms.org/forum/adding-html-element-text-field (Maybe I should have waited for responses in that forum first?)
Recent comments
It seems that if I set the "Block title type" to either "Default" or "Custom", the title (i.e. the view title or the custom title defined in the block, respectively) always appears,...
Hide title of a view block if no results?
How are you generating the View? There are a few ways to do it... but it depends on how you generate your View. Are you using Contextual Filters? You could use the "no...
Hide title of a view block if no results?
Thank you for sharing your final solution. This may be very helpful for future visitors trying to do the same.
Views Accordion as primary navigation