www.dianthavanmarion.nl

Branding SharePoint

By Diantha van Marion

February 12th, 2009

Reset the styling of the rollover of the items:

.ms-topNavFlyOutsHover,
.ms-topNavFlyOutsHover a{
    background-color:red;
}

Reset the styling of background of the item arrow:

.ms-topNavFlyOuts td{   

    background-color:white;
}

Reset the styling of the background of the items:

.ms-topNavFlyOuts{
    background-color:white;
}
To reset the arrow of the menuitems with a second niveau of items, see heathers blog:
http://heathersolomon.com/blog/archive/2009/02/09/Modifying-the-second-level-navigation-arrow-image.aspx

So, all together:

.ms-topNavFlyOutsHover,
.ms-topNavFlyOutsHover a{
    background-color:red;
}

.ms-topNavFlyOutsHover a:link,
.ms-topNavFlyOutsHover a:visited,
.ms-topNavFlyOutsHover a:hover{
    color:white !important;
}

.ms-topNavFlyOuts a:link,
.ms-topNavFlyOuts a:visited{
    color:red;
}

.ms-topNavFlyOuts td,
.ms-topNavFlyOuts{
    background-color:white;
}

The border that comes around the whole flyout area still has a blue border. This is
set on the classname of the .zz1_TopNavigationMenu. Every flyout menu has it’s own
classname, but in that classname is a ID-number. You will never know which numbers
will be used, since you do not know how many menu items there are. For example:

.zz1_TopNavigationMenu_8 {Default.aspx (line 28)
    background-color:#F2F3F4;
    border:1px solid #A7B4CE;
}

But when you look closer, you see that beside this classname, every flyout area has
the same classname, that is zz1_TopNavigationMenu_0. So, styling the border of the
flyout menu, will be done by changing the border of this classname. Like this:

div.zz1_TopNavigationMenu_0{
    border:1px red solid;
}

Do check the flyout menu on a listpage, and double check if the list header is not
visible on top the the flyout menu. if so, check
this blog post
.

That’s all folks!

January 30th, 2009

What are the possibilities of snippets? Can you export them? Can you put them in a repository? The meaning of making snippets is to easy reuse some code, but you want others to be able to use your snippets to, right?

Snippets are stored in a particular folder. Snippets can be copied from this folder
and shared as you can share any other file. Snippets from other sources can be copied
to that folder.

More info on http://msdn.microsoft.com/en-us/library/xhc38ksb(VS.80).aspx.

If the snippet is changed, every developer needs to get an update of that. And that
isn’t as easy as pressing get latest. No, the one editor needs to make a new export
and distribute it to the developers. A conclusion is that snippets aren’t mend to
be changed after spreading them. I can imagine, but on the other hand, I can imagine
that you would like to. A walk around for this could be to put the snippets in vault.
They can be edited in there and if a developer needs a particular snippet, he can
get the latest version. The working folder of vault should be the folder the Code
Snippet Manager is pointing to.

Can snippets be changed after creating them? Code snippets can be edited after creating
them. Press ctrl and enter to open the snippets list in SharePoint Designer. Choose
customize list. In this list you can select one of the snippets and choose modify.
That easy.  Are you interested in the default Code Snippets (c#),

take a look here: http://msdn.microsoft.com/en-us/library/z41h7fat(VS.80).aspx

and find a list of the names of the default snippets and what they do.

There’s a Code Snippets Manager, in where you can manage the directory snippets are
stored in. You can also import snippets to that directory. More information on the
Code Snippet Manager:

http://msdn.microsoft.com/en-us/library/9ybhaktf(VS.80).aspx

and http://msdn.microsoft.com/en-us/library/wy5tazc9(VS.80).aspx.

Here’s more information on the security considerations of snippets: http://msdn.microsoft.com/en-us/library/7839bk64(VS.80).aspx.

Here’s another reference schema, for xml code snippets: http://msdn.microsoft.com/en-us/library/ms171418.aspx.

To use snippets in visual studio you need an add-in, so you can create a code snippet
using right mouse clicking.

More info on the export as code snippet add-in for Visual Studio 2008: http://www.codeplex.com/ExportAsCodeSnippet/Release/ProjectReleases.aspx?ReleaseId=11816

and how it works:

http://www.codeplex.com/ExportAsCodeSnippet.

January 29th, 2009

I tried to style the page layouts using the same HTML, and different styling, but had some trouble doing so. Therefore I created another piece of HTML for sketch B. I started my sketches and HTML with four-column-pages, and when the HTML and CSS looked fine I removed some of the columns. The page was build this way, so that removing one of the columns, the page will still look like it was supposed, even when there is more content in the columns.

So I tested the behavior of the columns by adding some lines of text into one of the
containers or columns. Previewing this in different browsers allows you to see what
will happen to the other containers and columns, when there is more content that somewhere
else. Does it wrap the line? Does it wrap it like a block, or does it shows the text
underneath the other columns?

    <div id=”Sketch_B”>

        Sketch B4

        <div id=”topcontainer”>header</div>

        <div id=”centercontainer”>

            <div class=”left
column”>B1</div>

            <div id=”centerrightcontainer”>

               
<div class=”secondleft column”>B2</div>

               
<div class=”secondright column”>B3</div>

               
<div class=”right column”>B4</div>

               
<div id=”bottomcontainer”>footer</div>

            </div>

            <div class=”clearboth”></div>

        </div>

    </div>

I removed some of the sketches I made, because I found them not as default as I thought
when making them. Basically, I came up with only two sketches, I posted before, that
should cover most of the page layouts. Of course the number of columns in these sketches
can vary; I still think that it’s the same sketch if they do. So much for the HTML
and CSS snippets for page layouts. I think this is a good foundation for expanding
the idea. Making more sketches of page layouts, and let them work as snippets.

January 28th, 2009

Ok, now you know how to make snippets from HTML and CSS. Next thing is making the HTML. And CSS. But before you can start with that you have to know what kind of page layouts are needed. I think it is nice to have some body else think with you on this  thing. When you know what page layouts are to be made, you can think of what the ideal HTML and CSS is, to make it like that. It has to be logical, valid and compatible with MOSS, because these page layouts are to be used for making MOSS sites, or custom portals of  SharePoint.

So a couple of the layouts will be like with a header, a one, two, three or four columns
container and a footer. But of course the footer could also be underneath one or more
of the columns, instead of at the bottom of it all. Another point is the width of
the columns. Is it fixed? Or is  it liquid? And what are the names of the containers?
Do they have class names or ID names? So, there are a lot of things to be  considered.

It is really hard to give a snippet a logical name. It is just a few words, that will
need to tell how this HTML will render a page layout. You need a guide for it. In
that guide there will be all the varieties of page layouts and there name with it.
This way, you can store as many snippets as you like, cause users can look up the
name of the snippets they would like to use.

First of all make some sketches and feel free to work out the first one in HTML. As
I was doing it, I saw that I proberbly could make some HTML that will fit on multiple
sketches, and as the stylesheet is different, the page will get an other layout. Here
is what it looks like:

<div
id=”Sketch_A”>

    <div id=”topcontainer”>header</div>

    <div id=”centercontainer”>

        <div class=”left column”>left</div>

        <div class=”secondleft column”>second
left</div>

        <div class=”secondright column”>second
right</div>

        <div class=”right column”>right</div>

        <div class=”clearboth”></div>

    </div>

    <div id=”bottomcontainer”>footer</div>

</div>
The div#sketch_A determines what CSS belongs to this layout. Of course the .columns will float, in this case to the left. I could give them a classname=”left” and give it a float:left in the stylesheet. But if I do so, it will not be possible to float that one different in an other layout. So it’s better to give the whole container an ID and style the elements that are in that particular ID. So, now let’s try styling the second sketch, using the same HTML (except for the #sketch_A, that one will become #Sketch_B.)

January 26th, 2009

IntelliSense Code Snippets are reusable, task-oriented blocks of code. They provide a way for you to insert ready-made snippets of code into your projects.

It’s really easy to create a snippet in SharePoint Designer. Just select the HTML
you would like to create a snippet from and press the right button, select create
code snippet. Here’s a video on how to do it. It is really easy to create reusable
HTML, but as I was thinking, it is only the HTML. When you use the snippets to create
a certain layout, you also will need the CSS that makes the layout look like it should.
So teh next step is to create some HTML which you will make a snippet from. Then,
create some styling, which will work with the HTML and see if that can also become
a snippet. If this works, a layout can be chosen by selecting the snippet of the HTML
and the snippet of the CSS. Let’s find out..

So I created some HTML and made it a snippet. And I created some CSS to go with the
HTML and also made it a snippet. Works the same. Ok, now I’ve got a new HTML file,
and want to add the first snippet I just created. How do you do that? Mm..

Then I suddenly remembered. Pres ctrl and enter, and then there comes a popup with
all the snippets available. Including the ones I just made. Now I could add my snippets
HTML and CSS. Works just fine. But, of course I would like the CSS to be pasted in
a extern file, the stylesheet. So I created a stylesheet and saved it as .CSS file.

Actually, I opened an exiting stylesheet and try to add the snippet in there. Works!
Great. So what I can do now is create some snippets with HTML and create some snippets
with CSS and give them almost similar names, so that you can easily find the snippets
that belong to each other.

I was hoping that it was possible to make a new folder for the snippets I am about
to make, but that seems not possible. So I have to think about what keywords I will
use for the snippets. They have to be recognizable for their function and they have
to fit to another snippet, cause a HTML snippets has a matching CSS snippets.

Okay, so much for that. Let’s focus on making the HTML and CSS now.

More info on snippets:
Visual Studio 2005 Code Snippets
Visual Studio 2005 includes code snippets covering tasks ranging. A set of Visual
Basic and Visual C# Code Snippets are included in the Visual Studio 2005 box.

Creating and Using IntelliSense Code Snippets IntelliSense Code Snippets provide a
way for you to insert ready-made snippets of code into your projects. This section
contains topics describing how to create, use and manage IntelliSense Code Snippets.

Code Snippets in Microsoft Office SharePoint Designer 2007

In this video you will learn how to create code snippets and use some basic functions
of the code view inside SharePoint Designer

December 18th, 2008

Once upon a time there was a td with id _invisibleIfEmpty.
This td seems to have a padding of 4 pixels, but no one seems to know how the padding got there.

There was no #_invisibleIfEmpty in any of the stylesheets, and there was no inline
padding defined. So how did the padding get there?

How this fairytale is going to end? Nobody knows.. 

September 10th, 2008

Do you want to style the topnavigation? Style the ms-topnav for the whole topmenu. And style the class ms-topnavselected for the selected tab of the menuitems.

Like this:

.ms-topnav {
    background-color:#70C8D4;
    background-image:none;
    border:0px none;
    color:#FFF;
}

.ms-topnavselected {
    background:#2B9AAE url(/_layout/images/ topnavselected.gif) repeat-x
fixed left bottom;
    border:0px none;
}

July 29th, 2008

You could have missed it hardly, the attention around Microsoft Expression. It also got my attention, so I decided to collect some information about it. Actually, I was deep impressed by what I saw. Microsoft Expression Studio looks like the tool for everything. For my hobby’s, work, you name it. Almost everything I used the Adobe packet for, but then in a bit more fancy design. It has tools for photo and vector design, html editors, audio, video, animation.. What I especially remembered was Expression Web, where they were speaking of nice tools to edit your css real-time, just in your browser. Interesting.. So I sat down and downloaded a few movies.

http://www.microsoft.com/expression/products/Overview.aspx?key=studio

I should have known only by the name, Expression Web. It’s for the web. Just web.
Web web. No portals. There isn’t a word said about how to use these tools for platforms
like SharePoint. And that was exactly the reason why I found Expression so interesting.
So, when I took a good look at the movie, I noticed Expression web had a lot in common
with SharePoint Designer. And that was also my answer. Of course, this tool is made
especially for working with SharePoint. I took a closer look and saw the same toolbars
and edit options. So, Expression isn’t that new than, is it? It just looks really
fancy and it’s presentation is even better. But the Expression tool I was looking
for, was made with other purposes that I wanted to use it for. And the tools I really
needed to do the job, were already installed on my computer. I just didn’t take a
good look at the menu’s and toolbars before. But no I that I did, I’m proud to use
SharePoint Designer, cause yes, it does have everything I need. Doesn’t it? Well..
maybe it doesn’t. Isn’t there really nothing missing?

I’m used to working with SharePoint Designer. I adapted to the tool. But is everything
in there? Does this piece of software cover it all? No, there’s always something.
First of all there is that fear to install SharePoint Designer on the client’s server.
Even if it’s temporarily. This means, you are stuck to notepad. No bad feeling about
notepad, but hey, I really really really miss the usability and features of SharePoint
Designer.

Take a look at the design mode, do I miss a piece of quality here? It doesn’t look
like how any browser would render it. Al those guidelines are making me dizzy. Actually,
I don’t use the design view, because I cannot handle it. If I do try it, I end up
repairing my code in the code view. So what’s about designview? Who uses it? Why is
it still there? I just use code view, and that works fine for me. Besides that, I
use different browsers windows to view the pages. And that’s the next thing I miss
in SharePoint Designer.

Wouldn’t it be nice if you don’t have to switch between the code and any browser anymore,
and press ctrl+f5 all the time? I do this about 200 times a day I guess. There must
be a way to make that easier, right? How about a preview display in SharePoint Designer,
that lets you toggle between different browsers and versions. Or even operating systems.
And of course some handy add-on’s where in there, like Firebug and Web developer toolbar.
When you use the inspect tool and point to some element, SharePoint Designer could
open the matching style sheet and other files and would jump to that piece of code
that is taking care of the element you just pointed to. Maybe even highlight it? Wow,
that would save me a lot of time!

So, I would say, Microsoft, stop pimping Microsoft Expression and focus on extending and perfecting SharePoint Designer!