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
241 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
 
LVL 16

Expert Comment

by:jessc7
ID: 36895162
Sorry - I meant every time a Content Editor web part is saved/modified.
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

SharePoint Designer 2010 has tools and commands to do everything that can be done with web parts in the browser, and then some – except uploading a web part straight into a page that is edited in SPD. So, can it be done? Scenario For a recent pr…
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

912 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now