1

I have created a new site collection of type "Enterprise Search", and it provides an "Advance" search page.now i did the following:-

1- I Export the advance search web part.

2- add a new managed property named Area to the web part XML, as follow:-

> <PropertyDef Name="ManagerAreaOWSCHCS" DataType="text"
> DisplayName="Area"/>"

enter image description here

Now the Area represents a site column of type choice.

3- so is there a way to modify the web part to show a drop-down list for the "Area" instead of a free text field. at this stage i am searching for a simple appraoch, so building the drop-down options manually is fine.i mean there is no need to link these options with the site column choices.

So can anyone adivce if this is possible ?

  • 1
    You could use JQuery to change the textbox into the drop-down when "Area" property is selected. Note that you will also have to override the "Search" button to retrieve the value from dropdown. Or just keep the textbox hidden and update it's value on drop-down change... – Gintas K Nov 29 '16 at 16:58
  • @GintasK other than using jQuery and changing the search button ,, is there a way to do this in a more standard way,, such as modifying the XML for the advance search web part ? – john Gu Nov 29 '16 at 16:59
  • 1
    I am not so familiar with XML, even though I doubt that this can be done in an easy way... Just saying that this can be done with jQuery if not with XML :) Good luck! – Gintas K Nov 29 '16 at 17:03
  • 1
    @GintasK the problem with using jquery is that i need to explore the markup for the advance search web part, and apply the drop down to it... and doing so means that the advance search might break after applying a sharepoint update,, because a SharePoint update might modify the markup for the advance search page, or at-least there is not guarantee that the markup for the advance search will stay the same.. i would go with jQuery if there is not any other appraoch i can follow :( – john Gu Nov 29 '16 at 17:06
  • 1
    Just did some more research, all I could find was third-party software. That does not promise anything good... – Gintas K Nov 29 '16 at 17:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.