Welcome to Office Zealot Sign in | Join | Help

Placing a Copyright Footer on Every Portal Page

Here is a great tip for placing a standard footer at the bottom of every portal page.  It is a simple and low maintenance solution for creating a copyright identifier or additional navigation.  I like it because you maintain the text in one place and changes (like a new year or new link) can be propogated easily.

1. Create myfooter.htc containing the html below (replace the '< ' with '<').  Save it to the same directory where SPS.CSS resides (/_layouts/1033/styles).  You can alter the contents of your footer by changing the html in the string variable.

< PUBLIC:COMPONENT>
< PUBLIC:ATTACH EVENT="onload" FOR="window" ONEVENT="DoFooter()" />
< SCRIPT language="jscript">
function DoFooter()
{
var innerStr="< div class=myfooter align=center>© Cardarelli Consulting.  All Rights Reserved.< /div>";
this.insertAdjacentHTML('beforeEnd', innerStr);
}
< /SCRIPT>
< /PUBLIC:COMPONENT>

2. Edit the SPS.CSS file to include the following (this will push your footer to all portal pages).  You can edit the visual appearance of your footer by altering the myfooter attributes:

body
{
 behavior:url("/_layouts/1033/styles/myfooter.htc");
}
.myfooter{
font-family:Verdanas,Arial,Helvetica,sans-serif;
font-size:12pt;
color:white;
background-color:blue;
background-repeat:repeat-x;
background-position-y:bottom;
padding:3px;
}

3. Repeat step #2 for OWS.CSS to push the footer to WSS sites.

Published Thursday, August 11, 2005 10:18 AM by Mauro

Comments

Monday, September 19, 2005 2:54 PM by Anonymous

# re: Placing a Copyright Footer on Every Portal Page

This is a nice solution for putting a footer on the bottom of every Sharepoint page...........but is there a way to place the footer so that you don't have to scroll down to see it?
Monday, December 12, 2005 7:48 AM by Anonymous

# re: Placing a Copyright Footer on Every Portal Page

If you want to put the footer inside the main table, first of all you have to locate inside the main table of the Sharepoint Portal page with the .CSS stylesheet doing that:

body table {
behavior:url(/_layouts/1033/styles/myfooter.htc);
}

body table table {
behavior:url('');
}

Next, you'll have to add a row in that table with the footer, so you will write that in the HTC:

<PUBLIC:COMPONENT>
<PUBLIC:ATTACH EVENT="onload" FOR="window" ONEVENT="DoFooter()" />
<SCRIPT LANGUAGE="JScript">
function DoFooter()
{

var innerStr = "<table class=myfooter cellpadding=0 cellspacing=0><tr>";

innerStr = innerStr + "<TR><td>Cardarelli Consulting. All Rights Reserved</td>";
innerStr = innerStr + "</tr></table>";

var tbl = this;
var lastRow = tbl.rows.length;
var iteration = lastRow;
var row = tbl.insertRow(lastRow);

var cellLeft = row.insertCell(0);
cellLeft.colSpan = 4;
var textNode = document.createTextNode(innerStr);
cellLeft.innerHTML = innerStr;

}
</SCRIPT>
</PUBLIC:COMPONENT>


it works! :)



Wednesday, February 15, 2006 8:52 AM by Anonymous

# Columns

How can I filter two columns?. For example:
STATE (column A)
CITY (column B)
when I selected the column A (STATE), the column B (CITY) must show only the cities of that state.

I am new with SharePoint, please how can I resolv this problem?

# Iona Mimi &raquo; Blog Archive &raquo; MAURO - Buona Sera-Ciao Ciao

Monday, April 13, 2009 1:52 PM by Inkog

# re: Placing a Copyright Footer on Every Portal Page

Thanks for the sample code to place the footer inside the main table. The code worked great, but I found that it would put the footer on ALL pages, including modal pages, like a calendar popup and the webpart editors. I got around this by checking that the table's class was "ms-main" before writing the footer.

function DoFooter()

{

  if(this.className == "ms-main")

  {

     var tbl = this;

...

I hope this helps someone,

Cheers,

Tuesday, November 24, 2009 11:00 AM by pslager

# re: Placing a Copyright Footer on Every Portal Page

I am unable to get this to work at all.  

I am using SharePoint Portal Server 2007 Enterprise.  I created the HTC file exactly how it is.  Then I edited the Portal.css file which is supposed to be the equivalent of the SPS.css file in SharePoint 2003.  

This is the directory where the CSS file and HTC file edits are:

C:\Program Files\Common Files\microsoft shared\Web Server Extensions\12\TEMPLATE\LAYOUTS\1033\STYLES

When I edited the Portal.css file i copied the body contents and added themt to the top, when I was finished I performed an IIS reset.  I am not a programmer but adding a footer seems way to difficult should be easier than this.  

Anonymous comments are disabled