Search problem
2 posts by 2 authors in: Forums > CMS Builder
Last Post: November 11, 2010 (RSS)
By (Deleted User) - November 11, 2010
Hi Guys,
I'm using the following keyword search on my website and trying to pull records from my 'news' table. However because I have multiple section editors in the same page also using 'title' and 'intro' variables the search is messing with my page. How can I get the search to only return records from the 'news' table and ignore everything else?
Search form:
<form method="POST" action="archives_index1.php">
<input type="text" name="title,intro,content_keyword" value="">
<input type="submit" name="submit" value="Search">
</form>
My news table:
// load news
list($newsRecords, $newsMetaData) = getRecords(array(
'tableName' => 'news',
'perPage' => '10',
'where' => "category = '1'",
));
regards
Shawn
I'm using the following keyword search on my website and trying to pull records from my 'news' table. However because I have multiple section editors in the same page also using 'title' and 'intro' variables the search is messing with my page. How can I get the search to only return records from the 'news' table and ignore everything else?
Search form:
<form method="POST" action="archives_index1.php">
<input type="text" name="title,intro,content_keyword" value="">
<input type="submit" name="submit" value="Search">
</form>
My news table:
// load news
list($newsRecords, $newsMetaData) = getRecords(array(
'tableName' => 'news',
'perPage' => '10',
'where' => "category = '1'",
));
regards
Shawn
Re: [smesa] Search problem
By Chris - November 11, 2010
Hi Shawn,
The solution is to set "allowSearch" => false for all the other getRecords calls on your search page, like this:
I hope this helps! Please let me know if you have any questions.
The solution is to set "allowSearch" => false for all the other getRecords calls on your search page, like this:
// load something other than news
list($otherRecords, $otherMetaData) = getRecords(array(
'tableName' => 'other',
'allowSearch' => false,
));
I hope this helps! Please let me know if you have any questions.
All the best,
Chris
Chris