Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ding_base.module
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,14 @@ function ding_base_preprocess_material_item(&$variables) {
// Render the checkbox.
$variables['checkbox'] = drupal_render($element[$element['#id']]);

// Get the creator, materialtype, title and cover
if (isset($element['#creators'])) {
$variables['creators'] = $element['#creators'];
}
if (isset($element['#material_type'])) {
$variables['material_type'] = $element['#material_type'];
}

// Get the title and cover.
$variables['title'] = $element['#title'];
$variables['cover'] = drupal_render($element['#cover']);
Expand Down
16 changes: 12 additions & 4 deletions templates/material_item.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,25 @@
<div class="left-column">
<div class="item-checkbox"><?php print $checkbox; ?></div>
<?php print $cover; ?>
<?php if (isset($material_type)) : ?>
<h4 class="item-material-type"><?php print $material_type; ?></h4>
<?php endif; ?>
</div>
<div class="right-column">
<h3 id="<?php print $availability_id; ?>" class="item-title"><?php print $title; ?></h3>
<?php if (isset($creators)) : ?>
<h4 class="item-creators"><?php print $creators; ?></h4>
<?php endif; ?>
<h3 id="<?php print $availability_id; ?>"
class="item-title"><?php print $title; ?></h3>
<?php if (isset($material_message)) : ?>
<div class="<?php print $material_message['class']; ?>"><?php print $material_message['message']; ?></div>
<div class="<?php print $material_message['class']; ?>"><?php print $material_message['message']; ?></div>
<?php endif; ?>
<ul class="item-information-list">
<?php foreach ($information as $info) : ?>
<li class="item-information <?php isset($info['class']) ? print $info['class'] : print ''; ?>">
<li
class="item-information <?php isset($info['class']) ? print $info['class'] : print ''; ?>">
<?php if (isset($info['label'])) : ?>
<div class="item-information-label"><?php print $info['label']; ?>:</div>
<div class="item-information-label"><?php print $info['label']; ?> </div>
<?php endif; ?>
<div class="item-information-data"><?php print $info['data']; ?></div>
</li>
Expand Down