Reasons to love the Content Editor Web Part (CEWP)


UPDATE: Another site with ideas on the CEWP:

This post describes some of the possible uses of the Content Editor Web Part (CEWP). I have gathered these from various sources on the web, and have used them all in real-world solutions.
Image rotator
Good for: Fast, easy-to-maintain image rotator directly on a SharePoint page
Not good for: fancy transitions or rollover behaviors (in which case I prefer Flash)

First of all, upload a series of web-friendly images to a new picture library, and be sure to create a flat view (no folders). Then generate the code for an image rotator from this web site using the URL for the picture library you just created – – and follow the intstructions. I recommend not using the “gear” placeholder if you set the image height or width, as it will stretch the gear placesholder and it will become pixelated.
Display a list from another site on a page
Good for: Displaying lists from another site
Not good for: Displaying lists from another site collection

This nice little script allows you to display a list view on a page even if it’s not within the same site. This does not, however, work well for lists from other site collections.
Override branding on a single page
Good for: Manipulating an element on a single page without affecting other pages
Not good for: Manipulating lots of elements, or an element on several pages (would be a nightmare to manage)

This is useful if you have an element on a page you need to manipulate, but you don’t want to make the change sitewide. Of course you can always create a new template etc etc, but a quick way to manipulate the CSS on a single page is to override tags. For example, the colors for breadcrumbs in SharePoint are set by the main css file. It doesn’t make sense for breadcrumbs to appear on a home page since it will only say “home” and take up space, so insert a CEWP on the home page with this code to hide the breadcrumb element:

<style type=”text/css”>

This works because the CEWP is rendered last, thereby overridding the corresponding tags in the main css file. Use this for whatever tags you would like to override. To find the tags, I like the IE Developer Toolbar.
Calendar resizing and color-coding
Good for: Resizing a SharePoint calendar from a MONSTER size to something more reasonable
Not good for: Sites with custom calendar CSS tags – need to hunt down ALL the tags so that this looks right

This works the same way as the section above: it overrides CSS tags to resize a SharePoint calendar on a page. Insert a calendar, then add a CEWP underneath it as described here:

Furthermore, you can color-code the calendar by using the techniques and/or code generator posted here:
Wildcard people search
Good for: Folks who want a no-code solution, and don’t want to install anything
Not good for: Folks who can handle a more technical solution – there are better ways to do this one

SharePoint currently does not allow wildcard searches in the people search functionality. This snippet gets around that using code inserted into a CEWP:

No Responses Yet to “Reasons to love the Content Editor Web Part (CEWP)”

  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: