Displaying multi record menu links

4 posts by 2 authors in: Forums > CMS Builder
Last Post: June 8, 2010   (RSS)

By paulmac - June 8, 2010

Hi

I'm displaying a multi record list like below:

<?php foreach ($productRecords as $record): ?>
<a href="<?php echo $record['_link'] ?>"><?php echo $record['title'] ?></a>


Each title links through to a detail page. So the list is like:

product A
product B
product C

What I would like to be able to do is hard code a link between the list so it appears as something like:

product A
extra link here
product B
product C

Thanks for any help.

Re: [paulmac] Displaying multi record menu links

By Jason - June 8, 2010

Hi,

How are you determining where the extra link should go?

Is it only supposed to appear once, or multiple times?

Does it only appear after the first link?

Let me know and we'll get it figured out.

Thanks.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Displaying multi record menu links

By paulmac - June 8, 2010

Hi Jason

It would just appear once after the first link.

Thanks

Re: [paulmac] Displaying multi record menu links

By Jason - June 8, 2010

Hi,

You could try something like this:

<?php $count=1; ?>
<?php foreach ($productRecords as $record): ?>
<a href="<?php echo $record['_link'] ?>"><?php echo $record['title'] ?></a>
<?php if($count==1):?>
*PUT EXTRA LINK HERE*
<?php $count++; ?>
<?php endif?>


Give that a try.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/