Solved

Why won't the attached code run  when I add to the HTML source code on our Sharepoint 2010 Foundation Site?

Posted on 2011-09-30
9
244 Views
Last Modified: 2012-05-12
Several months ago I added the attached code to the HTML source code in the Content Web part to hide the Recycle Bin and All Site Content in the left column of one the pages on our Sharepoint 2010 Foundation Site.
Worked fine. Now when I do this I get a message that the HTML code may have been modified and it won't run. I probably forgot a step. Any suggestions? Thanks
/*--Hide Quick Launch --*/
#s4-leftpanel{
display:none
}
.s4-ca{
margin-left:0px
}

Open in new window

0
Comment
Question by:PDSWSS
  • 6
  • 3
9 Comments
 
LVL 16

Accepted Solution

by:
jessc7 earned 500 total points
ID: 36895128
Try this:
<style type="text/css">
/*--Hide Quick Launch --*/
#s4-leftpanel{
display:none
}
.s4-ca{
margin-left:0px
}
</style>

Open in new window

0
 

Author Comment

by:PDSWSS
ID: 36895157
Thanks. Get the same code modified message.

Is this the correct process?

I choose Edit the Page
Add the Content Web Part to the Page and then choose HTML source and add the
code to the end of that file.

Then I get the code appears to be modified message. Is this a permissions issue?
0
 
LVL 16

Expert Comment

by:jessc7
ID: 36895161
The code appears to be modified message is displayed almost every time a Content Editor web part is displayed. At least that is my exprience. I don't know if it is just reformatting white space some times or what.
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 16

Expert Comment

by:jessc7
ID: 36895162
Sorry - I meant every time a Content Editor web part is saved/modified.
0
 
LVL 16

Expert Comment

by:jessc7
ID: 36895172
Interesting. Just tried it on my test VM, and I see what you mean. The source gets modified.
0
 
LVL 16

Assisted Solution

by:jessc7
jessc7 earned 500 total points
ID: 36895192
I just went through the steps again, and was able to do it. I think SharePoint gets confused with whether the HTML is being added to a Content Editor web part or the Wiki Page area. Apparently SharePoint will modify the CSS in the Wiki Page area, so I took explicit steps to make sure I was editing the Content Editor web part.

http://screencast.com/t/5tGdzuGdJ
0
 

Author Comment

by:PDSWSS
ID: 36895281
Great job and that video give you an A+. Thanks
0
 

Author Closing Comment

by:PDSWSS
ID: 36895286
With the Video = A+. Thanks again
0
 
LVL 16

Expert Comment

by:jessc7
ID: 36895287
Thanks. :)
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Addition to SQL for dynamic fields 6 47
SQL Help 27 57
sql how to count case when 4 25
Reformat SQL - so SSRS can read the columns 25 8
The vision: A MegaMenu for a SharePoint portal home page The mission: Make it easy to maintain. Allow rich content and sub headers as well as standard links. Factor in frequent changes without involving developers or a lengthy Dev/Test/Prod rel…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question