21
Mar
10

Collapsible Web Parts in a Zone Using jQuery for SharePoint 2007

Simply put, this plug-and-play solution will add a “+” or “-” to every web part in a given web part zone, allowing users to click the web part title to control the visible state of the web part.  You can control the default state of each web part by setting the Chrome State on the web part.

Screenshot of Collapse Web Parts in Zone 2007 in action

On past projects I have made web parts collapsible by wrapping web part zones with code in the page layout.  The disadvantage with this approach is that it is not adjustable by the client without modifying the page layout.  A project I just wrapped up required the flexibility for site owners to add or remove web parts that automatically became collapsible.  This project was for SharePoint 2010, but I converted the solution to work with SharePoint 2007.

Continue reading ‘Collapsible Web Parts in a Zone Using jQuery for SharePoint 2007′

21
Mar
10

Using jQuery to Wrap Web Parts and Achieve the Unachievable: The Packaged Solution

Introduction

During the course of a customization and branding effort in SharePoint you are likely to find that you want to style web parts to look different from (Dare I say better than?) the stylistic treatment default to SharePoint.

In my quest for finding a way to improve the look of web parts, I discovered Microsoft’s markup for web parts does not allow for much web part style manipulation, as there are not enough CSS hooks.  Nor could I modify the HTML inside a web part zone in order to wrap web parts with <div> tags for styling purposes—you can’t edit the contents of web part zone directly.  So I had to settle with wrapping <div> tags with classes around web part zones, which got me where I wanted to go somewhat, but it failed to allow me to apply treatments like background colors, borders, rounded corners, and drop shadows to individual web parts—I could only apply them to the wrapper around the web part zone.

So I wrote some jQuery to inject into the DOM <div> tags and classes for web parts that I could then use as hooks in my CSS.

On March 17, 2010, EndUserSharePoint.com published a post I wrote about wrapping web parts with jQuery that included the necessary JavaScript function, but not much else.  I apologize my post did not include the other assets needed, like the CSS and images.  Moreover, with that post I had taken the approach of creating a custom master page from which my function would be called (my usual approach for SharePoint customization efforts).  Several commenters noted they were looking for an encapsulated solution they could drop on the page via a Content Editor Web Part rather than a solution that would require them to modify master pages or page layouts.  While I advocate referencing the solution from the master page or page layout, I understand that is not possible in all situations and that EndUserSharePoint.com leans towards solutions easily implemented by content contributors and site administrators.

The following is that solution, all packaged up, ready for you to plug-and-play. Continue reading ‘Using jQuery to Wrap Web Parts and Achieve the Unachievable: The Packaged Solution’

17
Mar
10

Resources for “SharePoint: Using jQuery to Wrap Web Parts and Achieve the Unachievable”

Here you can find the images referenced by my CSS as posted in my article on EndUserSharePoint.com entitled “SharePoint: Using jQuery to Wrap Web Parts and Achieve the Unachievable.”

Place these images in the “Images” folder of the “Style Library” at the root of your site collection.  If you can’t do that, then place them where you can and alter the paths in the CSS so it can find the images.

10
Mar
10

“Make it not look like SharePoint.”

Hi, I’m Brandon Anderson, and I make SharePoint not look like SharePoint.  I will be using this site as a forum for documenting my experience with various aspects of SharePoint UI and look-and-feel customization.  Why?  Well, in case I get hit by the proverbial bus, of course, but I anticipate it will become much more than that.

In brainstorming this blog I came up with the following topics I may address over the coming months.  It’s a draft list, with no particular order or priority, but please do take a gander and let me know if there is a particular post you’d like to see now.  The list:

  1. Dissecting SharePoint: The Scalpel
  2. How to create a custom master page in SharePoint 2007
  3. How to create a custom master page in SharePoint 2010
  4. How to add custom CSS to your SharePoint master page
  5. How to add jQuery to your SharePoint site
  6. Anatomy of a SharePoint 2007 web part
  7. Anatomy of a SharePoint 2010 web part
  8. Why can’t I select my page layout for a new page?
  9. Why does SharePoint Designer say my file is checked out when it is not?
  10. Print style sheet for SharePoint 2007
  11. Print style sheet for SharePoint 2010
  12. Where to store images and why
  13. The magic of AdditionalPageHead
  14. The alternative CSS file in site settings
  15. You think you’re so !important
  16. Styling the ribbon in SharePoint 2010
  17. Putting SilverLight in it’s place
  18. Multi-Column navigation flyouts in SharePoint 2007
  19. Shoo, left nav! Shoo!
  20. Using jQuery to wrap web parts to achieve the unachievable
  21. Creating custom select boxes
  22. Changing the arrow image for the welcome menu
  23. How to make the Title column of a list view clickable using jQuery
  24. Should you put references to custom JavaScript in the head or at the bottom of the body?
  25. Add a favicon for spizazz
  26. How to center a page in the browser window in SharePoint 2007
  27. How to center a page in the browser window in SharePoint 2010
  28. What are the UI considerations for a public SharePoint site?
  29. You must use Advanced Edit in SharePoint Designer 2010

Excited yet?




Who is the SPUIGuy?

Hi, I'm Brandon, and I make SharePoint not look like SharePoint. I have over 4 years experience developing custom branding for internally- and publicly-facing SharePoint 2007 and 2010 sites using (X)HTML, CSS, and jQuery.

Need Help?

I like to help. Follow me on Twitter @spuiguy or email me at spuiguy [at] gmail [dot] com.

Recent Tweets

Hottest Post


Follow

Get every new post delivered to your Inbox.