You are here:  » Search Wildcard/s ?

Support Forum



Search Wildcard/s ?

Submitted by alecs on Sat, 2009-08-01 09:14 in

hi,

got my categories similar like this ...

- movie action
- movie adventure
- movie crime

is it possible to search (browser/url) all categories that starts with "movie" ?

thanks
alecs

JoJoGo.CoM

Submitted by support on Sat, 2009-08-01 09:19

Hi Alecs,

Sure - using a query of:

category:movie

...should do the trick

Cheers,
David.

Submitted by alecs on Sat, 2009-08-01 10:43

hi david..

Submitted by support on Sat, 2009-08-01 13:11

Hello Alecs,

I'm working on enabling logic operators in the query at the moment - as soon as that's ready I'll let you know and you'll be able to search, for example, category AND games AND (nintendo OR xbox OR sega OR sony).

Cheers,
David.

Submitted by alecs on Thu, 2009-08-20 14:34

hi david ...

is it possible to get an extra searchform for the current category a user visits ?

Submitted by support on Fri, 2009-08-21 07:46

Hi Alecs,

You could perhaps add an extra "Search this category" button to the search form - that would be straight forward. To have a go with this, first REPLACE your html/searchform.php with the following new version:

<div class='searchform'>
  <form name='search' action='<?php print $config_baseHREF ?>search.php'>
    <input type='text' name='q' id='q' size='35' value='' />
    <input type='submit' value='<?php print translate("Search"); ?>' />
    <?php
    if ($parts[0]=="category")
    {
    <input type='hidden' name='category' value='".htmlentities($parts[1],ENT_QUOTES,$config_charset)."' />
    <input type='submit' name='submit' value='Search This Category' />
    }
    ?>
  </form>
</div>

And to compliment that, the appropriate value of $q would have to be constructed at the top of search.php. In that file, look for the following code around about line 4:

  $q = (isset($_GET["q"])?tapestry_normalise($_GET["q"],":\."):"");

...and REPLACE that with:

  $q = (isset($_GET["q"])?tapestry_normalise($_GET["q"],":\."):"");
  if ($_GET["submit"]=="Search This Category")
  {
    $q = "category:".$q;
  }

Hope this helps!

Cheers,
David.