Problem/Motivation

There is no way to choose if the title will be displayed with h1, h2, etc. It's always a h2 tag.
For a good SEO, it would be good if we could select h1 on the Header banner.

Proposed resolution

Add a heading level select list field with the options: h1, h2, h3, h4, h5, h6
Render the hero banner using the selected heading level field.

CommentFileSizeAuthor
#5 3460078-newFIeld.png41.12 KBaleevas

Issue fork lb_hero-3460078

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

carolpettirossi created an issue. See original summary.

carolpettirossi’s picture

Status: Active » Needs review

I added the field, updated the templates, and kept the same styling for any choice of heading level by adding a block-title class.

Could someone please review it?

aleevas’s picture

Assigned: Unassigned » aleevas
aleevas’s picture

Assigned: aleevas » Unassigned
StatusFileSize
new41.12 KB

@carolpettirossi, Thank you for your code! It looks good, but I had to change the hook_update function to make importing the fields work well. Also, I bumped the changed libraries version.
The new field looking:

new field
Ready for review

froboy’s picture

Version: 1.2.x-dev » 1.3.0
Status: Needs review » Fixed
froboy’s picture

Status: Fixed » Needs work

Couple issues raised from QA:

- the form is no longer using the Entity Browser
- Header level should only allow H1 or H2

froboy’s picture

Status: Needs work » Needs review
froboy’s picture

Version: 1.3.0 » 1.3.2
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.