• Archived  

By marys - April 21, 2009

How can I restrict search.cgi to search only specific categories?

Several categories on my client's site will be password protected.

Search.cgi will be called from two different, dynamically called menu.html files. (My search box is in my menu bar.) I set up two menu.html files: one for the unprotected pages, the other for the protected pages.

After the form is called into action, here is the hidden code I included:

<!--
<input type="hidden" name="sortBy" value="fieldname, -fieldnameReverseOrder, fieldname">
<input type="hidden" name="keywordSearchFields" value="Title">
-->

I know I can use something like this to restrict the search to one category:

<input type="hidden" name="catNum" value="29" />

How do I code the search.cgi call if I want to restrict the search to catNum 1 - 28, for example?

Do I have to enter a hidden catNum for each value (1-28)?

Re: [marys] Search only specific categories

  • Archived  

By Donna - April 22, 2009

Try this:

<input type="hidden" name="categoryNum" value="12,29,36,44">

I hope this helps. :)
Donna

--
support@interactivetools.com

Re: [Donna] Search only specific categories

  • Archived  

By marys - April 25, 2009 - edited: April 25, 2009

Thanks, Donna, but...

I now get this error:

Error: no category specified! at /home/changed/chan/f/a/666666/html/artman2/modules//IT/ArtMan/CustomMenus/Publish.pm line 486.

(I edited the directory names to protect the info, but all from "/html" is original.)

My hidden values look like this:

<input type="hidden" name="action" value="search"/>
<input type="hidden" name="categoryNum" value="101,19,20,21,22,24,62,67,68">

Re: [ross] Search only specific categories

  • Archived  

By marys - June 25, 2009 - edited: June 25, 2009

I have three article page publish rules:

1 is for public site article pages
2 is for private site article pages
3 is the preview rule

I've tried both ways on both rules: to include only the files on the public site for 1; then to exclude the private site files.

Did the same with 2.

I still get:

Error: no category specified! at /home/cluster1/data/f/a/812545/html/artman2/modules//IT/ArtMan/CustomMenus/Publish.pm line 486.

I also tried adding the category numbers to the search.cgi string:

form action="http://www.website/artman2/search.cgi?&categoryNums=101,19,20,21,22,24,62,67,68"

I get search results, but they include results from categories not specified in the string.

Re: [marys] Search only specific categories

  • Archived  

By Donna - June 26, 2009

Hi Mary,

Instead of including the search string in the form action, you'll want to include it as a separate field like this:

<input type="hidden" name="categoryNums" value="101,19,20,21,22,24,62,67,68">

I hope this helps. :)
Donna

--
support@interactivetools.com