Good day

Thanks for themes

How override h2 in
<h2 class="block-title element-invisible">Main menu</h2>

I founded this

if (isset($vars['main_menu'])) {
    $text = block_get_blocks_by_region('menu_bar') ? t('Navigation') : t('Main menu');
    $vars['primary_navigation'] = theme('links', array(
      'links' => $vars['main_menu'],
      'attributes' => array(
        'class' => array('menu', 'primary-menu', 'clearfix'),
       ),
      'heading' => array(
        'text' => $text,
        'level' => 'h2',
        'class' => array('element-invisible'),
      )
    ));
  }

but my overide without effect (I try change "level")

Comments

block--menu-bar.tpl.php

Why do you want to change the heading level?

SEO, Semantic, logic

I think "Menu", "Pager", not main parts of my site, my content.

block--menu-bar.tpl.php - override if use superfish menu

default primary menu not overided

These headings are included for two reasons:

Semantic structure (remember, this is HTML5, not XHTML), and accessibility (so screen reader users can more easily navigate by headings and so they have appropriate list headings to contextualize what they are hearing).

By removing these headings you do two things:

1) break the semantic outline of the document.

2) reduce the accessibility of the document.

Of course if you want poor semantics thats entirely up to you, but it sounds to me like you are using old school logic and applying it to new technology - HTML5 requires a different mindset.

1. Where I can read about inserting h2 in html5 ?

I read http://www.w3schools.com/html5/default.asp , but not found nothing about "h2"

http://www.whatwg.org/specs/web-apps/current-work/#headings-and-sections - nothing any using h2 in menu, breadcumbs, paging, etc

2. Screen reader users - very small group. (IE 6 users - more)

What you want to learn about is the "outline", which shows the document structure. When a machine reads a document it trys to figure out whats important on the page (whatever it considers to be important, depends on the machine and its purpose), it can use the document structure to find this out, in other words the machine parses the page and looks at sectioning and implied sectioning elements. Critics have often applauded this theme for its superior outline (its not perfect, but its pretty dam near as good as it gets in Drupal 7).

Your thinking is rooted in HTML4, where you are simply looking at one heading and applying/assuming it carries some level of "importance", this idea is vastly improved (and rather more complicated) in HTML5. The entire document structure is far far more important than one single heading. Remember - this is much more than headings and heading levels, you need to look at the sectioning elements as well (and each elements relative nesting level).

In essence what the machine can do (with a proper outline) is figure out exactly where each section is, how it fits into the overall document tree, and what is important on the page.

As for accessibility - its a requirement in accessibility for all lists to have headings (this makes a lot of sense, and fits very well with HTML5). As for accessibility users mostly using IE6 - no idea where you get that crazy idea from! They use all sorts of browsers just like everyone else, although most tend to use Internet Explorer. Understand that I am one of the main people who worked on accessibility improvements in Drupal 7 core (for nearly 3 years), alongside some of the very smart accessibility folk such as Everett Zufelt and Mike Gifford - and both those guys helped develop this theme, so we have some of the smartest accessibility developers out there who have contributed to this project to build a very accessible and advanced starter theme.

Its also a complete misnomer that accessibility users are a small percentage of users, it can in fact be anywhere from 10 to 20% of all users who have some sort of impediment.

Component:Code» CSS/HTML

2 Jeff Burnz : I don't want use it! Why we can't do disabled it?

pvasili! You can! Override the function and code! Are you happy now! Good!

Status:Active» Fixed

Status:Fixed» Closed (fixed)

Cleaning up.

Hi Jeff - Thanks for the explanation. Accessibility is important...

I believe this should be configurable because in terms of SEO this might not be so good... H2's are important in that area and 'Main Menu' is not what most people want the site to be indexed with. Also, perhaps allow to choose which block element is put there instead of H2?

Thanks !

I give you a tip, in the latest DEV of Adaptivetheme if you are using the Mobile Menu Toggle extension you can configure the Main and User (secondary) menu headings.

Also if you are really concerned about this and do not want to use the Menu Toggle feature you can always use a block in the Menu Bar region and set any heading you want, or none at all.

Thanks! Configuring the block title allows me to configure what goes inside. I am curious though, I've been searching in the code to find where in AT does this H2 get set? I found this in at_core/inc/preprocess.inc

  // Build a variable for the main menu
  if (isset($vars['main_menu'])) {
    $vars['primary_navigation'] = theme('links', array(
      'links' => $vars['main_menu'],
      'attributes' => array(
        'class' => array('menu', 'primary-menu', 'clearfix'),
       ),
      'heading' => array(
        'text' => t('Main menu'),
        'level' => 'h2',
        'class' => array('element-invisible'),
      )
    ));
  }

Changing the 'level' key to h6 for instance doesn't result in any changes, i.e. I still see an h2 in the rendered html. I also tried clearing all caches.

My theme is an AT (pixture_reloaded) sub theme.

Thanks again Jeff

Title:How override h2 in h2 class="block-title element-invisible">Main menu</h2How to override the heading level for the Main menu

Already answered in this issue.