Calling out Custom CSS on a page

Posted February 1, 2012 By Kevin Bennett

In Customizing Sharepoint I needed to call some custom CSS. In this case I needed to put a banner across the top and a custom logo.

The easiest way I found to do this is to create some CSS for the banner which would be

[code]

.s4-title {
    background: url(‘Style Library/Custom Images/New_bgrnd.png’) no-repeat scroll right top;
    margin: 0;
    }

[/code]

 

But aside from adding this to a new Content Editor Webpart (which I did for testing) on each page I wanted to call it from a custom CSS file. To accomplish this I added the following to a copy of v4.master (because we are that lame and still use v4 out of the box). I put this in the Header Section of New_v4.master

[code]

<SharePoint:CssRegistration name=”/Style Library/Custom CSS/New_Custom.css” After=”corev4.css” runat=”server”/>

[/code]

Of course I had to create the new Folder under style library called Custom CSS (this is also what I did with the images by creating a custom images folder).

Save, checkin and publish all.

Next change your Master page to New_v4.Master in Site Settings –> Master Page to the New_v4.master

Be the first to comment
    

Shout out

Posted January 30, 2012 By Kevin Bennett

So instead of writing a post this week, because I am lazy and have a ton of tasks to complete I wanted to get something up.

So here is a site I have been relying on for some of my research and jQuery goodness.

Please check him out and share the love

 

http://www.sharepointhillbilly.com/default.aspx

 

 

Be the first to comment
    

Hiding elements on a page

Posted January 15, 2012 By Kevin Bennett

The other day I had a user ask about removing the (More Links) wording from a Link List Web Part. Basically she had but the view into Summary View and with the number of items that appears it also states at the bottom to click to see more links. But all her links were showing up so she just wanted that removed.

Being my normal helpful self I seen no reason to argue that it didn’t matter if it was on the page or not and searched for a quick script to accomplish this.

 

The code is as follows

[code]

<script>

document.getElementById(“onetidMoreAnn”).innerHTML=””

</script>

[/code] 

I then called the code from a Content Editor Webpart and the More Links Disappeared.

I got the onetidMoreAnn by using the Developer Dashboard in IE and finding that links ID in attributes. I imagine you can do this for any element on a page.

Simple and I still look like a hero.

Be the first to comment
    

New Site

Posted January 13, 2012 By Kevin Bennett

So this is my new blog, I plan on using this to post crap about sharepoint and the headaches (solutions) I find in my daily workings to run, fix, or improve it. I am in no way a Sharepoint Expert, I am just a .33 FTE Admin for a site and company.

I will do my best to be correct and use proper terminology, but feel free to leave CONSTRUCTIVE Criticisim as you see fit.

Mainly I am tired of having to look up fixes or hacks over and over and over again because I don’t log them down in a place I can get to after I leave the job. This does make me better at googling but takes time out of my other .66 FTE time

Be the first to comment