Monday, February 22, 2010

Get This: Title Icon in Web Part

On many occasions I have needed to use an image icon within the title of a given web part; this dresses up the web part and adds visual appeal.  Historically, I have addressed this either using styles (with an image background) or a content editor web part  (and setting the chrome to none on the web part in question) to get the desired effect.  This has always been somewhat painful and I was surprised that Microsoft hadn't addressed this.  Well, they had - I just didn't know it.  :)

On a project last summer I stumbled upon the Title Icon in web parts...I had never noticed it before!!  For those of you that had, to some degree, ignored the Advanced settings of a web part - this is where you will find the Title Icon (and yes - this is super duper easy).

  1. Navigate to the page where the web part is located
  2. Modify Shared Web Part
  3. Expand the "Advanced" section
  4. In the "Title Icon Image" URL field - enter the URL of the icon to be displayed

  5. ...and voila - the image is resized on the fly and sits nicely in line with the web part title:
  6.