?> </ul> </section> <?php } ?> <?php $region = $page->title(); $search = $pages->find('stations')->children->filterBy('region', "{$region}")->sortBy('title', 'asc'); if ($search != "") { ?> <section class="stations index"> <h1>Stations in This County</h1> <?php $alphabetise = alphabetise($search); foreach ($alphabetise as $letter => $items) { ?> <h2 class="index"><?php echo str::upper($letter); ?> </h2> <ul class="stations listing"> <?php foreach ($items as $item) { ?> <li><a href="<?php echo $item->url(); ?> "<?php if ($item->text() == '') {
<?php if (param('section')) { $alphabetise = alphabetise($page->children()->filterBy('section', params('section'))->sortby('title'), array('key' => 'title')); } else { $alphabetise = alphabetise($page->children()->sortby('title'), array('key' => 'title')); } ?> <?php foreach ($alphabetise as $letter => $items) { ?> <h2 class="index" id="<?php echo $letter; ?> "><?php echo str::upper($letter); ?> </h2> <ul class="<?php echo $type; ?> listing"> <?php foreach ($items as $item) { ?> <?php if ($item->short_title()->isNotEmpty()) { $title = $item->short_title(); } else { $title = $item->title();
?> "><?php echo smartypants($item2->title()); ?> </a></li> <?php } ?> </ul> </section> <section> <h1>Stations Served</h1> <?php $company = $site->uri->path(2); $alphabetise = alphabetise($pages->find('stations')->children()->filterBy('company', '*=', "{$company}")->sortBy('title', 'asc')); foreach ($alphabetise as $letter => $items) { ?> <h2 class="index"><?php echo str::upper($letter); ?> </h2> <ul class="stations listing"> <?php foreach ($items as $item) { ?> <li><a href="<?php echo $item->url(); ?> "<?php if ($item->text() == '') {