Constructing an URL from another section

3 posts by 2 authors in: Forums > CMS Builder
Last Post: September 27, 2010   (RSS)

I have 2 multi record sections:

1. Blog
2. Photogallery

The blog section contains a list field "related_photogallery" that is populated from the photogallery section (num,title).

I want in my blog page to show if there is a related photo gallery to an article… pretty obvious.
Everything is working fine even if there is no related photogallery in one of the articles.

The only problem is how do i link in an article to the related photogallery page?
At the moment the output is only a number… but i need also the title…and the dash.

<?php foreach ($blogRecords as $record): ?>
<?php echo $blogRecord['title'] ?>
<?php echo date("d F Y", strtotime($record['date'])) ?>
<?php echo $blogRecord['content'] ?>
<?php if ($blogRecord['related_photogallery']): ?>
<a href="photogallery.php?<?php echo $blogRecord['related_photogallery'] ?>">View related photogallery</a>
<?php else: ?>
<?php endif ?>
<?php endforeach ?>

Re: [chris] Constructing an URL from another section

Thumbs UP! ;-)