<?php /* Example: Using pagesByDate with results grouped by month */ $postUris = pagesByDate($pages, array('group' => 'month')); ?> <?php if (!$postUris) { ?> <p>Sorry, nothing to show.</p> <?php } else { ?> <?php foreach ($postUris as $year => $months) { ?> <h2><?php echo $year; ?> </h2> <?php foreach ($months as $month => $uris) { ?> <h3><?php
<?php /* Example: Using pagesByDate with default settings */ $postUris = pagesByDate($pages); ?> <?php if (!$postUris) { ?> <p>Sorry, nothing to show.</p> <?php } else { ?> <ul> <?php foreach ($postUris as $uri) { $post = $pages->find($uri); ?> <li> <a href="<?php echo $post->url(); ?> "><?php echo $post->title(); ?> </a>
<?php } ?> </div> <?php } ?> <?php } ?> <?php } else { ?> <?php $postUris = pagesByDate($page->children(), array('group' => 'year')); ?> <?php foreach ($postUris as $year => $uris) { ?> <div class="row"> <h2 class="col-xs-12"><?php echo $year; ?> </h2> <?php foreach ($uris as $uri) { ?> <?php $post = $pages->find($uri); ?>
<?php /* Example: Using pagesByDate with some custom options */ // Let's build a list of events planned in 2014 $myOptions = array('max' => '2012-12-31', 'min' => '2012-01-01', 'order' => 'asc'); // If we want all pages with dates in the site, we can do: $eventUris = pagesByDate($pages, $myOptions); // If instead we want to limit ourselves to content in a "content/events" folder… // (We can't just use $pages->find('events') because it doesn't return a set of pages) // $src = $pages->find('events')->children(); // $events = pagesByDate($src, $myOptions); // ); ?> <?php if (!$eventUris) { ?> <p>Sorry, no event planned yet.</p> <?php } else { ?> <ul> <?php foreach ($eventUris as $uri) { $event = $pages->find($uri); ?>
<section class="page-content"> <div class="container"> <div class="row"> <div class="five columns page-content__sidebar"> <h3>Latest happenings. Useful Information.</h3> <ul> <li><a href="/about">Who We Are<i class="fa fa-chevron-right"></i></a></li> <li><a href="/services">What We Do<i class="fa fa-chevron-right"></i></a></li> <li><a href="/team">Meet The Team<i class="fa fa-chevron-right"></i></a></li> </ul> </div> <div class="seven columns page-content__newspost"> <!-- ARTICLE LOOP --> <?php foreach (pagesByDate($page->children()->visible()) as $postUri) { ?> <?php $article = $pages->find($postUri); ?> <article> <a href="<?php echo $article->url(); ?> "><h2><?php echo $article->title()->html(); ?> </h2></a> <h5><i class="fa fa-calendar"></i> <?php echo $article->date('l, F j, Y'); ?>
<?php /* Example: Using pagesByDate with results grouped by year */ $postUris = pagesByDate($pages, array('group' => 'year')); ?> <?php if (!$postUris) { ?> <p>Sorry, nothing to show.</p> <?php } else { ?> <?php foreach ($postUris as $year => $uris) { ?> <h2><?php echo $year; ?> </h2> <ul> <?php foreach ($uris as $uri) { $post = $pages->find($uri); ?> <li><a href="<?php