Skip to content

Commit

Permalink
[gh-125] Merging testing into staging -c1184 -c1188
Browse files Browse the repository at this point in the history
git-svn-id: file:///tmp/wdn_thm_drupal/branches/drupal-7.x/staging@1189 20a16fea-79d4-4915-8869-1ea9d5ebf173
  • Loading branch information
Eric Rasmussen committed Oct 19, 2011
1 parent 3fbe334 commit b744bbf
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 2 deletions.
56 changes: 56 additions & 0 deletions field--field-unl-newsimg.tpl.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php

/**
* @file field--field-unl-newsimg.tpl.php
* unl_wdn template implementation to display the value of a news img field.
*
* Available variables:
* - $items: An array of field values. Use render() to output them.
* - $label: The item label.
* - $label_hidden: Whether the label display is set to 'hidden'.
* - $label_html_tag: The html tag to use for the label, h2, h3, div, etc.
* - $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:
* - field: The current template type, i.e., "theming hook".
* - field-name-[field_name]: The current field name. For example, if the
* field name is "field_description" it would result in
* "field-name-field-description".
* - field-type-[field_type]: The current field type. For example, if the
* field type is "text" it would result in "field-type-text".
* - field-label-[label_display]: The current label position. For example, if
* the label position is "above" it would result in "field-label-above".
*
* Other variables:
* - $element['#object']: The entity to which the field is attached.
* - $element['#view_mode']: View mode, e.g. 'full', 'teaser'...
* - $element['#field_name']: The field name.
* - $element['#field_type']: The field type.
* - $element['#field_language']: The field language.
* - $element['#field_translatable']: Whether the field is translatable or not.
* - $element['#label_display']: Position of label display, inline, above, or
* hidden.
* - $field_name_css: The css-compatible field name.
* - $field_type_css: The css-compatible field type.
* - $classes_array: Array of html class attribute values. It is flattened
* into a string within the variable $classes.
*
* @see template_preprocess_field()
* @see theme_field()
*/
?>
<div class="<?php print $classes; ?>"<?php print $attributes; ?>>
<?php if (!$label_hidden) : ?>
<<?php print $label_html_tag; ?> class="field-label"<?php print $title_attributes; ?>><?php print $label ?>:&nbsp;</<?php print $label_html_tag; ?>>
<?php endif; ?>
<div class="field-items"<?php print $content_attributes; ?>>
<?php if ($element['#view_mode'] == "teaser") : ?>
<div class="field-item even"<?php print $item_attributes[0]; ?>><?php print render($items[0]); ?></div>
<?php else : ?>
<?php foreach ($items as $delta => $item) : ?>
<div class="field-item <?php print $delta % 2 ? 'odd' : 'even'; ?>"<?php print $item_attributes[$delta]; ?>><?php print render($item); ?></div>
<?php endforeach; ?>
<?php endif; ?>
</div>
</div>
4 changes: 3 additions & 1 deletion node--unl-newsitem.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,17 @@
// We hide the comments and links now so that we can render them later.
hide($content['comments']);
hide($content['links']);
print render($content["body"]);

// If more than one image is available, show the addtional images
if ($view_mode == 'full' && isset($content["field_unl_newsimg"][1])) {
print render($content["body"]);
unset($content["field_unl_newsimg"][0]);
print render($content["field_unl_newsimg"]);
} else if ($view_mode == 'teaser') {
print render($content["field_unl_newsimg"]);
print render($content["body"]);
}

?>
</div>

Expand Down
2 changes: 1 addition & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -190,5 +190,5 @@ ul.links.inline {padding-left: 0 !important;}
}
.view-teaser .field-type-image .field-item {
float: left;
margin-right: 20px;
margin: 0 20px 30px 0;
}

0 comments on commit b744bbf

Please sign in to comment.