Skip to content

Instantly share code, notes, and snippets.

@jacine
Created July 8, 2011 02:51
Show Gist options
  • Save jacine/1071010 to your computer and use it in GitHub Desktop.
Save jacine/1071010 to your computer and use it in GitHub Desktop.
render awesomeness w/images.
<?php
// Hide stuff.
hide($content['comments']);
hide($content['links']);
hide($content['field_images']);
$main_image = $content['field_images'];
$main_image[0]['#image_style'] = 'project';
$count = count(element_children($main_image));
if ($count > 1) {
unset($content['field_images'][0]);
}
?>
<article<?php print $attributes; ?>>
<?php print render($title_prefix); ?>
<?php print render($title_suffix); ?>
<div class="content clearfix"<?php print $content_attributes; ?>>
<div class="grid-7 omega">
<?php if (!$page && $title): ?>
<h2 <?php print $title_attributes; ?>><a href="<?php print $node_url ?>" title="<?php print $title ?>"><?php print $title ?></a></h2>
<?php else: ?>
<h1<?php print $title_attributes; ?>><?php print $title; ?></h1>
<?php endif; ?>
<?php print render($content['field_client']); ?>
<?php print render($content['field_url']); ?>
<?php print render($content['field_services']); ?>
<?php print render($content['field_team']); ?>
<?php print render($content['body']); ?>
</div>
<div class="grid-8 alpha">
<?php print render($main_image[0]); ?>
<?php if ($count > 1): ?>
<?php print render($content['field_images']); ?>
<?php endif; ?>
</div>
</div>
<?php print render($content); ?>
<?php if (!empty($content['links'])): ?>
<div class="links clearfix"><?php print render($content['links']); ?></div>
<?php endif; ?>
<?php print render($content['comments']); ?>
</article>
<?php if($work_view): ?>
<section class="work">
<?php print $work_view; ?>
</section>
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment