"I Need To…" Display a List of Documents

In this article, I’ll describe how to use the out-of-box “I Need To…” web part to display a dynamic list of documents in a document library.

About the “I Need To…” web part

This web part displays items in a list on the sharepoint site.  The Title field is the field that will be displayed.  The list also must have a hyperlink field, and it must be called “URL”.  There must also be a field in the list that is a choice field, to be filtered by. 

Your Document Library
In this example, my document library is called “Documents”.

  1. Add a new column called “URL”, and make it a hyperlink field
  2. If you don’t already have a choice field you’d like to filter by, add a new column called “Active”.  It’s a choice field, with the options being Yes or No, with the default as yes.
  3. Using SharePoint Designer, create a new workflow that will run when each new item is created or changed in the document library.
  4. Call this step in the workflow “Set URL”.  There are no conditions, and only one action:
    Set Field in Current Item: Set URL to the current item’s URL Path field.
  5. Click <Finish> to save the workflow.
  6. Upload a couple of documents to the library, to test this.
  7. Add the I Need To web part to your page.  Go to the web part’s toolpane.
  8. In the List Name box, click the <Change…> button, and select your document library.
  9. In the Filter Field box, select “Active” from the drop-down box, and in Filter Value, select Yes. 

    I need to

    I need to

  10. Click OK.  Sometimes it makes you check in the page before displaying your changes.

You might see your document names in the drop-down box at this point, but you might not.  The problem is that this web part uses the Title field, and a lot of times that field isn’t utilized in document libraries.  There are some options you have at this point:

  • Make the Title field a required field in your library.
  • OR, put a step in your workflow that will put information in your Title field…
    Add a second step in the workflow called “Document title”.  Condition is “If Title is empty”, and Action is to set the Title field to the Documents:Name.
  • OR, put a step in your workflow that will set only the items with Title information as “Active=Yes”…
    Add a second step in the workflow called “Active Documents”.  Condition is “If Title is empty” AND “If Active=Yes”, then the Action is to set the Active field to No.

Note: At this point, if users change the name of the document, but not the Title, nothing will happen to the title.  But, since this workflow is set to run every time the document is changed, changes to the document names WILL be reflected in the document’s URL.

Another thing you might want to do is hide the document library’s URL field from forms.  In the library’s settings, go to Advanced settings.  Change the setting “Allow management of content types” to Yes.
Now, there’s a new section in your library’s settings called Content Types that contains one content type called “Document”. 
Click on the Document content type, click on the URL field, and change it to Hidden.  This will cause the field to be hidden when opening or editing the document properties.  You can do the same for the “Active” field if you’d like.

Posted in Uncategorized | 7 Comments

Fun With Announcements – Part 4

And here is the last of my four part series on “Fun with Announcements”

Create a “More” link to view the details of each announcement

http://www.endusersharepoint.com/?p=1405

Posted in Uncategorized | Comments Off on Fun With Announcements – Part 4

Fun With Announcements – Part 3

Here is today’s article of mine, as part of my “Fun with announcements” series.  Todays is called
“Modify the default ‘Current View’ of the announcements Web Parts”

http://www.endusersharepoint.com/?p=1403

Posted in Uncategorized | Comments Off on Fun With Announcements – Part 3

Fun With Announcements – Part 2

Today’s article that I wrote for the End User SharePoint site is called:

Create Alerts Based On Announcement Categories

Here is the link to it: http://www.endusersharepoint.com/?p=1402

Posted in Uncategorized | Comments Off on Fun With Announcements – Part 2

Fun with Announcements – Part 1

There is a new series that I’ve written, about fun things that you can do with an announcements list in SharePoint.

This is part one, and has been posted on the endusersharepoint site:
http://www.endusersharepoint.com/?p=1399

Enjoy, and happy sharepointing!

Posted in Uncategorized | Comments Off on Fun with Announcements – Part 1

Fix for the Custom Form Attachments Issue

In my first blog post called Displaying SharePoint Fields by Permission level, I made a side note that said

Also, I’d like to note that when using custom forms like this, the Attachment button doesn’t work anymore.  I think there are blogs somewhere about this bug, but I’ve never tried fixing it.

Well, Microsoft finally has a fix for this.  So, aparently, as long as you do have the infrastructure update installed on your servers, and your SharePoint Designer is at SP1 level, you can install the following fix:

The following is the email directly from Microsoft about where to get the fix, and how to apply it:
__________________________________________

This is the client side fix:

http://support.microsoft.com/kb/960311

The server side fix you already have installed but that is the WSS 3.0 Infrastructure Update.

Download this and update your SPD. This will place the code needed to make attachment functionality work for new and edit forms.

For Display forms only, you need to add this:

  1. Open SharePoint Designer 2007. Go to File | Open Site and connect to SharePoint site.
  2. Expand out Lists -> [List Name] -> open DispForm.aspx .
  3. Highlight normal list form by clicking on it. This will select the entire webpart.
  4. Right-click on selected web part, and choose Web Part Properties…
  5. Expand [+] Layout, check option for Hidden, click OK.
  6. With web part still highlighted, hit the right-arrow key once. Hit Enter. This creates some whitespace to insert.
  7. Go to File | Insert SharePoint Controls | Custom List Form…
  8. Select appropriate list or library, content type, and type of form to create. Click OK.
  9. Put cursor in the “Expires” table cell, right-click | Insert | Row below. There should now be a new table row with two column cells.
  10. Put cursor in the left table cell of the new row, type “Attachments”.
  11. Put cursor in the right table cell of the new row, go to Code view, and paste the following code:
    <SharePoint:AttachmentsField ControlMode=”Display” FieldName=”Attachments” runat=”server” Visible=”true”/>
  12. Save page.

In summary, in SharePoint Designer, when you insert a custom form (DVWP) to create your own custom EditForm.aspx, DispForm.aspx, and NewForm.aspx, the attachment functionality won’t break anymore.

Posted in Uncategorized | 7 Comments

Birmingham SPUG and TechMixer

For my neighbors in Alabama, here’s some information about SharePoint stuff going on in our neck of the woods:

Birmingham SharePoint User Group

Meetings are the second Tuesday of every month, at the CTS office in Hoover.  On the website, you can “Join the Group”, so that you’ll receive email invites for each meeting.

Birmingham TechMixer Expo

February 19th, 2009.
TechMixer Expo is a exposition event for the technology community of the greater Birmingham region.  Tech professionals and enthusiasts are invited to attend this FREE event which is centered on the numerous Technology User Groups and Technology Supporting Companies in the region.  This is the 5th edition of TechMixer Expo.  The last Expo attracted over 800 attendees and 70+ sponsors.

The event is hosted on the entire 3rd floor of the McWane Science Center.  Parking in the deck is free (deck entrance on 2nd Ave N) at which you can access the event entrance from Level C.  Valet parking on the curb of 2nd Ave North will also be available.  Free finger foods and a cash bar.

I’ll be working the B’ham SPUG booth this Thursday (Feb 19th, 2009) at TechMixer.  Hope to see you there!

Posted in Uncategorized | Comments Off on Birmingham SPUG and TechMixer

The Best Workflow Tutorials

Just thought I’d let everyone know where I learned everything I know about workflows.  This site is friggin awesome, and the tutorials are very detailed.  You can tell that this guy, Stephen, put a lot of work into this.

http://office.microsoft.com/en-us/sharepointdesigner/HA102564171033.aspx

Then, just recently, by popular demand, he posted all of the associated files that he used in his demo!!

http://blogs.msdn.com/sharepointdesigner/archive/2009/01/27/visio-diagram-and-site-template-from-office-online-workflow-videos.aspx

It might take half a day, but I recommend that you go through all of his tutorials when you get a chance.

Posted in Uncategorized | Comments Off on The Best Workflow Tutorials

Alerts Based on Views

This is a “SharePoint Tip of the week” email that I sent out to our site administrators in November of 2007.  Thought I’d share it…

In SharePoint 2007, alerts can be set up based on filtered (specific) data, using views!

This applies to any SharePoint document library or list (contacts, calendars, tasks, etc.).  The following example will include how this is done on a document library with custom fields.

Example Case

n  An example hospital has different floors on their hospital.  They have created a new field in the Patient Admissions list called “Floor”.  Users are given a drop-down box of options for what floor a patient is admitted to.  Users would like to know if they can set up Patient Admissions list alerts so that they are only notified when patients are admitted to THEIR floor.  SURE THEY CAN!

n  First, the appropriate VIEWS need to be created, one for each “floor”.  Create 4 new views for: 1 North, 1 South, 2 North, 2 South

n  The first view will have a filter of: Show the items when column Floor is equal to 1 North
Create the other 3 views with filtering for each of their appropriate floor names

Creating the Alerts.

n  On the Patient Admissions list, click <Actions> and choose <Alert Me>

n  In the Send alerts for these changes section, choose the very last option called “Someone changes an item that appears in the following view

n  Then, in the drop-down box for that option, choose the name of the floor for which you’d like to receive alerts.

n  In summary, any data in any field of your list can be filtered into a View.  Alerts can be created based on any *filtered* view, even “Personal” views.

Oh, and another good way to use this feature would be on an Announcements list.  Each announcement would have a category, such as the department that the announcement is targeted to.  Create a view for each category.  This way, your users can set up their own alerts on the announcements list, and choose to only be alerted when a new one is added for their department.

Posted in Uncategorized | Comments Off on Alerts Based on Views

The Category Page in a SharePoint Blog Site

In this blog post, I’ll not only go over how to fix the category.aspx page when it breaks, but how to associate an image with each blog category, and have that image displayed each time you view that category’s page.

On each site created using the Blog Site template in SharePoint, there is list for blog categories.  On the left side of the Blog’s main page, the categories are listed, along with a button to add a new category.  The default categories are Category 1, 2, and 3.  When one of these category names is clicked, you are taken to category.aspx.  This page automatically filters your blog entries by the name of the category that was clicked.  Unfortunately, it appears that any time you go into edit mode on this category.aspx page, and modify / mess with the web part view, the automatic filter functionality is broken.

This can be fixed using the Query String (URL) filter web part:

  1. Add the Query String (URL) filter web part to the category.aspx page.
  2. Query String Parameter name = Category
  3. Create a connection from the filter web part to the Posts web part, to the posts’ category field.

How To Associate An Image With Each Blog Category

  1. Create a picture library
  2. In this image library, create a new column, called “Cateogry”, as a lookup field to the Category list.
  3. If you haven’t already, go to the category.aspx page and do steps 1 through 3 in the first part of this blog.
  4. Upload your images, and associate each image with a category.
  5. Create a blank web part page on this site.  It doesn’t matter which library it’s in, because you can delete it when you’re done.
  6. Open this page in SP Designer, and click in a zone, and add a data view web part. Pick your image library where the category-associated images are stored.
  7. In the data source library pane on the right, click the drop-down on your image library, and choose “Show data”. Select only the Name field, and choose to insert selected field as… Multiple item view.
  8. Put your aspx page in split screen in SPD, so you can see the code. Select the first cell that contains the name of the first image in the library.
  9. In the code, within the <td> (that cell), paste this:
    <img border=”0″ src=”{@FileRef}” />
  10. Then, this will display only the images in your table.
  11. Save, and go open this web part page in your browser. Export the web part.
  12. Go to the category.aspx page. Import the web part there.  It will look nice in the Right zone.
  13. Create a new web part connection from your Query String URL filter to this new image library web part. For the filter field, choose “Category”.

Done!  Now, each time you click on a category page, you see the image associated with that category.

Posted in Uncategorized | 5 Comments