5/15/2010

SharePoint: Change or Hide the Bullet Image in Quick Launch

(Only for SharePoint 2007 as SharePoint 2010 does not have bullets in Quick Launch!)

 

Sometimes it’s the little things…

I had a request where a site owner wanted to change just the bullet used in Quick Launch. They did not want to create a custom theme or do a complete rebranding of the entire site, just change the bullet.

 

So…

Create your new bullet image in your favorite paint program (JPG or GIF format) and upload it to a library in your site, or if you have server access to the Images folder in Layouts. 

Use SharePoint Designer to edit the master page and add the CSS below just after these two lines:
   <SharePoint:CssLink runat="server"/>
   <SharePoint:Theme runat="server"/>

Or, if you want to do a quick test, instead of editing the master page add a Content Editor Web Part (CEWP), edit the CEWP, click the Source Editor button and paste the following.

 

<style>
table.ms-navitem td,span.ms-navitem {
background-image:url("/sites/training/Shared%20Documents/myBullet.gif");
}
</style>

 

The result (with a horrible bullet image!)

       image

Hopefully you are a better artist than I am!

 

 

If you just want to hide the bullet then set background-image to none:

     background-image:none;

       image

 

.

SharePoint 2010: Evaluation VHD download available

 

The 2010 VHD is no longer available from Microsoft…

 

Microsoft has released a new pair of VHD images for SharePoint 2010 evaluation. This is the final release (RTM) version.

To run these you will need Windows Server 2008 R2 with the Hyper-V role enabled. At least 8 GB of RAM is recommended.

 

2010 Information Worker Demonstration and Evaluation Virtual Machine (RTM)

http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=751fa0d1-356c-4002-9c60-d539896c66ce

 

Virtual machine “a” contains the following pre-configured software:

  1. Windows Server 2008 R2 Standard Evaluation Edition x64, running as an Active Directory Domain Controller for the “CONTOSO.COM” domain with DNS and WINS
  2. Microsoft SQL Server 2008 R2 Enterprise Edition with Analysis, Notification, and Reporting Services
  3. Microsoft Office Communication Server 2007 R2
  4. Microsoft Visual Studio 2010
  5. Microsoft SharePoint Server 2010 Enterprise Edition
  6. Microsoft Office Web Applications
  7. Microsoft FAST Search for SharePoint 2010
  8. Microsoft Project Server 2010
  9. Microsoft Office Professional Plus 2010
  10. Microsoft Visio 2010
  11. Microsoft Project 2010
  12. Microsoft Office Communicator 2007 R2

Virtual machine “b” contains the following pre-configured software:
  1. Windows Server 2008 R2 Standard Evaluation Edition x64, joined to the “CONTOSO.COM” domain
  2. Microsoft Exchange Server 2010

5/07/2010

SharePoint: Hide the TreeView Icons

 

The following works for both SharePoint 2007 and SharePoint 2010.

 

How can I get rid of the icons in the Tree View?

A while back I got an interesting request… how can I get rid of the icons in the Tree View?  That’s a question I would have never thought to ask!  My quick (and wrong) answer was you could probably do this by changing the attributes of the TreeView control in the master page using SharePoint Designer.  After a bit of trial and error I did come up with a JavaScript solution.  (and I’m sure someone will post a two line jQuery version!)

The end result is much cleaner!

 

The before:                                      and the after:                                  and with lines:

    image      image     image

 

How to do it…

Hiding the icons takes two JavaScript tricks. The first one removes the images on the initial page load. The second intercepts the web service calls to retrieve further expansions of the tree. I may have missed one or more icon types, but that is easy to fix.

 

To use this code:

  • For testing: Add Content Editor Web Part for testing. In 2007 click the Source Editor button and paste the code below. For 2010 save the code below to a text file, upload the file to a library and in the CEWP add a link to the uploaded text file.
  • For actual use: Add this code to the master page anywhere after where the tree is loaded

You will need to use SharePoint Designer to add the tree viewlines.

  • Open the site in SharePoint Designer
  • Open the master page and search for “ShowLines”
  • Change ShowLines = “false” to ShowLines = “true”

            image

 

 

The Code…

The following is offered with no warranties!    :-)

 

Note: Do a search of the HTML of a page where you have the tree view enabled.

   For SharePoint 2010 replace:
      "ctl00_PlaceHolderLeftNavBar_WebTreeView"
   with:
      “ctl00_PlaceHolderLeftNavBar_ctl01_WebTreeViewV4”

   or maybe:

      “ctl00_PlaceHolderLeftNavBar_ctl01_ctl01_WebTreeView”

  1. Display the page
  2. Use the browser’s View Source option to display the HTML
  3. Search for “WebTreeView” and find the ID

 

 

There are two copies of the code below, one is “pretty formatted” and one is plain text that may be easier to copy and paste.

 

 
<script>
 
// Step 1: hide icons on the initial page load...
 
//get the tree DIV
var tree = document.getElementById("ctl00_PlaceHolderLeftNavBar_WebTreeView");
 
//get the treeview rows
var trs = tree.getElementsByTagName("TR");
 
//loop through the rows and hide the images
for (i=0;i<trs.length;i++)
{
  var tds = trs[i].getElementsByTagName("TD");
  if (tds.length>0)
  {
    tds[1].style.display="none"
  }
} 
 
 
// Step 2: intercept the web service call and fix up the returned data
 
// make a copy of the SharePoint return handler
var backup=TreeView_ProcessNodeData
 
// create our replacement function
TreeView_ProcessNodeData = function(result, context)
{
  //replace the images with blank.gif  (it*.gif, stsicon.gif and folder.gif)
  result = result.replace(/\/_layouts\/images\/it/g,'/_layouts/images/blank.gif" x="')
  result = result.replace(/\/_layouts\/images\/stsicon/g,'/_layouts/images/blank.gif" x="')
  result = result.replace(/\/_layouts\/images\/folder/g,'/_layouts/images/blank.gif" x="')
 
  //call the SharePoint return handler
  backup(result, context);
}
 
</script>

 

 

The following may be easier to copy and paste:

 

<script>

// Step 1: hide icons on the initial page load...

//get the tree DIV
var tree = document.getElementById("ctl00_PlaceHolderLeftNavBar_WebTreeView");

//get the treeview rows
var trs = tree.getElementsByTagName("TR");

//loop through the rows and hide the images
for (i=0;i<trs.length;i++)
{
  var tds = trs[i].getElementsByTagName("TD");
  if (tds.length>0)
  {
    tds[1].style.display="none"
  }
}

// Step 2: intercept the web service call and fix up the returned data

// make a copy of the SharePoint return handler
var backup=TreeView_ProcessNodeData

// create our replacement function
TreeView_ProcessNodeData = function(result, context)
{
  //replace the images with blank.gif  (it*.gif, stsicon.gif and folder.gif)
  result = result.replace(/\/_layouts\/images\/it/g,'/_layouts/images/blank.gif" x="')
  result = result.replace(/\/_layouts\/images\/stsicon/g,'/_layouts/images/blank.gif" x="')
  result = result.replace(/\/_layouts\/images\/folder/g,'/_layouts/images/blank.gif" x="')

  //call the SharePoint return handler
  backup(result, context);
}

</script>

 

 

.

SharePoint: List View Styles


The following applies to SharePoint 2007, 2010, 2013, 2016 and SharePoint Online.

Note to 2013 and later users… Selecting any view but "Default" will hide the new command bar at the top of the list/library.
image



List View Styles

If you have been to one of my classes then you know that “If I had written SharePoint…” is one of my often used phrases. Some of these are “big” items, but most are little things that make using SharePoint just a little nicer.  One of those is how the list of Styles is displayed in the View Edit page. See all of that empty space on the left?  It sure would be nice if they had given us little screen captures of what these styles look like so we don’t to try every one of them to find the one we like. Well… they didn’t. So I went and collected screen captures of each Style.

(Make sure you read or scroll to the end as see what the Preview Pane style does!)

   image

Several Lists and Libraries have special Styles

First a note, we are talking about the Standard View here. Calendar views for example do not have optional Styles. Standard Views for calendar lists do have styles. (All Events is a standard view).
Most lists, like Custom Lists and Announcements have these styles:
   image
Picture Libraries add Picture Library Details and Document Details and removes the two Boxed styles:
   image
Document, Wiki and most other libraries add Document Details and removes the two Boxed styles.
   image



Default

This is the default “All Items” view
   Default

Basic Table

Just adds some lines…
   Basic Table

Boxed, no labels

Kind of like mailing labels. This could be a problem if you have non-obvious fields.  For example, which of the dates below is the Create date?
   Boxed, no labels

Boxed

   Boxed

Document Details

This one is basically “Boxed” with the addition of file type icons and a properties button.
   image

 

Newsletter

This looks just like “Basic Table”. Exactly like “Basic Table” for my Announcements list.
   Newsletter

Newsletter, no lines

This looks just like “Default”, so maybe the default is “Newsletter, no lines”!
   Newsletter, no lines

Shaded

Anybody remember “green bar” paper?
   Shaded

Preview Pane

Now this one is kind of cool! The first screen before is when you first display the view. Down the left side of the view you will find the titles of the Announcements, on the right, a “form” to display the data. Click or mouse-over any one item and you will see that data. This is a great way to show a lot of data in a small amount of space.
   Preview Page - no item selected
   image
This is really cool when used with a Picture Library! Slide your mouse down across the left hand column of image names and see all of the details on the right. The only other thing I changed below was to add the Thumbnail field to the view.
  

image

For Developers...

Each view style has an ID number:


0
Basic Table
6
Picture Library Details
7
No name
8
No name
9
No name
12
Boxed, no labels
13
Boxed
14
Document Details
15
Newsletter
16
Newsletter, no lines
17
Shaded
18
Issues Boxed
19
Issues Boxed, no labels
20
Preview Pane



.

4/21/2010

SharePoint Q&A with the MVP Experts

 

Stop in to the MSDN Online chat rooms on April 27th and 28th and ask questions of SharePoint MVPs, or just hang around and listen in to see what you might learn…

April 27, 2010
4:00 - 5:00 P.M. Pacific Time  (7 PM for us in Cincinnati!)

April 28, 2010
9:00 - 10:00 A.M. Pacific Time (12 noon for us in Cincinnati!)

 

Go here for details: http://msdn.microsoft.com/en-us/chats/default.aspx

“Do you have tough technical questions regarding SharePoint for which you're seeking answers? Do you want to tap into the deep knowledge of the talented Microsoft Most Valuable Professionals? The SharePoint MVPs are the same people you see in the technical community as authors, speakers, user group leaders and answerers in the MSDN forums. By popular demand, we have brought these experts together as a collective group to answer your questions live. So please join us and bring on the questions! This chat will cover WSS, MOSS and the SharePoint 2010. Topics include setup and administration, design, development and general questions.”

Think you are good at scripting? Want to go to TechEd?

 

VBScript?  PowerShell?  Go see how good you are and maybe get to go to TechEd!

 

First go and read this: http://blogs.technet.com/heyscriptingguy/archive/2010/04/21/may-we-suggest-attend-tech-ed-north-american-2010-in-new-orleans.aspx

 

Then click the picture below and go and sign up for the 2010 Scripting Games!

 

2010 Scripting Games

Note to spammers!

Spammers, don't waste your time... all posts are moderated. If your comment includes unrelated links, is advertising, or just pure spam, it will never be seen.