Multi records: Want listings to link to *some* details pages, but not all

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

I normally check for any extra data... if there is, then show the link.  ie.  If I have a multi-record with a field "link_url" that sometimes has a website to link to, I would use the following:

<?php if ($record['link_url']): ?><a href="<?php echo ($record['link_url']) ?>" target="_blank">View website</a><?php endif ?>

Same with additional content.  If the "content" field is filled in, then display a link to the detail page. ie.

<?php if ($record['content']): ?><a href="<?php echo $record['_link'] ?>" target="_blank">Read more</a><?php endif ?>

Cheers,

Tim (toledoh.com.au)

By ross - September 2, 2016

Hi there.

I think Tim has you on the right track.

You could also create a checkbox called "Show Read More Link" and use that to determine if a record needs a "Read More" link.

I like Tim's idea better though as it uses fields you already have and doesn't require extra work to use.

Let us know any questions.

-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

That was pretty easy! Works perfectly - thank you.

http://interfaithcounselling.ca/news-events.php

I've added the word "Details" and a link if there is more information in the content field.