Let's get this out of the way now - VIEWS SUCKS - big time - when it comes to accessibility.
The reason why is because the assembled View has zero semantic structure - nada, zip, nothing - it's nothing but a bunch of divs. Sure, you can style the various field extracts using CSS to "look" like headers, lists, etc., but they aren't - they are and remain meaningless divs, and they fail accessibility in a huge way.
Fortunately, there might be a module for that here: http://drupal.org/project/semanticviews , or create your own custom templates, which is what I did for the Student Affairs website. those templates, along with a custom content type and a final view, outputs semantically structured code thta meets all accessibility requirements, and they are currently being used to good effect on sites such as haas.stanford.edu, registrar.stanford.edu and others.
Creating a Stanford News Entry Content type:
- Creat a new content type called 'stanford_news_entry' - We've also named it the same thing 'Stanford News Entry
- Description (feel free to modify as you see fit): "A Stanford News Article has an associated 'teaser' which is traditionally outputted to the front page of the site, with the headline being a hyperlink to the full news story. When creating a News Article, you will be prompted to determine whether it is a Feature Story, a Major Story, or a Minor Story. These classifications can be modified during the life-cycle of the news article, but can only be one of the three at any given time."
CCK new field entries:
Using CCK, you will need to create the following new field inputs:
Label | Name | Type | Configuration |
---|---|---|---|
News Story Type | field_story_type | Text |
|
News Teaser | field_story_teaser | Text |
|
Alternate location | field_reference_url | Text |
|
Feature Story Image | field_feature_image | Text |
|
Major Story Image | field_major_image | Text |
|
Sorting Date | field_sorting_date | Date |
|
Publishing Dates | field_publishing_dates | Date |
|
View Import
IMPORTANT: Student Affairs currently uses Organic Groups and the Workflow module to manage our sites. This Exported View includes settings for these modules, and may need to be modified at the individual site level. You will likely also want this module: http://drupal.org/project/import_export_tool to quickly import this view. (Don't want to do that? Try contacting John Foliot for alternatives.)
$view = new view; $view->name = 'stanford_news_list'; $view->description = 'Homepage News Content'; $view->tag = 'og '; $view->view_php = ''; $view->base_table = 'node'; $view->is_cacheable = FALSE; $view->api_version = 2; $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */ $handler = $view->new_display('default', 'Defaults', 'default'); $handler->override_option('fields', array( 'field_feature_image_value' => array( 'label' => '', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'html' => 0, ), 'link_to_node' => 1, 'label_type' => 'none', 'format' => 'default', 'multiple' => array( 'group' => TRUE, 'multiple_number' => '', 'multiple_from' => '', 'multiple_reversed' => FALSE, ), 'exclude' => 0, 'id' => 'field_feature_image_value', 'table' => 'node_data_field_feature_image', 'field' => 'field_feature_image_value', 'relationship' => 'none', ), 'field_major_image_value' => array( 'label' => 'Major Story Image', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'html' => 0, ), 'link_to_node' => 0, 'label_type' => 'widget', 'format' => 'default', 'multiple' => array( 'group' => TRUE, 'multiple_number' => '', 'multiple_from' => '', 'multiple_reversed' => FALSE, ), 'exclude' => 0, 'id' => 'field_major_image_value', 'table' => 'node_data_field_major_image', 'field' => 'field_major_image_value', 'relationship' => 'none', ), 'field_story_teaser_value' => array( 'label' => 'News Teaser', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'html' => 0, ), 'link_to_node' => 0, 'label_type' => 'widget', 'format' => 'default', 'multiple' => array( 'group' => TRUE, 'multiple_number' => '', 'multiple_from' => '', 'multiple_reversed' => FALSE, ), 'exclude' => 0, 'id' => 'field_story_teaser_value', 'table' => 'node_data_field_story_teaser', 'field' => 'field_story_teaser_value', 'relationship' => 'none', ), 'field_sorting_date_value' => array( 'label' => 'Sorting Date', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'html' => 0, ), 'link_to_node' => 1, 'label_type' => 'widget', 'format' => 'default', 'multiple' => array( 'multiple_number' => '', 'multiple_from' => '', 'multiple_to' => '', 'group' => TRUE, ), 'repeat' => array( 'show_repeat_rule' => '', ), 'fromto' => array( 'fromto' => 'both', ), 'exclude' => 0, 'id' => 'field_sorting_date_value', 'table' => 'node_data_field_sorting_date', 'field' => 'field_sorting_date_value', 'relationship' => 'none', ), )); $handler->override_option('sorts', array( 'field_story_type_value' => array( 'order' => 'ASC', 'delta' => -1, 'id' => 'field_story_type_value', 'table' => 'node_data_field_story_type', 'field' => 'field_story_type_value', 'relationship' => 'none', ), 'field_sorting_date_value' => array( 'order' => 'ASC', 'delta' => -1, 'id' => 'field_sorting_date_value', 'table' => 'node_data_field_sorting_date', 'field' => 'field_sorting_date_value', 'relationship' => 'none', ), )); $handler->override_option('arguments', array( 'group_nid' => array( 'default_action' => 'not found', 'style_plugin' => 'default_summary', 'style_options' => array(), 'wildcard' => 'all', 'wildcard_substitution' => 'All', 'title' => '%1', 'default_argument_type' => 'fixed', 'default_argument' => '', 'validate_type' => 'og_group_types', 'validate_fail' => 'not found', 'break_phrase' => 0, 'not' => 0, 'id' => 'group_nid', 'table' => 'og_ancestry', 'field' => 'group_nid', 'relationship' => 'none', 'default_options_div_prefix' => '', 'default_argument_user' => 0, 'default_argument_fixed' => '', 'default_argument_php' => '', 'validate_argument_node_type' => array( 'webform' => 0, 'basic_page' => 0, 'book' => 0, 'change_log_entry' => 0, 'fellowship' => 0, 'page' => 0, 'registrar_basic_page' => 0, 'stanford_news_entry' => 0, 'stanford_topic_entry' => 0, 'unit' => 0, 'webmaster' => 0, ), 'validate_argument_node_access' => 0, 'validate_argument_nid_type' => 'nid', 'validate_argument_vocabulary' => array( '3' => 0, '5' => 0, '6' => 0, '8' => 0, '9' => 0, '7' => 0, '12' => 0, '17' => 0, '18' => 0, '15' => 0, '16' => 0, ), 'validate_argument_type' => 'tid', 'user_argument_type' => '', 'restrict_user_roles' => 0, 'user_roles' => array(), 'validate_argument_is_member' => 0, 'validate_argument_php' => '', ), )); $handler->override_option('filters', array( 'status_extra' => array( 'id' => 'status_extra', 'table' => 'node', 'field' => 'status_extra', ), 'type' => array( 'operator' => 'in', 'value' => array( 'stanford_news_entry' => 'stanford_news_entry', ), 'group' => '0', 'exposed' => FALSE, 'expose' => array( 'operator' => FALSE, 'label' => '', ), 'id' => 'type', 'table' => 'node', 'field' => 'type', 'relationship' => 'none', ), 'sid' => array( 'operator' => 'in', 'value' => array( '3' => '3', '7' => '7', '8' => '8', ), 'group' => '0', 'exposed' => FALSE, 'expose' => array( 'operator' => FALSE, 'label' => '', ), 'id' => 'sid', 'table' => 'workflow_node', 'field' => 'sid', 'relationship' => 'none', ), )); $handler->override_option('access', array( 'type' => 'none', )); $handler->override_option('cache', array( 'type' => 'none', )); $handler->override_option('title', 'What\'s New'); $handler->override_option('header', '<h2 class="newsheading">What\'s New</h2>'); $handler->override_option('header_format', '1'); $handler->override_option('header_empty', 0); $handler->override_option('use_pager', '1'); $handler->override_option('distinct', 1); $handler->override_option('row_plugin', 'node'); $handler->override_option('row_options', array( 'teaser' => 0, 'links' => 1, 'comments' => 0, )); $handler = $view->new_display('page', 'Main News aggregation', 'page_1'); $handler->override_option('path', 'main_news_agg'); $handler->override_option('menu', array( 'type' => 'none', 'title' => '', 'description' => '', 'weight' => 0, 'name' => 'navigation', )); $handler->override_option('tab_options', array( 'type' => 'none', 'title' => '', 'description' => '', 'weight' => 0, 'name' => 'navigation', ));
I need to more fully document the CCK fields and View instructions, but for this posting, I am providing the templates - check back in a bit and I'll have more done.