Commit 2f7e26a4 authored by ccarigna's avatar ccarigna
Browse files

Fixed breadcrumb for archive view, added css file and block.tpl.php

parent 1b23d91e
.block-events ol {list-style-type: none; margin-left: 0;}
.block-events li ol {list-style-type: square; margin-left: 1.2em;}
.block-events li .item-list {margin-top: .2em;}
\ No newline at end of file
<?php
/**
* @file
* Default theme implementation to display a block.
*
* Available variables:
* - $block->subject: Block title.
* - $content: Block content.
* - $block->module: Module that generated the block.
* - $block->delta: An ID for the block, unique within each module.
* - $block->region: The block region embedding the current block.
* - $classes: String of classes that can be used to style contextually through
* CSS. It can be manipulated through the variable $classes_array from
* preprocess functions. The default values can be one or more of the following:
* - block: The current template type, i.e., "theming hook".
* - block-[module]: The module generating the block. For example, the user module
* is responsible for handling the default user navigation block. In that case
* the class would be "block-user".
* - $title_prefix (array): An array containing additional output populated by
* modules, intended to be displayed in front of the main title tag that
* appears in the template.
* - $title_suffix (array): An array containing additional output populated by
* modules, intended to be displayed after the main title tag that appears in
* the template.
*
* Helper variables:
* - $classes_array: Array of html class attribute values. It is flattened
* into a string within the variable $classes.
* - $block_zebra: Outputs 'odd' and 'even' dependent on each block region.
* - $zebra: Same output as $block_zebra but independent of any block region.
* - $block_id: Counter dependent on each block region.
* - $id: Same output as $block_id but independent of any block region.
* - $is_front: Flags true when presented in the front page.
* - $logged_in: Flags true when the current user is a logged-in member.
* - $is_admin: Flags true when the current user is an administrator.
* - $block_html_id: A valid HTML ID and guaranteed unique.
*
* @see template_preprocess()
* @see template_preprocess_block()
* @see template_process()
*/
?>
<div class="block-events"<?php print $attributes; ?>>
<?php if ($block->subject): ?>
<?php print render($title_prefix); ?>
<h2<?php print $title_attributes; ?>><?php print $block->subject ?></h2>
<?php print render($title_suffix); ?>
<?php endif;?>
<?php print $content ?>
</div>
\ No newline at end of file
......@@ -103,3 +103,4 @@ php = "5.2.4"
project = "uw_ct_event"
project status url = "http://wms-sand6.uwaterloo.ca/features/fserver/uw_ct_event/7.x"
version = "7.x-1.0-beta3"
stylesheets[all][] = "css/uw_ct_event.css"
\ No newline at end of file
......@@ -239,28 +239,47 @@ function uw_ct_event_page_build() {
$path = explode("/", $path);
switch ($path[0]) {
case 'node':
$node = isset($path[1]) && $path[1] != 'add' ? node_load($path[1]) : NULL;
if (isset($node) && is_object($node) && $node->type == 'uw_event') {
$breadcrumb = drupal_get_breadcrumb();
$breadcrumb[1] = l('Events', 'events');
/* TODO: update the breadcrumbs to use the event date information
// BUT --
// how to handle repeating dates or dates that carry over multiple months (?)
$year = date('Y', $node->created);
$month_name = date('F', $node->created);
$month_number = date('n', $node->created);
$breadcrumb[2] = l($year, 'events/archive/'.$year);
$breadcrumb[3] = l($month_name, 'events/archive/'.$year.'-'.$month_number);
// */
drupal_set_breadcrumb($breadcrumb);
}
break;
case 'node':
$node = isset($path[1]) && $path[1] != 'add' ? node_load($path[1]) : NULL;
if (isset($node) && is_object($node) && $node->type == 'uw_event') {
$breadcrumb = drupal_get_breadcrumb();
$breadcrumb[1] = l('Events', 'events');
/* TODO: update the breadcrumbs to use the event date information
// BUT --
// how to handle repeating dates or dates that carry over multiple months (?)
$year = date('Y', $node->created);
$month_name = date('F', $node->created);
$month_number = date('n', $node->created);
$breadcrumb[2] = l($year, 'events/archive/'.$year);
$breadcrumb[3] = l($month_name, 'events/archive/'.$year.'-'.$month_number);
// */
drupal_set_breadcrumb($breadcrumb);
}
break;
case 'events':
if (isset($path[1])) {
$breadcrumb = drupal_get_breadcrumb();
$breadcrumb[1] = l('Events', 'events');
drupal_set_breadcrumb($breadcrumb);
}
break;
}
}
}
/**
* Implements hook_theme_registry_alter().
*/
function uw_ct_event_theme_registry_alter(&$theme_registry) {
$theme_registry['block__uw_ct_event'] = array(
'template' => 'block--uw-ct-event',
'path' => drupal_get_path('module', 'uw_ct_event') . '/templates',
'type' => 'theme',
);
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment