Friday, February 22, 2008

SP2007: I need to... Web Part

The web part "I need to..." states that it will display tasks and tools from a list. This little statement is deceptively simple, and there are a few requirements for the list before it will display. The "I need to..." name is also somewhat misleading.

This list you will point this web part at requires, at a minimum, a Title, a URL (Hyperlink or Picture) field, and a Choice field. You could start with a Tasks list and add a URL field, or you could start from scratch with a custom list. Part of your decision depends on how you want to use this web part and what fields it will need.

If you'd like the web part to simply be a nice compact list of links you visit on a regular basis, it is best to start with a Custom list. A new custom list will have a Title column by default, so you only need to create a URL and Choice column. Go into the list settings and create a new column called "URL". Make this a Hyperlink or Picture field. Next create a column called "Display". Make this a Choice type, with the possible choices of "Yes" and "No". Make the default value "Yes". Now you can point the "I need to..." web part at this list, and set the Filter Field to "Display" and the Filter Value to "Yes".

Once you make these changes you may need to close your browser and relaunch it.

Using a task list can give you some intersting options, as you can filter on the task status or priority, and then link the task to a website or document that you need to work on. Just start with a standard task list and add a new column called URL.

This paticular web part tends to keep things cached. Also you can only have one of these "I need to..." web parts on a page.

SP2007: Filtering a Calendar View by Start Time

For some unknown reason you cannot filter a Calendar by Start Time in a custom view. This is fairly odd, as it is a common request to filter out calendar events that have past.

A user named Dink posted this helpful tip at SharePointU

Create a new column named "Begin Date", make it calculated, add "=[Start Time]" in formula, return type of date and time, uncheck add to default view.
Create a new view "Future events" (or similar) based on standard format, on filter - select "Show Items only when the following is true", select "Begin Date", select "is greater than or equal to", enter "[Today]" in field, click OK to save new view.

Keep in mind that this will also filter out events that have started but have not yet ended. An alternate approach would be to set your custom field to equal the End Time field.

Another SharePoint customization blog offers a way to use a custom yes/no field that calculates if the event has passed.

Thursday, February 14, 2008

SP2007: Search Box CSS

There are many ways to customize the look of the search box using CSS. Heather Solomon's CSS Chart provides a handy reference for these settings and others. There are a few areas it does not address.

One item that you cannot change is the width of the text input box. For some reason the width for this box is hardcoded as a style tag right in the input tag. It is set to 170px. This is unfortunate as a smaller text input field would help my layout.

If you are looking to hide the Advanced Search link, you can do that. Read this post for more information.

Wednesday, February 13, 2008

SP2007: The Advanced Search Link

To have the Advanced Search link appear next to the seach box in the upper right hand corner of your pages you must be using the custom scopes option for the site collection. To do this go to Site Actions, Site Settings, Search Settings and set the custom scopes option following the example. This will make the Advanced Search link appear, and it links to the advanced.aspx page in the Pages library.

If you want to remove the Advanced Search link, but want to keep the custom scopes option, read on...

For reasons of design it is common to want to remove the Advanced Search link and move it to the search results page. Unfortunately there are no settings that allow you to turn this link on and off provided you want to stick with the custom scopes option. Some tutorials will instruct you to replace the search control with your own custom one, but that is complicated and messy. The easiest option is to simply hide the link. This can be done in two ways.

You could add a javascript to your master page to set the inner html of the link to nothing. Create a function and then run that function from the body tag. Something like the following should work:

function hideadvancedsearch() {
document.getElementById('ct100_PlaceHolderSearchArea_ct101_S6AE27B38_AdvSearchLink').innerHTML=" ";

While this will hide the link, the spacing will still be off. A cleaner approach is to use your style sheet to set the display property for the table cell to none which will completetly hide that cell of the table.:


You may also want to set the sbLastcell to none to force the search box to align on the right