Skip to content

Instantly share code, notes, and snippets.

@jimpowelltech
Forked from anonymous/gist:8561141
Last active January 4, 2016 03:19
Show Gist options
  • Save jimpowelltech/8561254 to your computer and use it in GitHub Desktop.
Save jimpowelltech/8561254 to your computer and use it in GitHub Desktop.
<?php
isAppropriate($article) {
$audience = $article->field_intended_audience['und'][0]['value'];
// Use the code from the views filter to return either true or false
// !!! You'll need to flip it though, so return true means I should see it
}
?>
<!-- Featured Events SLider -->
<section id="nowatrmcad-slider" class="clearfix">
<div class="contain">
<div id="nowatrmcad-slider-content">
<div id="nowatrmcad-slider-content-wrapper">
<div id="nowatrmcad-slides">
<figure>
<?php
$count = 0;
foreach($articles as $node):
if (isAppropiate($article)):
$img = $node->field_image['und'][0]['uri'];
$style = "nowatrmcad_slider";
$img = image_style_url($style, $img);
?>
<a href="<?php print drupal_lookup_path('alias',"node/".$node->nid); ?>" id="nowatrmcad-slide<?php echo $count + 1; ?>"><img alt="" height="470" src="<?= $img ?>" width="670" /></a>
<?php
$count++;
endif;
endforeach;
?>
</figure>
</div>
<aside id="nowatrmcad-slides-nav">
<ul>
<?php
$count = 0;
foreach($articles as $node):
if (isAppropiate($article)):
?>
<li <?php if($count == 0):?>class="active"<?php endif; ?>>
<a class="heading" href="#nowatrmcad-slide<?php echo $count + 1; ?>"><h4><?php print $node->title; ?></h4></a>
<div class="slider-text">
<p><?php print strip_tags($node->body['und'][0]['value']); ?></p>
<em><a href="<?php print drupal_lookup_path('alias',"node/".$node->nid); ?>">Continue reading</a></em>
</div>
</li>
<?php
$count++;
endif;
endforeach;
?>
</ul>
</aside>
</div>
</div>
<nav class="view-more" id="scroll_position">
<a class="button" href="/news"><span>View More News Articles</span></a>
</nav>
</div>
</section>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment