Friday, July 31, 2009

Tweaking the Quicklaunch menu with JQuery

The standard Quicklaunch menu or the <SharePoint:AspMenu> has some limitations regarding layout and dynamic display… Microsoft has released the code to the menu in order to make the menu more customizable (The reason for the publication of the source code is the the fact that the control is marked as sealed and is therefore not eligible to be used as the base class for derived types.) Read my other post on how to use this code to highlight the selected menu items.

When using a WSS environment the menu has further limitations regarding the url of a root element. The “problem” is that all menu items must have a url. The easy fix for this is to make all your level one URL’s like “/#” This will result in a link to the same page, but there will be a postback when a user clicks on the link.

In some scenarios you do not want, or you can not modify SharePoint using Features and compiled code.

So how do we modify the menu without writing any C# code? We use the JQuery library to parse and tweak the HTML already generated by the aspmenu control

The main part of the JQuery code is made by Paul Grenier and filed at EnduserSharePoint.com. Be sure to check out the other JQuery and SharePoint related articles!

The solution looks like this when finished

JQuery_Menu

To make the menu look like this I used one JavaScript library, a modified CSS file and a modified Masterpage. The masterpage modifications is minor and not a part of the dynamic experience…

The masterpage was modified to link to the two java libraries used, one for the JQuery library and one for the script from Paul Grenier.

linking_JQuery

I have modified the script a little in order to make the empty headers act as you clicked on +/- (The modifications are simple and can surely be made better, but it is my first JQuery Code)

JQueryMod

When a link is modified in SharePoint Services and the address is /#! the link will not behave like a normal link but expand/collapse instead.

jquery_empty_link

This was a big eye opener and definitely my start down the “JQuery Lane” It is so much you can do with so little code…

The files used can be downloaded here

Wednesday, July 1, 2009

You can now hear the content of this blog

I have embedded the ReadSpeaker service on this blog. The Free ReadSpeaker WebReader will make the content more available for users with some form of reading disability.

Just click on the Listen button on every post to make the “web speak”

ReadSpeaker logo

 

 

 

 

 

Check out the ReadSpeaker website for more information.

Problem with two domains automatically authenticating

After joining two domains I discovered that only users from one domain where automatically logged on to SharePoint. After checking with Google I tried to give the users Access using the Built-in groups, and changing the web application policy. I even checked the possibility to create different zones etc.

The two domains trust each other, and the users in one domain is included in a domain group in the “source domain”. So theoretically this should work…

After checking nearly all settings in SharePoint I took a look at the client, Internet Explorer. Since all settings in IIS and SharePoint looked OK, I figured that it may be the client.

After configuring the SharePoint URL as a trusted site, and changing the User Authentication in IE the problem was solved.

twodomains_001

Thinking about the problem, and the simple solution I found that always starting the problem solving at the server end may result in many hours of headache. Next time I will check the client configuration…

To configure the “Automatic logon with current user name and password” Choose Tools->Internet Options, Security Tab, and click on the “Custom Level” button. Scroll down to the bottom of the settings list.

This can easily be distributed with a GPO, and for my lesson learned, I always check for the sites to be a trusted site, or in the local intranet zone before checking the server configuration.