I've created a custom boolean field entitled "Editor's Pick"
I want to create a search button which will cause only sites whose Editor's Pick value = true to be displayed (these would be sites within the currently displayed category).
I've read how to create custom searches, but there's no reference on how to reference boolean and true-false values.
All I want to do is display only links in category 5 whose EditorsChoice=1.
By the way, using the Advanced Search page to search for the EditorsChoice=1 (using a form checkbox) does not work either. It simply brings me back to the same Advanced Search page.
To search only in a particular field, use a url like search.php?action=filter&filled=1&whichtype=categories&namesearch=test&namecondition==
For any sort of search, the process to construct a url for it is just to examine the form being submitted in the template and add the values that you would want to be getting submitted into the URL. Examine the names given to the selectors in the advanced search template and transfer them to the url.
I appreciate your prompt response, but your answers are bits-and-pieces which aren't giving me the full picture of the issue. I cannot tell from the documentation or your examples what is meant to be an actual value to be passed in a URL and what is meant to be a variable placeholder used for the example.
Based on what I've gotten from you and the vague documentation on clickable search results I've come up with this...
Find all links where <br>the title <select name="titlecondition"> <option value="like">contains</option> <option value="=">is exactly</option> <option value="!=">is not</option> <option value="or">has any of the words</option> <option value="and">has all of the words</option> <option value="bool">boolean</option> </select> <input type="text" size="{STANDARDSIZE}" name="titlesearch"> <br>and the description <select name="descriptioncondition"> <option value="like">contains</option> <option value="=">is exactly</option> <option value="!=">is not</option> <option value="or">has any of the words</option> <option value="and">has all of the words</option> <option value="bool">boolean</option> </select> <input type="text" size="{STANDARDSIZE}" name="descriptionsearch"> <br>and the URL <select name="urlcondition"> <option value="like">contains</option> <option value="=">is exactly</option> <option value="!=">is not</option> <option value="or">has any of the values</option> <option value="and">has all of the values</option> <option value="bool">boolean</option> </select> et cetera...
Have a look at the fields it's posting to the form. When someone types that they want to search for a title, they're typing in an input box named "titlesearch". When they set the condition they're doing it in a selector named "titlecondition". When they search for a description, they type in "descriptionsearch" and set the condition in "descriptioncondition". What does this tell you about where they would be typing for a field named "editorschoice"? You can conclude that "editorschoicesearch" fits the pattern.
Now transfer it into the url instead of writing it in the form.
0/5
1
2
3
4
5
This thread is closed, so you cannot post a reply.
Comments on How to search based on True/False value
Beginner
Usergroup: Customer
Joined: Apr 08, 2006
Total Topics: 2
Total Comments: 5
I've created a custom boolean field entitled "Editor's Pick"
I want to create a search button which will cause only sites whose Editor's Pick value = true to be displayed (these would be sites within the currently displayed category).
I've read how to create custom searches, but there's no reference on how to reference boolean and true-false values.
Any help would be appreciated.
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
Set the value to 1 for yes and 0 for no.
Beginner
Usergroup: Customer
Joined: Apr 08, 2006
Total Topics: 2
Total Comments: 5
With another look I realize that I can't create a boolean input type, but can use the Integer field type along with a checkbox.
However, coding it like this still doesn't work and always displays the Advanced Search page rather than any search results.
All I want to do is display only links in category 5 whose EditorsChoice=1.
By the way, using the Advanced Search page to search for the EditorsChoice=1 (using a form checkbox) does not work either. It simply brings me back to the same Advanced Search page.
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
Please take the time to read the manual instead of inventing your own way of passing search values: scripts.webmastersite.net/w...nks/wsnmanual/articles/246
By the way, using the Advanced Search page to search for the EditorsChoice=1 (using a form checkbox) does not work either.
Do not invent your own way of specifying fields in the form either, use what all the other standard fields use.
Beginner
Usergroup: Customer
Joined: Apr 08, 2006
Total Topics: 2
Total Comments: 5
The documentation for this is vague and unclear.
Going by that, I come up with this
search.php?action=filter&filled=1&whichtype=links&namesearch=editorschoice&namecondition==1
I'm very confused with this. Where do i specify the category id?
All I need is to show EditorsChoice=1 in Category 5.
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
I believe catid=5 works as a shortcut, but going by the instructions it'd be catidcondition==&catidsearch=5
Beginner
Usergroup: Customer
Joined: Apr 08, 2006
Total Topics: 2
Total Comments: 5
I appreciate your prompt response, but your answers are bits-and-pieces which aren't giving me the full picture of the issue. I cannot tell from the documentation or your examples what is meant to be an actual value to be passed in a URL and what is meant to be a variable placeholder used for the example.
Based on what I've gotten from you and the vague documentation on clickable search results I've come up with this...
search.php?action=filter&filled=1&whichtype=links&namesearch=editorschoice&namecondition==1&catidcondition==&catidsearch=5
However, from the resultset, it's clear that the EditorsChoice field has no effect.
Would you please tell me what the correct syntax for the full line would be?
Thanks so much
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
The template goes on like this:
Have a look at the fields it's posting to the form. When someone types that they want to search for a title, they're typing in an input box named "titlesearch". When they set the condition they're doing it in a selector named "titlecondition". When they search for a description, they type in "descriptionsearch" and set the condition in "descriptioncondition". What does this tell you about where they would be typing for a field named "editorschoice"? You can conclude that "editorschoicesearch" fits the pattern.
Now transfer it into the url instead of writing it in the form.