Go Premium for a chance to win a PS4. Enter to Win

x
?
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
Medium Priority
?
253 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 2000 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 2000 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

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…
A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

916 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