I am setting up a website for a a client which is basically a directory of organizations. There is the list page with a few details and then a "Find out more" link that goes to the detail page. All was fine until the client changed their mind and decided that if the organisation listed had a website, they wanted the Find out more link to go straight to the website, if not they want the link to go to the detail page.
So for the list page I currently have
<?php foreach ($adventure_and_sportRecords as $record): ?><div class="itemPreview">
<a href="<?php echo $record['_link'] ?>"><h1><?php echo $record['title'] ?></h1></a>
<?php echo $record['preview_description'] ?><a href="<?php echo $record['_link'] ?>"><strong>Find out more »</strong></a>
</div>
<?php endforeach ?>
This gives a few details of the organisation and then links to the detail page.
I have a field for the website address in the section editor - <?php echo $adventure_and_sportRecord['website'] ?>
So what I need to do is if the "website" field has a Url in it I need the "Find out more" link to go straight to that site and if the field is empty I need it to go to the detail page.
I have seen some bits about If statements on the forum, but can't work out if it is possible to utilize it here.
Any help would be much appreciated.