MultiSearch

2 posts by 2 authors in: Forums > CMS Builder
Last Post: December 3, 2013   (RSS)

By Dave - December 3, 2013

Hi MercerDesign, 

When using MultiSearch and searchMultipleTables() what you can do is print out all the available variables for each search result by adding a line just inside the foreach loop like this:

<?php foreach ($searchRows as $record): ?>
  <?php showme($record); ?>

This will show you all the variables you have to work with.  If you want to show a different type of link for a specific table you can check for that table name like this:

<?php if ($record['tablename'] == 'news'): ?>
  <a href="news.php?your-custom-link-here-<?php echo $record['num'] ?>" style="color: #008000">Go to record</a><br/>
<?php else: ?> 
  <a href="<?php echo $record['_link'] ?>" style="color: #008000"><?php echo $record['_link'] ?></a><br/>
<?php endif ?>

So that's one way to do it.  Detect the specific sections and hard-code links for them explicitly.

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com