Problem/Motivation
In the event of a Block title consisting of more than one word e.g. About Us, the resulting id generated for the block div contains spaces which is not legal HTML. e.g. id="about us".
Proposed resolution
The bootstrap_agency_preprocess_block() hook function needs editing to replace any spaces with a dash character (-) or similar.
Remaining tasks
Now that I've logged the issue I'll submit a patch for this as it should be a fairly simple fix.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | bootstrap_agency-fix-block-id-format-2458511.patch | 521 bytes | yeebot |
Comments
Comment #1
yeebot commentedComment #2
yeebot commentedComment #3
yeebot commentedComment #5
jcnventuraYes, you're right. Although the official way of doing it in Drupal is to call drupal_clean_css_identifier(drupal_strtolower($string)).
But thanks a lot for the heads-up. I hadn't used multiple words titles yet.
Comment #6
yeebot commentedAh... of course. I should have checked first. Thanks for pointing that out.
It might also be worth including drupal_html_id($id) to ensure uniqueness? I did notice this issue when I had 2 blocks with the same title as one contained hidden modal content. The second block ended up with a blank id.
Comment #8
jcnventuraThanks for the tip. That one even lowercases and replaces the spaces, so it's the only one needed.
Note however that in my tests, most of the time it did not ensure uniqueness. It may be that the bootstrap base theme is not calling drupal_html_id().