MultiSearch

9 posts by 3 authors in: Forums > CMS Builder
Last Post: July 3   (RSS)

Hi, MercerDesign.

I've not seen a version with " 'contentField' => 'content' '".

To use fields in addition to titleField and summaryField, I've been using 'field1', 'field2', etc., like this:

$searchTables['stores'] = array(
        'viewerUrl'       => '/stores/about.php',
        'titleField'      => 'store_name',
        'summaryField'    => 'description',
        'field1'          => 'location',
        'field2'          => 'region',
        'field3'          => 'reference_names',
        'searchFields'    =>  array('store_name','description','location','region','reference_names'),
      );  

<!-- STEP2: Display Record List -->
<?php if ($searchRows): ?>
<?php foreach ($searchRows as $record): ?>

  <?php echo $record['_title'] ?>
  <?php echo $record['_summary'] ?>
  <?php echo $record['field1'] ?>
  <?php echo $record['field2'] ?>
  <?php echo $record['field3'] ?>

<?php endforeach ?>

Note there is no underscore included in the added fields.

Also, I see your 'viewerUrl' is not a valid path.

Hope that helps!
~ Deborah

Thank you, I've use the content field before and it used to work so I don't think that is the issue.

Sorry I couldn't help. Maybe if you post a few more details about what is/isn't happening, someone with more MultiSearch knowledge could help.

~ Deborah

Thank you.

I've updated the code but when you search for something unwanted code appears at the top of the results page, so for example if you search 'surrey' on this page you can see what I mean: https://rodneys29.sg-host.com/search.php

By Deborah - July 2 - edited: July 2

Just a guess... on the search results page HTML, the "unwanted code" showing in-browser is wrapped in an <xmp> tag.

HTML Validator: From line373, column5; to line373, column9
Element xmp not allowed as child of element div in this context

Unless you have purpose for the <xmp>, which I'm reading was deprecated, you might try replacing or removing it.

~ Deborah

Hi MercerDesign,

My proposal may be naive, but did you set debugSql to 0?

I really like your gsap page! You're the one who coded it?

Thanks,
Djulia

Thank you, that worked. Yes I designed and coded the page myself.

I've got the search working but how can I get it to search a category name, I have category menus but it's not searching the name.