Archive

Posts Tagged ‘Web Parts’

Adding Filters to SharePoint 2010 Wiki Pages

February 16th, 2011 No comments

I just ran across this today for the first time and was honestly a little surprised by it.  I wanted to add a Choice Filter to my team site and couldn’t.  In SharePoint 2010, when creating a Team Site, wiki pages are used for the home page as well as any other pages you create.  If you edit the page and try to add a Choice Filter (as well as some of the other filters), nothing appears to be added to the page.  However, if you were to open the page in SharePoint Designer, you will see that the web part has in face been added to the page and is actually throwing and error.

So what is the solution?  There are actually two of them.

1.  Active the Publishing Feature for you site, create a Web Part Page, and use this page to add web parts to and utilize filters.

But..what if I don’t want to turn on publishing or I want to be able to use a wiki page?

2. Use SharePoint Designer to insert the filter web part.  That’s right, you can actually open a wiki page in SharePoint designer, insert your desired filter web part there and configure the connection and everything works fine.  Once the web part has been added, you can actually reconfigure it via the browser.  However, I would recommend against this as there is apparently some problem with filters, wiki pages and the browser.  The downside to this approach is you have to use SharePoint Designer which means if you want end users to be able to customize their own pages they either need to be allowed to use SharePoint Designer, or not able to use certain Filter Web Parts.

Hopefully this will be something that is added (or fixed as I’m not if this was intentional or not) in a later patch or update to SharePoint 2010.  If anyone else has additional information or a work around to adding these filter web parts to a wiki page, leave a comment and educate the rest of us.

Upcoming Events Web Part

September 28th, 2010 No comments

I’ve actually done it, a SharePoint Administrator writing a web part.  Granted this web part is in it’s earliest stages, but it performs the task I needed it to.

So, what does it do? It’s a very simple SharePoint 2007 web part (So far I have only tested it on MOSS 2007 Standard Edition) that takes a URL (must be absolute at this point in time) and the name of a SharePoint Calendar list and displays the events on the calendar for the given week.  It can be placed on any page or site within your web application and query a calendar on any other site.

Also, the key issue that got me writing this web part is that is correctly handles recurring appointments on your SharePoint calendar.  If you have recurring appointments, this web part will show the correct start and end time for ONLY the recurring event in the current week rather than the end date for the last recurring appointment.  Here is a screen shot displaying the web part returning a variety of different events scheduled in the same week.

image

Granted, it’s nothing fancy, but for me it was a big deal coming from a SharePoint Administrator background.  There are also lots of bugs to it and errors that aren’t properly handled.  But, it’s a start.

If you want to play with the web part, you can download the solution file below.  Just remember, it’s free, it’s my first real web part and there are definitely several bugs.  So, if you choose to try it out:

1.  Don’t complain about it not working the way you want or about bugs…remember it’s FREE. 

2.  If you do find a bug or have suggestions to improve it, I welcome the comments and suggests and we’ll see what I can do as time allows.

3.  There is no warranty, guarantee, etc, etc…pretty much, I’m providing it free as is.  If you choose to install it in your farm that is your choice and your responsibility.  By downloading this web part you are agreeing not to hold me responsible for any negative effect or impact it has on your SharePoint environment.  Again, if it does something weird, feel free to let me know and I’ll do my best to help you, but there are no guarantees.

If you still choose to try the web part you can download it here.  To install and use the web part:

1.  Download the .wsp file

2.  Add the solution to your farm

3.  Deploy the solution

4.  Activate the Site Collection Feature “Upcoming Events Web Part”

5.  Add the web part to your page

6.  Open the Web Part Properties and in the respective boxes enter an Absolute URL for the page where your Calendar List is located as well as the Calendar Name.

7.  Click OK.

JavaScript error editing Web Parts on a SharePoint Page

May 21st, 2009 1 comment

I was working with a client over the last few days on building a Project Workspace site template.  We were nearly finished and had to make a couple last edits to a web part when we hit the JavaScript error.  When expanding the details of the error it was similar to:

line: 2135
Char: 4
Error: ‘style.display’ is null or not an object
code: 0

This error was keeping us from adding web parts and modifying current web parts (we could still delete web parts, but only by using http://url/default.aspx?contents=1 to get to our web part maintenance page).

I did some researching and thanks to this thread, I found this solution:

1)  Place page in edit mode
2)  Edit the content of the content editor web part by selecting the
‘modify web part’ drop down menu
3)  Select the Rich Text Editor and copy the text if you do not want
to lose it.
4)  Select Source Editor button, this opens the HTML source code for
the CE Web Part
5)  Remove the source code.  Our source code had a conflicting ID.
6)  Update CE web part and make sure source code does not have auto
generated code, or just add a new content editor web part.

The thread varies on what web parts people had on the page, in our case, we only had one content editor web part and then several list web parts.  Once we removed our single content editor web part, everything worked beautifully.