Archive for October, 2007

SharePoint Master Pages - View All Site content page problems

So I’ve been branding up a SharePoint system, and discovering all of the fun ‘features’ of the master pages in SharePoint. One of them is the way that SharePoint has lots of pages which use the ‘administration’ master page, which you can’t customise. And some are a bit awkward - File upload, Create Web Page, View All Site Content, Recycle bin.

Well, the View All Site content page is awkward, as everyone seems to have it on their page, but I think you’d miff site admins by removing it from the page. So, I went in and had a look at the code for it - and realised that it was security trimmed. It uses an SPSecurityTrimmedControl:

<!-- View All Site Content -->

<label class="ms-hidden">

<SharePoint:EncodedLiteral runat="server"

     text="<%$Resources:wss,quiklnch_pagetitle%>"

     EncodeMethod="HtmlEncode"/>

</label>

<Sharepoint:SPSecurityTrimmedControl runat="server"

     PermissionsString="ViewFormPages">

     <SharePoint:SPLinkButton id="idNavLinkViewAll" runat="server"

          NavigateUrl="~site/_layouts/viewlsts.aspx"

          Text="<%$Resources:wss,quiklnch_allcontent%>"

          AccessKey="<%$Resources:wss,quiklnch_allcontent_AK%>"/>

</SharePoint:SPSecurityTrimmedControl>

Hmm. Okay. But users with very few permissions were still able to see this link. What gives?

Well, the important part is the PermissionsString attribute - it’s set to ViewFormPages. That’s pretty low - users who’re able to view a library seem to have that. So I wondered, what other PermissionsStrings are there?

A quick search found Zac Smith had been wondering the same thing. And then I thought to check MSDN, and they have a nice list of the permissions and what they mean.

So, I set PermissionsString to ManageWeb, and now the ‘View All Content’ link should only appear for Site Admins.

Make sure you use the .ms-bodyareaframe style in your Master Pages

So, I’ve just discovered something interesting. In SharePoint, some content should fill the whole of the content area of the master pages; others should have a margin. For example, viewing a document library fills the content section, but Wiki pages need a margin. This is achieved by the ms-bodyareaframe style in the master page, which supplies the padding for the content that is contains.

Ah, but how does the content that doesn’t need a margin get displayed? Well, it supplies an override to ms-bodyareaframe to set the padding to zero - and that is why you should make sure you use the ms-bodyareaframe style!

I found this when working off Heather Solomon’s Minimal Master pages, which don’t include this style.

Branding the SharePoint Treeview (spTreeview control)

I’ve gotta say, this part of the process has been pretty straight forward - but now I’ve got a bit of a problem - how do I change the icons in the treeview for the different types of list, etc? I mean, I can change the icons for the expand/collapse - as described here - but the orange folder icons don’t match my design. I’d like to specify others. I could also change the images themselves - but that would cause the change to be farm-wide, rather than just for my pages.

I’ve even tried using JavaScript running onLoad to match and replace the image sources - but as the TreeView control dynamically loads subnodes when it’s expanded, well, I’d have to hook into that event also, and replace any new images again. Not really practical.

All in all, those images seem to be just baked in.

Styling the ms-hovercellinactive style

So, I’ve had a interesting problem - I’ve been asked to style up a site which uses a very dark colour for the area behind the ‘global links’ at the top of the page. “No problem”, I thought, “I’ll just make the colour for the hyperlinks up there white”. Wrong! The styles which are applied to the Welcome control and the My Links menu are Shared with other page elements - such as on the publishing console. See below for what I mean - the areas sharing a the ms-splink and ms-hovercellinactive styles are bordered in red.

This posed a problem - some elements needed dark text, others light, and SharePoint gave them all the same style. Looking at the master page, I couldn’t see any way of directly applying my own style - they seem to be built into the delegate controls (though I must confess, I can’t see where). Anyway, I didn’t fancy the delegate controls.

After much head scratching, I realised my mistake - CSS always overrides with the latest applicable style. Thus, in the end all I needed to do was make sure that there was a style which only applied to the items in the ‘global links’ section, and that it came after the ‘normal’ ms-splink and ms-hovercellinactive styles.

Thus, I found that the following style did what I wanted:

/* Style to make the link menus for 'Welcome' and 'My Links' light coloured text */
.ms-globallinks .ms-SPLink a,
.ms-globallinks .ms-SPLink a:link,
.ms-globallinks .ms-SPLink a:visited,
.ms-globallinks .ms-SPLink a:active{
color:#ffffff;
}

Styling the Publishing Console in SharePoint

So, I’ve been asked to style up a SharePoint site, and I’ve come across a really stupid bit of code

The Publishing Console is the control for showing all the ‘edit page’, ‘check in’, ‘approve’, etc. functionality for publishing pages. You’ve gotta use it.

Complaint 1: It assumes that it’s going to be inside a table.

The control produces a table row - a <tr> . Hellooo? Anybody here of accessibility? Trying to avoid Tabled designs? Thanks guys, you’ve made that easy.

Complaint 2: Styling through JavaScript

So, the publishing control has these bits of padding at either end. Irritatingly, they’re hard to get rid of. They also position div tags below the table row that the console produces. This is shown on the right. So, what style contains the code for that? Um, none. That style is set in EditMenu.js, not in any style.

What bloody idiot decided to build such an inflexible, unstylable control, and did it in this way? There is no need for it to be done this way. I’ve now got to fight passed this, or write my own publishing console. Great. I’m happy with the out of box console, I just want to change it’s style a bit - creating a new control is excessive (though instructions are here).

Okay, slightly calmer edit - okay, yes, I can copy and change the Publishing Console itself - the file is straight forward enough - and hook it up as a delegate control. But I shouldn’t have to.

Success - I got rid of the end space. I realised that I could turn off display of the non-breaking spaces that hold the end padding open - and that annoying JavaScript doesn’t turn the visibility of the inner div tags back on!.ms-consoletitleareaframe, .ms-consoletitleareaframebottom
{
width:0px;
padding:0px;
margin: 0px;
background-color: #ffffff;
background-image: none;
display: none;
}

Error "You do not have access rights to this file"

I had an interesting problem over the weekend. I had been working on a VM several times last week. When I went to open it on Saturday, I got an error:

Could not open virtual machine: I:\MOSS003 - OCT07 Base\Windows Server 2003 Enterprise Edition.vmx.

You do not have access rights to this file

Naturally, it struck me that a) I’m admin on my own machine, so privileges seems unlikely, and b) it had worked fine on Thursday. As I: is a USB hard disc, I copied the VM to my local drive, but the problem persisted.

I made sure that permissions were the same for this VM and others - they were.

I tried upgrading VMWare from 6.0.1 to 6.0.2, just on the off-chance - the problem persisted.

I was trying to open the VM by double clicking on the .vmx file. I tried opening the VM through the ‘file open’ dialog too - that didn’t work either. In fact, that caused VMWare to crash.

In the end, one of my colleagues suggested removing all spaces in the VMX file name (based on a post in VMWare’s community forums ) - and that fixed it. If I put the spaces back into the VMX file name - errors again. The really weird thing is, though, that I have plenty of other virtual machines with spaces in the file name, and they seem to work just fine. Further, why did it work and then it start to raise errors when the file names hadn’t changed?

Sounds like a bug. Something isn’t right there.

Oh, I’m using VMWare workstation for Windows 6.0.2 on Vista.

I’ve posted this to the VMWare community site here, but I’m blogging it too, as you have to log in to get the the VMWare site, and I don’t know if Google will pick it up.

Auto-Cleanup of Workflows in MOSS

I just read an interesting blog post about how MOSS Workflows lose their association with their history after 60 days.

I guess it sort of agrees with my conclusion of MOSS workflow - that the auditing is awful. I mean, I get that ‘Workflow History’ items fits nicely with the SharePoint ‘item’ idea, but couldn’t we have a table for this? Or at least an implementation of Workflow Foundation that lets us plug-in our own tracking providers?

If I could get a week free, I’d write one and stick it on codeplex (for the glory).

Geo-Replication in MOSS with Syntergy

Last night was the SharePoint UK User Group meeting, and they had a number of vendors in to discuss their wares.

One that I’d not seen before, and set my toes tingling was about Geo-replication in MOSS, by Syntergy. They talked about a number of their products (and their Sharelink product - for integrating SharePoint and Livelink - was interesting), but the main part of the demo was Geo-replication. Basically, you can select (at a broad or narrow level) what you want to replicate, where you want to replicate to, what events you want to replicate, and it

Limitations of SharePoint Designer Workflows

A good article about the limitations of SharePoint Designer workflows…

SharePoint is not lightweight

Bob Mixon replied to a bit of a flame complaining about SharePoint. Most of Bob’s comments are right, and a lot of the replies (esp. by Mark ) are pretty accurate. So are some of the complaints too. So now, my thoughts… Read more »

Next Page »