multiSearch.php results page

6 posts by 2 authors in: Forums > CMS Builder
Last Post: January 30, 2013   (RSS)

I have got a search function on a website and it does work but on the results page the links to each search result are not correct, the structure of the site has got lots of folders for SEO purposes and the results are not finding those folders. The URL is www.ardingly.com, if you do a search for gcse you will see what I mean.

Hi,

Would it be possible to post or attach your search pages code to a post? Are these results all coming from the same section, or are you searching multiple sections? I think you might have to create custom links for each search result, I can guide you through this process if you need.

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com

Hi Larraine,

Thanks for posting your code. 

You can use the full directory path to the php page in each viewerUrl field for each section. For example, I think the news_list section needs changing to look like this:

$searchTables['news_list'] = array(
  'viewerUrl' => 'Ardingly_College_Sussex/News_Independent_Schools_Sussex/news_listPage.php',
  'titleField' => 'title',
  'summaryField' => 'summary',
  'searchFields' => array('title','summary'),
);

I also noticed that for this section you're linking to the list page as opposed to the detail page. I guess this is because not all news articles have a detail page?

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com

Hi Greg

Thanks for this, I changed it to this:

$searchTables['news_list'] = array(
'viewerUrl' => 'Ardingly_College_Sussex/News_Independent_Schools_Sussex/News_list.php',
'titleField' => 'title',
'summaryField' => 'summary',
'searchFields' => array('title','summary'),
);

news_listPage.php did not work so I have just changed it to the page that actually exists. Is that correct?

Regards, Larraine

Hi Larraine,

This is correct.

Let me know if you have any questions. 

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com