This posting I took it from Here
This applies to both SharePoint 2007 and 2010. In MOSS Enterprise, and the 2010 version of Enterprise. There is an out-of-box web part called the Text Filter Web Part. Basically, when you put this web part on a page, and put a list or library web part on the same page, you then create a web part connection that sends the text typed in the box as a filter to one of the columns in the web part, like this:
The name Molly Clark had to be typed in exactly. So, if you typed “Molly”, this record would not come up.
People use the text filter web part when they just want to search a single column in a list or library. Otherwise, you’d simply use the “Search” box at the top of the screen, choose “This List” or “This Site” and perform SharePoint searches that way.
So again, this involves a data view web part… and that “parameters” concept that I keep raving about.
This applies to both SharePoint 2007 and 2010. In MOSS Enterprise, and the 2010 version of Enterprise. There is an out-of-box web part called the Text Filter Web Part. Basically, when you put this web part on a page, and put a list or library web part on the same page, you then create a web part connection that sends the text typed in the box as a filter to one of the columns in the web part, like this:
The name Molly Clark had to be typed in exactly. So, if you typed “Molly”, this record would not come up.
People use the text filter web part when they just want to search a single column in a list or library. Otherwise, you’d simply use the “Search” box at the top of the screen, choose “This List” or “This Site” and perform SharePoint searches that way.
One more note before I get into today’s solution:
If you’re making use of site columns in your lists, there’s a setting where you can specifically select which columns you do NOT want to be searchable on the site. In Site Settings, click Searchable Columns. Put check boxes in the NoCrawl column for the ones that shouldn’t be searchable.Here’s how to set up the text filter so that any partial word searches will work
One problem: with this solution, I don’t think there’s a way to make the list automatically display all items by default before doing your filter.So again, this involves a data view web part… and that “parameters” concept that I keep raving about.
- Go to a web part page, open it up in SharePoint Designer, and insert a text filter web part and a data view web part of any list or library.
- Click to select your list web part, click the Data View menu, and choose Parameters.
- Create a new parameter. In the name column, it doesn’t matter what it’s called, let’s just call it FilterParam. In the Parameter Source drop-down box, choose Query String.
The Query String Variable needs to be the exact name of the column that you’d like to filter.
- Click the Data View menu, and choose Filter.
The Field Name needs to be the name of the column you’re going to filter, and HERE’S THE TRICK: Form the Comparison, choose CONTAINS. For the Value, choose the name of the parameter that you created at step 3. Click OK. - Right click on the Text Filter Web Part, and choose Web Part Properties.
- The Filter Name box is required. Make something up. If it’s going to be used to search the title field, you might want to call it something intuitive like “Search Title”. There’s also a box in the Advanced Filter Options, to control the width in pixels. Type in a width if you wouldn’t like the web part stretching across the entire page. Click OK.
- Right click on the text filter web part, and choose Web Part Connections.
- Choose Send Filter Values to. Click Next.
- Connect to a web part on this page. Click Next.
- Target web part: choose the name of your list. This part is important: The target action needs to be Get Parameters From. Click Next.
- Click the name of the text filter on the left, and the name of your new parameter on the right. Click Next.
- Click Finish and save the web part page.
In sharepoint designer 2010, you cant see the data view menu directly,
ReplyDeletewhen you select the list. on ribbon it shows List view tools in that there is "options tab", in that you can see "parameters" and "filter" as specified in this posting.
Thank you for this tip and for pointing me to the WonderLaura site. (I also posted this same question on her site ... but would like to get your input as well.) Here's my question: I tried it in our TEST environment and it worked like a charm. I took it a step further and created a new column that was a concatenation of all the other columns in the list (called it AllColumnValues) and then created the new parameter as QueryString: AllColumnValues. So, if "Molly" existed in any of the columns in the list, the Text Search returned those list items. However, now that I have it workding in TEST, I am leary of launching Sharepoint Designer 2010 in our PROD environment to replicate the same steps. I'm very confused about when it is safe to edit/not edit pages in Sharepoint Designer. I've read several posts about there being potential problems of doing this and that it is safest to launch SPD only in a QA/Development environment. To get around this, I did try to export the list and webpart to which I added the parameter and then, import it into PROD but the parameter did not come through. Any suggestions? Thanks again for the post!
ReplyDeleteAs way of an update, I answered my own question of Nov 11! At the suggestion of Laura (of WonderLaura!), I created a separate site collection and opened up that site collection in SPD. There I followed the above instructions and created a list view web part with a parameter as outlined in Step 3. However, I discovered that I had to export the web part INSIDE of SPD. (This was the "aha!") Doing so gave me a prompt asking if I wanted to use a RELATIVE path for the associated list. I said Yes. I was then able to successfully import that web part on to my production page. I also found that I had go to List Settings within the SharePoint UI and set up the "CONTAINS" filtering as noted in Step 4 above. (That piece did not come through with the webpart export/import.) FYI!
ReplyDeleteHi
ReplyDeleteDoes it search the list items on other pages?
for example if you have 100 records and u have set 30 records per page and u try to search a list items which is located at page 3, will it work?
Ye it will.
DeleteHow to implement the same feature for Share Point 2013
ReplyDelete