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
247 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

 
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

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Server Express or Standard? 5 64
Delete old Sharepoint backups 2 55
I am new to using JSON in SQL Server 2 59
SQL 2008 - Disappearing Temp Table in Stored Procedure 24 64
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
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...

752 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