Posted 07.25.2010 by Jack
Random/Framing Notes
- Introduction to HTML 5 book is a primary reference during this conversation
- Is it a good ideal to add a bunch more options, fields, and decisions for what to HTML5ize or not throughout Drupal? This might create some big UI/UX problems.
- Might be better to have all Semantic HTML5 settings on one big page, rather than have the configuration distributed throughout Drupal
- Doing all the config in one place will also give us a really easy way to set all the defaults more manageable.
- However, having all the config in one place AWAY from the creation/edit pages for these entities could be cumbersome
- Can we have the same settings in two places? The Semantic HTML5 module settings page AND the individual settings pages for menus, blocks, etc?
- We're going to start out in Drupal 6, it'll be difficult and messy, but we'll learn as we go and then know how to tackle this in Drupal 7
- If we build an API for this and collaborate with creators of Semantic Views, Semantic CCK, Mothership, etc, might be a great way to go for Drupal 7
- Might never be an API because in Drupal 7 this is going to be done by drupal_render
- We'll need to include JavaScript to include semantic tags on non-HTML5 compliant browsers
- Our goal is to make Drupal work for HTML5, not to make HTML5 work in all web browsers
Forms and Fields
- Form API gives us a big advantage and many abilities to make changes to any form field
- right now we can primarily work with core and CCK fields
- we can provide support moving forward, but we can't completely anticipate what other fields will be used for; we can't inspect backwards
- we can also work with modules like Date, Email
- use the Elements allows module developers to use Form API to get HTML5 form elements into their modules; a separate module would be used to transform core and CCK fields to HTML5 elements
- want to be able to switch fields from "text" field to "email" field; Elements module lets you do some of that already
- we'd need a different module that does what Elements does to core fields
- other things to support with the other module - search (core)
- these modules will override the markup for CCK widgets
- we need to figure out how to override markup for all the fields with HTML5 elements; then we need to figure out how to implement that within the module, allow people to specify which fields they want to override, etc.
- Could also consider getting this stuff into modules (CCK, Date, etc) themselves anyhow to avoid having to develop an entirely separate module
$header and DOCTYPE
- DOCTYPE has to be changed but that's relatively easy
- Header elements are also done differently in HTML5
- In Drupal, $header is spit out by Drupal
- In Drupal 6, $header is populated by both core and by the drupal_set_html_head function - anything can be put into the $header using that function
- We can tackle this on the module level, but would then need to ensure that the module gets executed last (and other modules are already jockeying for that position)
- In Drupal 7 what you're adding to headers is much more structure
- Other option - handle it at the theme level using a preprocess function - wind up with an amorphous blob of text that we could regex to replace tags with HTML5, but it's not foolproof
- A module seems like a headache; a starting point in a base theme might be a better way to go
- If an edge case uses the old HTML ways, the page/site will still work
- If this is done with a module, anyone can do their own HTML5 theme, $header is still printed normally, instead what you get out of $header is now HTML5 instead of the old way to do it
- drupal_add_http_header and drupal_add_html_head are used in Drupal 7, so getting stuff into $header will be much more structured
- We could backport that from Drupal 7, but contrib modules might not work with that backport
- We could implement the backport and append on whatever else was set in the header that isn't handled by the backport at the end, though that could result in double info
- Are there concerns about the order of tags in the header? Probably tags that have to come after everything else will be appended on the theme layer anyway, and if not it would work if we appended things at the end of the D7-backported $header
- Agreement is coming in this discussion that this should be done in the module level; create a wrapper function that overrides drupal_set_html_head and is a backport of what's in Drupal 7; modules can use our function if they provide needed information that they want in the header; and if any modules are not using our function to set header tags those are just appended at the end of the $header
- possible module names: HTML5 API, HTML5 tools
- might have implications for limitations on script and styles tags (e.g. IE limitation of number of CSS files)
- The syntax has only been simplified in HTML5, but how do we get in there and alter those variables?
Document Layout Tags
- The new HTML5 document layout tags include article, header, footer, nav
- Much of this is a theming layer issue
- A group needs to get together, figure out best practices, and rewrite node.tpl.php and page.tpl.php for a base D6 theme
- However, some tags come out of core, CCK, and Views
- Some of the HTML that core spits out has theme functions, some doesn't (e.g. comments)
- We can create a theme function that rewrites and fixes core HTML that doesn't already have a theme function
- Mothership theme might be a good place to look for existing fixes or a list of possible problems to look at
- Views and CCK - do we fix Views and CCK, or do we tell people to use Semantic Views and Semantic CCK instead?
- Can we wrap our solutions up as Features, perhaps including Semantic Views and Semantic CCK
- One possibility - require Semantic Views and Semantic CCK modules as part of this feature, add a lot of HTML5 documentation to the top of the Semantic CCK form (and Semantic Views too?). We should also prepopulate as many predictable HTML5 settings in Semantic CCK and Views as possible, just like what happens in Semantic Views and Semantic CCK already; in both we'll be using HTML5 markup.
Menus and other Drupal entities
- there's a nav tag in HTML5
- Not every menu is a nav, but there are some we know are navs, e.g. primary links and secondary links
- Stuff that only shows up for administrators are second-tier issues for us
- there is some debate about what menus might qualify as navs and what might not
- consider creating a Semantic Menus module
- Though we're not sure of the way we'll do it, we do have a goal of altering the menu creation form so that a user can choose to make a menu HTML5 or not
- Other Drupal entities that we need to tackle similarly: blocks, comments
- Config page for the module(s) we create could turn HTML5ing on for particular entities; turning HTML5 on for those entities will turn on