Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Advanced Search Web part - Simple vs Advanced?

  Asked By: Pamela    Date: Aug 24    Category: Sharepoint    Views: 1478

I've been using the Advanced Search web part (the one xlated from MS japan)
that gives you logical OR, logical AND, Phrase and Boolean dropdown. It
works great, and I have it on my Search dashboard.

I want to add it to my Home dashboard and the Document Library dashboard,
but it always defaults to the Advanced view. The standard search web part
seems smart enough that it is minimized on the home page but maximized
(advanced) on search page. The advanced view don't look so good on our home
page by default :)

I looked at some code, and the search page has this:

If strAdvancedForm = "true" Then
strSearchBoxPartCacheKey = strCurrentUrl & "-Advanced"
Else
strSearchBoxPartCacheKey = strCurrentUrl & "-Simple"
End If


While the advanced page has this:

If Len(strAdvancedForm) <= 0 Then
strAdvancedForm = "true"
strWasAdvForm = "true"
End If

It originally sets itself in each with
strAdvancedForm = GetValueFromRequestFormField(
g_strSearchShowAdvancedId )

I'm wondering if there's some setting on the dashboards that sets this
string or something -- I'm hesitant to hard-code the web part inside the
dashboard because of changes that might come with upgrades or service packs
later on.

Anyone know how to make my Advanced web part more intelligent and act like
the default? I really want to add that drop down to the home and doc
library pages, but I want it to default to simple form first.

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Christina Lewis     Answered On: Aug 24

I was incorrect in my manual "diff" of the code. BOTH web  parts have the
same -Advanced and -Simple code... it's just that the built-in page  has

> If Len(strAdvancedForm) <= 0 Then
> strAdvancedForm = "false"
> strWasAdvForm = "false"
> End If

while the advanced  one has

> If Len(strAdvancedForm) <= 0 Then
> strAdvancedForm = "true"
> strWasAdvForm = "true"
> End If

So if I just change true  to false, the web part  will default  to being a
"simple" interface.

Simple enough, [ah]. I just hadn't gotten around to running a real diff() on
the two sets  of code. Once I did that, it was clear as day.

 
Didn't find what you were looking for? Find more on Advanced Search Web part - Simple vs Advanced? Or get search suggestion and latest updates.




Tagged: