Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display list image on teaser. Code style fixes. #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
120 changes: 57 additions & 63 deletions templates/node.tpl.php
Original file line number Diff line number Diff line change
@@ -1,104 +1,98 @@
<?php

<?php
/**
* @file
* Template to render nodes.
*/

if ($page == 0) { ?>
// For when the node is being displayed on a list, teaser mode.
if ($page == 0): ?>

<div id="node-<?php print $node->nid; ?>" class="<?php print $classes; ?> clearfix">

<div class="picture"><?php print $list_image; ?></div>
<div class="picture"><?php print $field_list_image[0]['view']; ?></div>

<div class="content">

<div class="subject">
<?php print return_terms_from_vocabulary($node, "1"); ?>
<?php print return_terms_from_vocabulary($node, "1"); ?>
</div>

<?php if($node->title){ ?>
<h3><?php print l($node->title, 'node/'.$node->nid); ?></h3>
<?php } ?>
<?php if ($node->title): ?>
<h3><?php print l($node->title, 'node/' . $node->nid); ?></h3>
<?php endif; ?>

<div class="meta">
<span class="time">
<?php print format_date($node->created, 'custom', "j F Y") ?>
</span>
<span class="author">
<?php print t('by') . ' ' . theme('username', $node); ?>
</span>
<div class="meta">
<span class="time">
<?php print format_date($node->created, 'custom', "j F Y") ?>
</span>
<span class="author">
<?php print t('by') . ' ' . theme('username', $node); ?>
</span>

<?php print $node->field_library_ref[0]['view']; ?>
<?php print $node->field_library_ref[0]['view']; ?>

</div>
</div>

<p>
<?php
//field_teaser
if($node->field_teaser[0]['value']){
print $node->field_teaser[0]['value'];
}else{
print strip_tags($node->content['body']['#value']);
}
?>
</p>

<?php if (count($taxonomy)){ ?>
<div class="taxonomy">
<?php print $terms ?>
</div>
<?php } ?>


<?php
// Show the teaser field, if set, otherwise an HTML-stripped
// version of the body field.
if ($node->field_teaser[0]['value']):
print $node->field_teaser[0]['value'];
else:
print strip_tags($node->content['body']['#value']);
endif;
?>
</p>

<?php if (count($taxonomy)): ?>
<div class="taxonomy">
<?php print $terms ?>
</div>
<?php endif; ?>

</div>

</div>
<?php }else{
//Content
<?php
// For when the node is displayed as the main page content.
else:
?>

<div id="node-<?php print $node->nid; ?>" class="<?php print $classes; ?> clearfix">
<div class="subject">
<?php print return_terms_from_vocabulary($node, "1"); ?>
<?php print return_terms_from_vocabulary($node, "1"); ?>
</div>

<?php if($node->title){ ?>
<h2><?php print $title;?></h2>
<?php } ?>

<div class="meta">

<?php print format_date($node->created, 'custom', "j F Y") ?>
<i><?php print t('by'); ?></i>
<span class="author"><?php print theme('username', $node); ?></span>
</div>
<?php if($node->title): ?>
<h2><?php print $title;?></h2>
<?php endif; ?>

<div class="content">
<?php print $content ?>
</div>
<div class="meta">
<?php print format_date($node->created, 'custom', "j F Y") ?>
<i><?php print t('by'); ?></i>
<span class="author"><?php print theme('username', $node); ?></span>
</div>

<?php if (count($taxonomy)){ ?>
<div class="content">
<?php print $content ?>
</div>

<div class="taxonomy">
<?php print $terms ?>
</div>
<?php } ?>
<?php if (count($taxonomy)): ?>
<div class="taxonomy">
<?php print $terms ?>
</div>
<?php endif ?>

<?php if ($similarterms) { ?>
<?php if ($similarterms): ?>
<div class="ding-box-wide similar">
<h3><?php print t('Similar'); ?></h3>
<?php print $similarterms; ?>
</div>
<?php } ?>

<?php endif; ?>

<?php if ($links){ ?>
<?php print $links; ?>
<?php } ?>
<?php print $links; ?>

</div>
<?php } ?>

<?php endif;