HE:Struktur/AG/Web/Kalender-Aggregation/
< HE:Struktur | AG/Web
Version vom 16. Dezember 2009, 17:12 Uhr von imported>Nowrap (→Kalender auf KV- oder Stammtisch-Ebene)
Diese Seite beschreibt das Verfahren, um via Drupal 6 Kalender-Informationen mittels den Modulen Date und Calendar zu aggregieren.
Vorteile
- Date + Calendar haben funktionierende Repeating-Regeln inkl. Ausnahmen
- Kreise und Stammtische können lokal ihre Termine pflegen
- Automatisches Veröffentlichen dieser Termine auf der Landesseite
Kalender auf KV- oder Stammtisch-Ebene
- Es müssen die Module Date und Calendar installiert und aktiviert sein, sowie alle abhängigen
- Zudem muss ein neuer Inhaltstyp (Termin) angelegt werden, der am besten auch importiert wird
- Startseite › Verwalten › Inhaltsverwaltung › Inhaltstypen › Importieren
- Dazu muss das Modul Content Copy von CCK aktiviert sein
- Unter Ansichten (Views) muss die calendar-Ansicht angepasst werden oder kann via folgendem Code importiert werden
- Startseite › Verwalten › Strukturierung › Ansichten › Importieren
- Die Änderung muss dann mittels Klick auch "Speichern" gesichert werden
- Dieser View muss dann auch aktiviert werden
- Falls man das Event-Modul für die Termine verwendet hat, sollte man diese manuell Umschreiben und den Block (Event zu Calendar) tauschen
Calendar-View-Code
$view = new view; $view->name = 'calendar'; $view->description = 'A multi-dimensional calendar view with back/next navigation.'; $view->tag = 'Calendar'; $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( 'title' => array( 'label' => '', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'link_class' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'target' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'strip_tags' => 0, 'html' => 0, ), 'empty' => '', 'hide_empty' => 0, 'empty_zero' => 0, 'link_to_node' => 1, 'exclude' => 0, 'id' => 'title', 'field' => 'title', 'table' => 'node', 'relationship' => 'none', 'override' => array( 'button' => 'Übersteuern', ), ), 'teaser' => array( 'label' => '', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'link_class' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'target' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'strip_tags' => 0, 'html' => 0, ), 'empty' => 'n/a', 'hide_empty' => 0, 'empty_zero' => 0, 'exclude' => 1, 'id' => 'teaser', 'table' => 'node_revisions', 'field' => 'teaser', 'override' => array( 'button' => 'Übersteuern', ), 'relationship' => 'none', ), 'field_calendar_event_value' => array( 'label' => '', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'link_class' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'strip_tags' => 0, 'html' => 0, ), 'link_to_node' => 0, 'label_type' => 'none', 'format' => 'default', 'multiple' => array( 'multiple_number' => '', 'multiple_from' => '', 'multiple_to' => '', 'group' => 0, ), 'repeat' => array( 'show_repeat_rule' => 'hide', ), 'fromto' => array( 'fromto' => 'both', ), 'exclude' => 0, 'id' => 'field_calendar_event_value', 'table' => 'node_data_field_calendar_event', 'field' => 'field_calendar_event_value', 'relationship' => 'none', ), )); $handler->override_option('sorts', array( 'field_calendar_event_value' => array( 'order' => 'ASC', 'delta' => '-1', 'id' => 'field_calendar_event_value', 'table' => 'node_data_field_calendar_event', 'field' => 'field_calendar_event_value', 'relationship' => 'none', 'override' => array( 'button' => 'Übersteuern', ), ), )); $handler->override_option('arguments', array( 'date_argument' => array( 'default_action' => 'default', 'style_plugin' => 'default_summary', 'style_options' => array(), 'wildcard' => 'all', 'wildcard_substitution' => 'Alle', 'title' => '', 'breadcrumb' => '', 'default_argument_type' => 'date', 'default_argument' => '', 'validate_type' => 'none', 'validate_fail' => 'not found', 'date_fields' => array( 'node_data_field_calendar_event.field_calendar_event_value' => 'node_data_field_calendar_event.field_calendar_event_value', ), 'year_range' => '-3:+3', 'date_method' => 'OR', 'granularity' => 'month', 'id' => 'date_argument', 'table' => 'node', 'field' => 'date_argument', 'validate_user_argument_type' => 'uid', 'validate_user_roles' => array( '2' => 0, '3' => 0, '4' => 0, ), 'relationship' => 'none', 'default_options_div_prefix' => '', 'default_argument_image_size' => '_original', 'default_argument_user' => 0, 'default_argument_fixed' => '', 'default_argument_php' => '', 'image_size' => array( '_original' => '_original', 'thumbnail' => 'thumbnail', 'preview' => 'preview', ), 'validate_argument_node_type' => array( 'image' => 0, 'block' => 0, 'calendar' => 0, 'page' => 0, 'story' => 0, ), 'validate_argument_node_access' => 0, 'validate_argument_nid_type' => 'nid', 'validate_argument_vocabulary' => array( '1' => 0, ), 'validate_argument_type' => 'tid', 'validate_argument_transform' => 0, 'validate_user_restrict_roles' => 0, 'validate_argument_php' => '', ), )); $handler->override_option('filters', array( 'status' => array( 'operator' => '=', 'value' => 1, 'group' => '0', 'exposed' => FALSE, 'expose' => array( 'operator' => FALSE, 'label' => '', ), 'id' => 'status', 'table' => 'node', 'field' => 'status', 'relationship' => 'none', ), )); $handler->override_option('access', array( 'type' => 'none', 'role' => array(), 'perm' => '', )); $handler->override_option('cache', array( 'type' => 'none', )); $handler->override_option('title', 'Kalender'); $handler->override_option('header_empty', 1); $handler->override_option('items_per_page', 0); $handler->override_option('use_more', 0); $handler->override_option('use_more_text', 'Weiter'); $handler->override_option('style_plugin', 'calendar_nav'); $handler = $view->new_display('calendar', 'Calendar page', 'calendar_1'); $handler->override_option('sorts', array( 'changed' => array( 'order' => 'DESC', 'granularity' => 'second', 'delta' => '-1', 'id' => 'changed', 'table' => 'node', 'field' => 'changed', 'relationship' => 'none', 'override' => array( 'button' => 'Standard verwenden', ), ), )); $handler->override_option('path', 'calendar'); $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, )); $handler->override_option('calendar_colors', array( '0' => array(), )); $handler->override_option('calendar_colors_vocabulary', array()); $handler->override_option('calendar_colors_taxonomy', array()); $handler->override_option('calendar_popup', 0); $handler->override_option('calendar_date_link', ''); $handler = $view->new_display('calendar_block', 'Calendar block', 'calendar_block_1'); $handler->override_option('block_description', 'Kalender'); $handler->override_option('block_caching', -1); $handler = $view->new_display('calendar_period', 'Year view', 'calendar_period_1'); $handler->override_option('style_plugin', 'calendar_style'); $handler->override_option('style_options', array( 'display_type' => 'year', 'name_size' => 1, 'max_items' => 0, )); $handler->override_option('attachment_position', 'after'); $handler->override_option('inherit_arguments', TRUE); $handler->override_option('inherit_exposed_filters', TRUE); $handler->override_option('inherit_pager', FALSE); $handler->override_option('render_pager', TRUE); $handler->override_option('displays', array( 'calendar_1' => 'calendar_1', 'default' => 0, 'calendar_block_1' => 0, )); $handler->override_option('calendar_type', 'year'); $handler = $view->new_display('calendar_period', 'Month view', 'calendar_period_2'); $handler->override_option('style_plugin', 'calendar_style'); $handler->override_option('style_options', array( 'display_type' => 'month', 'name_size' => '99', 'with_weekno' => '1', 'date_fields' => NULL, 'max_items' => 0, )); $handler->override_option('attachment_position', 'after'); $handler->override_option('inherit_arguments', TRUE); $handler->override_option('inherit_exposed_filters', TRUE); $handler->override_option('inherit_pager', FALSE); $handler->override_option('render_pager', TRUE); $handler->override_option('displays', array( 'calendar_1' => 'calendar_1', 'default' => 0, 'calendar_block_1' => 0, )); $handler->override_option('calendar_type', 'month'); $handler = $view->new_display('calendar_period', 'Day view', 'calendar_period_3'); $handler->override_option('style_plugin', 'calendar_style'); $handler->override_option('style_options', array( 'name_size' => '99', 'with_weekno' => 0, 'max_items' => 0, 'max_items_behavior' => 'more', 'groupby_times' => 'hour', 'groupby_times_custom' => '', 'groupby_field' => '', )); $handler->override_option('attachment_position', 'after'); $handler->override_option('inherit_arguments', TRUE); $handler->override_option('inherit_exposed_filters', TRUE); $handler->override_option('inherit_pager', FALSE); $handler->override_option('render_pager', TRUE); $handler->override_option('displays', array( 'calendar_1' => 'calendar_1', 'default' => 0, 'calendar_block_1' => 0, )); $handler->override_option('calendar_type', 'day'); $handler = $view->new_display('calendar_period', 'Week view', 'calendar_period_4'); $handler->override_option('style_plugin', 'calendar_style'); $handler->override_option('style_options', array( 'name_size' => '99', 'with_weekno' => 0, 'max_items' => 0, 'max_items_behavior' => 'more', 'groupby_times' => 'hour', 'groupby_times_custom' => '', 'groupby_field' => '', )); $handler->override_option('attachment_position', 'after'); $handler->override_option('inherit_arguments', TRUE); $handler->override_option('inherit_exposed_filters', TRUE); $handler->override_option('inherit_pager', FALSE); $handler->override_option('render_pager', TRUE); $handler->override_option('displays', array( 'calendar_1' => 'calendar_1', 'default' => 0, 'calendar_block_1' => 0, )); $handler->override_option('calendar_type', 'week'); $handler = $view->new_display('calendar_period', 'Block view', 'calendar_period_5'); $handler->override_option('style_plugin', 'calendar_style'); $handler->override_option('style_options', array( 'display_type' => 'month', 'name_size' => '1', )); $handler->override_option('attachment_position', 'after'); $handler->override_option('inherit_arguments', TRUE); $handler->override_option('inherit_exposed_filters', TRUE); $handler->override_option('inherit_pager', FALSE); $handler->override_option('render_pager', TRUE); $handler->override_option('displays', array( 'calendar_1' => 0, 'default' => 0, 'calendar_block_1' => 'calendar_block_1', )); $handler->override_option('calendar_type', 'month'); $handler = $view->new_display('calendar_ical', 'iCal feed', 'calendar_ical_1'); $handler->override_option('arguments', array()); $handler->override_option('filters', array( 'status' => array( 'operator' => '=', 'value' => 1, 'group' => '0', 'exposed' => FALSE, 'expose' => array( 'operator' => FALSE, 'label' => '', ), 'id' => 'status', 'table' => 'node', 'field' => 'status', 'relationship' => 'none', ), 'date_filter' => array( 'operator' => '>=', 'value' => array( 'value' => NULL, 'min' => NULL, 'max' => NULL, 'default_date' => 'now', 'default_to_date' => '', ), 'group' => '0', 'exposed' => FALSE, 'expose' => array( 'operator' => FALSE, 'label' => '', ), 'date_fields' => array( 'node_data_field_calendar_event.field_calendar_event_value' => 'node_data_field_calendar_event.field_calendar_event_value', ), 'date_method' => 'OR', 'granularity' => 'day', 'form_type' => 'date_select', 'default_date' => 'now', 'default_to_date' => '', 'year_range' => '-3:+3', 'id' => 'date_filter', 'table' => 'node', 'field' => 'date_filter', 'override' => array( 'button' => 'Standard verwenden', ), 'relationship' => 'none', ), )); $handler->override_option('style_plugin', 'ical'); $handler->override_option('style_options', array( 'mission_description' => FALSE, 'description' => '', 'summary_field' => 'title', 'description_field' => 'teaser', 'location_field' => '', )); $handler->override_option('row_plugin', ''); $handler->override_option('path', 'calendar/ical'); $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, )); $handler->override_option('displays', array( 'calendar_1' => 'calendar_1', 'calendar_block_1' => 'calendar_block_1', 'block_1' => 'block_1', 'default' => 0, )); $handler->override_option('sitename_title', FALSE); $handler = $view->new_display('block', 'Upcoming', 'block_1'); $handler->override_option('fields', array( 'title' => array( 'label' => '', 'link_to_node' => 1, 'exclude' => 0, 'id' => 'title', 'field' => 'title', 'table' => 'node', 'relationship' => 'none', 'format' => 'default', ), 'field_calendar_event_value' => array( 'label' => '', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'link_class' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'strip_tags' => 0, 'html' => 0, ), 'link_to_node' => 0, 'label_type' => 'none', 'format' => 'default', 'multiple' => array( 'multiple_number' => '', 'multiple_from' => '', 'multiple_to' => '', 'group' => 0, ), 'repeat' => array( 'show_repeat_rule' => 'hide', ), 'fromto' => array( 'fromto' => 'both', ), 'exclude' => 0, 'id' => 'field_calendar_event_value', 'table' => 'node_data_field_calendar_event', 'field' => 'field_calendar_event_value', 'override' => array( 'button' => 'Standard verwenden', ), 'relationship' => 'none', ), )); $handler->override_option('arguments', array( 'date_argument' => array( 'default_action' => 'default', 'style_plugin' => 'default_summary', 'style_options' => array(), 'wildcard' => 'all', 'wildcard_substitution' => 'Alle', 'title' => '', 'breadcrumb' => '', 'default_argument_type' => 'date', 'default_argument' => '', 'validate_type' => 'none', 'validate_fail' => 'not found', 'date_fields' => array( 'node_data_field_calendar_event.field_calendar_event_value' => 'node_data_field_calendar_event.field_calendar_event_value', ), 'year_range' => '-3:+3', 'date_method' => 'OR', 'granularity' => 'month', 'id' => 'date_argument', 'table' => 'node', 'field' => 'date_argument', 'validate_user_argument_type' => 'uid', 'validate_user_roles' => array( '2' => 0, '3' => 0, '4' => 0, ), 'override' => array( 'button' => 'Standard verwenden', ), 'relationship' => 'none', 'default_options_div_prefix' => '', 'default_argument_image_size' => '_original', 'default_argument_user' => 0, 'default_argument_fixed' => '', 'default_argument_php' => '', 'image_size' => array( '_original' => '_original', 'thumbnail' => 'thumbnail', 'preview' => 'preview', ), 'validate_argument_node_type' => array( 'image' => 0, 'pagepeel' => 0, 'block' => 0, 'calendar' => 0, 'page' => 0, 'story' => 0, ), 'validate_argument_node_access' => 0, 'validate_argument_nid_type' => 'nid', 'validate_argument_vocabulary' => array( '1' => 0, ), 'validate_argument_type' => 'tid', 'validate_argument_transform' => 0, 'validate_user_restrict_roles' => 0, 'validate_argument_php' => '', ), )); $handler->override_option('filters', array( 'status' => array( 'operator' => '=', 'value' => 1, 'group' => '0', 'exposed' => FALSE, 'expose' => array( 'operator' => FALSE, 'label' => '', ), 'id' => 'status', 'table' => 'node', 'field' => 'status', 'relationship' => 'none', ), 'date_filter' => array( 'operator' => '>=', 'value' => array( 'value' => NULL, 'min' => NULL, 'max' => NULL, 'default_date' => 'now', 'default_to_date' => '', ), 'group' => '0', 'exposed' => FALSE, 'expose' => array( 'operator' => FALSE, 'label' => '', ), 'date_fields' => array( 'node_data_field_calendar_event.field_calendar_event_value' => 'node_data_field_calendar_event.field_calendar_event_value', ), 'date_method' => 'OR', 'granularity' => 'day', 'form_type' => 'date_select', 'default_date' => 'now', 'default_to_date' => '', 'year_range' => '-3:+3', 'id' => 'date_filter', 'table' => 'node', 'field' => 'date_filter', 'override' => array( 'button' => 'Standard verwenden', ), 'relationship' => 'none', ), )); $handler->override_option('title', 'Upcoming'); $handler->override_option('items_per_page', 5); $handler->override_option('use_more', 1); $handler->override_option('style_plugin', 'list'); $handler->override_option('style_options', array( 'grouping' => '', 'type' => 'ul', )); $handler->override_option('block_description', 'Upcoming'); $handler->override_option('block_caching', -1);
Inhaltstyp-Termin-Code
$content['type'] = array ( 'name' => 'Termin', 'type' => 'calendar', 'description' => 'Ein Termin (Event) basierend auf Calendar und Date.', 'title_label' => 'Titel', 'body_label' => 'Textkörper', 'min_word_count' => '0', 'help' => '', 'node_options' => array ( 'status' => true, 'promote' => false, 'sticky' => false, 'revision' => false, ), 'language_content_type' => '0', 'nodeblock' => '0', 'upload' => '1', 'old_type' => 'calendar', 'orig_type' => '', 'module' => 'node', 'custom' => '1', 'modified' => '1', 'locked' => '0', 'xmlsitemap_node_type_priority' => '0.5', 'nodewords_edit_metatags' => 1, 'nodewords_basic_use_teaser' => 0, 'comment' => '0', 'comment_default_mode' => '4', 'comment_default_order' => '1', 'comment_default_per_page' => '50', 'comment_controls' => '3', 'comment_anonymous' => '0', 'comment_subject_field' => '0', 'comment_preview' => '0', 'comment_form_location' => '0', 'image_attach' => '0', 'image_attach_size_teaser' => 'thumbnail', 'image_attach_size_body' => 'thumbnail', 'print_display' => 1, 'print_display_comment' => 0, 'print_display_urllist' => 1, 'print_pdf_display' => 1, 'print_pdf_display_comment' => 0, 'print_pdf_display_urllist' => 1, 'nodewords_nodetype_robots' => array ( 'noindex' => false, 'nofollow' => false, 'noarchive' => false, 'noopd' => false, 'nosnippet' => false, 'noydir' => false, ), 'nodewords_nodetype_keywords' => '', 'nodewords_nodetype_description' => '', 'nodewords_nodetype_desc_php' => '', ); $content['fields'] = array ( 0 => array ( 'label' => 'Datum', 'field_name' => 'field_calendar_event', 'type' => 'date', 'widget_type' => 'date_popup_repeat', 'change' => 'Basisinformation ändern', 'weight' => '-3', 'default_value' => 'now', 'default_value2' => 'blank', 'default_value_code' => '', 'default_value_code2' => '', 'input_format' => 'd.m.Y - H:i:s', 'input_format_custom' => '', 'year_range' => '-3:+3', 'increment' => '1', 'advanced' => array ( 'label_position' => 'above', 'text_parts' => array ( 'year' => 0, 'month' => 0, 'day' => 0, 'hour' => 0, 'minute' => 0, 'second' => 0, ), ), 'label_position' => 'above', 'text_parts' => array ( ), 'description' => '', 'required' => 1, 'multiple' => 1, 'repeat' => 1, 'todate' => 'optional', 'granularity' => array ( 'year' => 'year', 'month' => 'month', 'day' => 'day', 'hour' => 'hour', 'minute' => 'minute', ), 'default_format' => 'medium', 'tz_handling' => 'site', 'timezone_db' => 'UTC', 'repeat_collapsed' => '1', 'op' => 'Feldeinstellungen speichern', 'module' => 'date', 'widget_module' => 'date', 'columns' => array ( 'value' => array ( 'type' => 'varchar', 'length' => 20, 'not null' => false, 'sortable' => true, 'views' => true, ), 'value2' => array ( 'type' => 'varchar', 'length' => 20, 'not null' => false, 'sortable' => true, 'views' => false, ), 'rrule' => array ( 'type' => 'text', 'not null' => false, 'sortable' => false, 'views' => false, ), ), 'display_settings' => array ( 'weight' => '-3', 'parent' => '', 'label' => array ( 'format' => 'above', ), 'teaser' => array ( 'format' => 'default', 'exclude' => 0, ), 'full' => array ( 'format' => 'default', 'exclude' => 0, ), 4 => array ( 'format' => 'default', 'exclude' => 0, ), 5 => array ( 'format' => 'default', 'exclude' => 0, ), 2 => array ( 'format' => 'default', 'exclude' => 0, ), 3 => array ( 'format' => 'default', 'exclude' => 0, ), 'token' => array ( 'format' => 'default', 'exclude' => 0, ), ), ), ); $content['extra'] = array ( 'title' => '-5', 'body_field' => '-4', 'revision_information' => '-1', 'comment_settings' => '2', 'menu' => '-2', 'path' => '0', 'attachments' => '4', 'print' => '1', 'nodewords' => '3', );
Kalender auf LV-Ebene
- Erstellen eines neuen Inhalt Newsfeed
- Startseite › Inhalt erstellen
- Titel in der Form iCal Termine Kreis/Stadt wählen
- Feed URL ist http://domain/calendar/ical
- Unter Processors / FeedAPI Node - create nodes from feed items muss folgendes eingestellt werden
- Node type of feed items: Termin
- Input format for feed items: Full HTML