
<ul id="relatedpages">
<?php if(!empty($this->relatedPagesData)) {
    foreach($this->relatedPagesData as $relatedPage) {
    ?>
  <li>
  <?php if($this->withImage){ ?>
    <a href="<?php echo $this->websiteUrl . $relatedPage['url'] . '.html'; ?>" title="<?php echo $relatedPage['h1']; ?>">
    <img src="<?php echo $relatedPage['pageImagePath']; ?>" alt="<?php echo $relatedPage['pageImageName']; ?>"/>
    </a>
    <?php }?>
    <a href="<?php echo $this->websiteUrl . $relatedPage['url'] . '.html'; ?>" title="<?php echo $relatedPage['h1']; ?>" class="listtitle"><?php echo $relatedPage['navigationName']; ?></a>
    <span><?php echo $relatedPage['description']; ?></span>
  </li>
<?php } }else {?>
    <li>No related pages found.</li>
<?php }?>
</ul>

