MultiSearch
2 posts by 2 authors in: Forums > CMS Builder
Last Post: December 3, 2013 (RSS)
Hi, I have a MultiSearch page that works well apart from one thing, on the site there is long multi record list and within that list the client can tick where a record will appear on the site and to move a record to archive pages.
The problem is on the search results page the result will take you to the main list page and not directly to the detail page of that record, some records do not have detail pages, some records have been ticked to appear on a different pages.
My questions are, can you tell the multisearch to search multiple pages for the one list, can you tell the result to go to a detail page if there is a detail page?
I hope you can help.
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!
interactivetools.com