Main
Index
Search
Posts
Who's
Online
Log
In

Home: Discontinued/Classic Products: Article Manager 2:
Search only specific categories

 

 


marys
User

Apr 21, 2009, 5:19 PM

Post #1 of 6 (4883 views)
Shortcut
Search only specific categories Can't Post

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)?


Donna
Staff / Moderator


Apr 22, 2009, 4:03 PM

Post #2 of 6 (4876 views)
Shortcut
Re: [marys] Search only specific categories [In reply to] Can't Post

Try this:

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

I hope this helps. :)

Donna


Hire me!
Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.


marys
User

Apr 25, 2009, 12:50 PM

Post #3 of 6 (3865 views)
Shortcut
Re: [Donna] Search only specific categories [In reply to] Can't Post

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">


(This post was edited by marys on Apr 25, 2009, 3:08 PM)


ross
Staff / Moderator


Apr 27, 2009, 10:09 AM

Post #4 of 6 (3299 views)
Shortcut
Re: [marys] Search only specific categories [In reply to] Can't Post

Hi marys

Thanks for the feedback.

The error message you are getting there usually means you have a publish rule set to only include certain categories but haven't actually selected any categories for it.

What you'll want to do is go through your article list publish rules and make sure any of them that are set to include or exclude actually have something selected in the category list.

Does that make sense? Have a look and let me know how you make out :).
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Product Specialist
support@interactivetools.com


Hire me!
Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.




marys
User

Jun 25, 2009, 12:35 PM

Post #5 of 6 (1732 views)
Shortcut
Re: [ross] Search only specific categories [In reply to] Can't Post

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.


(This post was edited by marys on Jun 25, 2009, 12:54 PM)


Donna
Staff / Moderator


Jun 26, 2009, 1:30 PM

Post #6 of 6 (1721 views)
Shortcut
Re: [marys] Search only specific categories [In reply to] Can't Post

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


Hire me!
Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.