As @droath mentioned:

I would like to suggest that we take advantage of the Drupal 7 accessibility classes (element-hidden and element-invisible) instead of inputting a empty string for the title. This way the title it still accessible by screen readers, search engines, ect. What do you think?

Comments

Everett Zufelt’s picture

I am still a bit unclear as to whether this would always be useful.

A couple of use-cases in which this would seem to be appropriate would help.

droath’s picture

Everett Zufelt, here is some more information on this topic. They have a great demonstration video too. :)

http://drupal.org/node/561750

Everett Zufelt’s picture

@droath

Thanks for the link, I have read it. i am actually a completely blind screen-reader user and the D7 Core accessibility maintainer ;) I'm just curious if there is a use-case that would persuade me that this is definitely necessary.

There are three options:

1. Use hidden headings, like we do for the menus in D7 Core.
2. Completely remove the headings.
3. Give the admin the option to hide or completely remove the headings.

In some situations hidden headings may be useful, in others they may be unnecessary. I am not familiar enough with this module to know for sure.

gabrielu’s picture

I say option 3 is the best, and I agree it's something that could be useful for some users.
Actually many developers often use the CSS method (using class `element-invisible`, right?).

I think @droath started well here: http://drupal.org/node/1057044#comment-4080172 but we just need a better way of adding the class, or wrap the title.

Gabriel

Everett Zufelt’s picture

@gabrielu

I like 3 as well. However, how do we clearly communicate to developers the difference between he two, and educate them as to when it is most appropriate to use one over the other?

henrijs.seso’s picture

Subscribing and voting for option to use "element-invisible" class on title.

gabrielu’s picture

Version: 6.x-1.1 » 6.x-1.x-dev

It can easily be achieved by having the option to remove title from display or only attach the "element-invisible" class. But what I am concerned is how can we add this class to title markup. Should we use the edit node.tpl.php and page.tpl.php approach here: http://drupal.org/node/1057044#comment-4080172 ?

gabrielu’s picture

It can easily be achieved by having the option to remove title from display or only attach the "element-invisible" class. But what I am concerned is how can we add this class to title markup. Should we use the edit node.tpl.php and page.tpl.php approach here: http://drupal.org/node/1057044#comment-4080172 ?

henrijs.seso’s picture

Maybe preprocess_node and preprocess_page in module?

droath’s picture

If we use a preprocess_page function. How would we display the title element invisible? Since, not every page.tpl.php has a title $class attribute.

It looks like we could use preprocess_node(). Which works on the node object only.

function MODULE_preprocess_node(&$vars) {
  $vars['title_attributes_array']['class'] = array('element-invisible');
}
gabrielu’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Component: User interface » Code
Assigned: Unassigned » gabrielu

Moved to D7 queue. What @droath says at comment #10 seems reasonable. I give it a try and patch.

Gabriel

fizk’s picture

Assigned: gabrielu » Unassigned
Status: Active » Closed (works as designed)

The bartik theme prints the h1 title like this:

      <h1 class="title" id="page-title">
          <?php print $title; ?>
      </h1>

which means title_attributes_array or title_attributes isn't used at all.

I'm going to close this issue for now since there hasn't been any activity or patches. If there's something I'm missing, please let me know.

fengtan’s picture

Issue summary: View changes
Status: Closed (works as designed) » Needs review
StatusFileSize
new4.59 KB

Attached is a re-roll of @droath's patch.
Re-opening the issue just to check if anyone else is still interested in having this feature.
Alternatively here is a project that extends Exclude Node Title and does the same thing as the attached patch: Exclude Node Title CSS.

Geijutsuka’s picture

I think this is functionality which should be included in the module. We have a website at a university which uses this module and the Disability Resource center on campus ran a scan of our site and identified empty header tags as a compliance issue.

caspervoogt’s picture

The patch (exclude_node_title-accessibility-1058336-13.patch) really helped us on a recent effort to make a university site 508-compliant to WCAG AA standards. I'd love to see this patch rolled into the module and released. Surely passing an empty string to a printed h1 is not the ideal way of doing things, either for accessibility or SEO.

neslee canil pinto’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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