Multi-Search Results - Adding Detail

7 posts by 2 authors in: Forums > CMS Builder
Last Post: October 27, 2008   (RSS)

By Perchpole - October 26, 2008

Hi, Dave -

Perhaps you can help me with another little teaser...?!

I'm trying to add some more detail to my multi-search results page. Currently the search is designed to pull data from 4 different tables. For simplicity we'll call them:

Boats
Cars
Bikes
Trucks

The results page lists the returned data as you might expect:

Title
Summary, blah-blah, blah-blah, blah-blah.
more...

Now, in an attempt to provide the user with more info I would like to present the results like this:

Title [menuName]
Summary, blah-blah, blah-blah, blah-blah.
more...

By inserting the menuName after the Title I can show the visitor the parent section from which each result was pulled. Admittedly this may not be necessary in the cars, boats, bikes example - but it could be an important indicator when the sections are not so neatly defined.

How do I work the menuName into the code?

:0/

Perchpole

Re: [Perchpole] Multi-Search Results - Adding Detail

By Dave - October 27, 2008

Hi Perchpole,

There's no easy way to do that with multisearch. It's limited to just the title and summary fields.

Options would be to:

1) Add some functionality to multiSearch() to support more fields - this would require some custom programming.

2) Considering storing all your data in a single table for a pulldown for (Boats, Cars, Bike, etc).

3) If the menuname is fixed you could add code to display it like so:

<?php if ($record['title'] == 'Boats'): ?>
Boats Menu Name
<?php endif; ?>

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Perchpole] Multi-Search Results - Adding Detail

By Dave - October 27, 2008

Hi Perch,

Sure, we could give that a try. Can you give me a list of some example folder names and the output you'd like? Then my sample code will be more relevant.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Multi-Search Results - Adding Detail

By Perchpole - October 27, 2008

Hi, Dave -

Thanks for giving-it-a-go!

The 4 folders are:

accessory
classic
gunpak
restricted

(It's military model web site: http://www.mmsmodels.co.uk)

I'm happy to play with the output myself. I just can't get my head around the code that would scan the link for the folder name.

:0)

Perch

Re: [Perchpole] Multi-Search Results - Adding Detail

By Dave - October 27, 2008

Try this:

<?php if (strpos($record['_link'], 'accessory')): ?>
Matched accessory
<?php endif ?>

<?php if (strpos($record['_link'], 'classic')): ?>
Matched classic
<?php endif ?>

Let me know if that works for you.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Multi-Search Results - Adding Detail

By Perchpole - October 27, 2008

See, as (my girlfriend never tires of reminding me) it's "easy when you know how"!

:0\

Perch