2

I am trying to override a class that is used in the following file:

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\XLViewer.aspx

Unfortunately this file does not inherit from the masterpage and I cannot use my existing custom css file to add the new style.

I would like to avoid modifying the out of the box sharepoint files if possible which eliminates adding the style directly to the aspx file or changing the style in the original css file.

Are there any other ways to do something like this?

  • Not that I'm aware of. I would be happy to be proven wrong though. – Aboba Jun 25 '14 at 19:44
1

You can use the following PowerShell script to register your custom CSS file. It will run regardless of the master page used:

$web = Get-SPWeb http://myserver/mysite
$web.AlternateCssUrl = "/Style Library/MyStyles.css"
$web.Update()

Just tested it on my SharePoint 2010 Server virtual test machine and it works like a champ, even with the Excel Web Access "xlviewer.aspx" page.

0

Any manual changes to out of the box files in 12/14/15 folders are NOT recommended and will be reverted, in case of upgrades and patches.

  • If you really want to change the default classes SharePoint adds to the pages, use jQuery to get over it :)
  • I'm not a design guru but sometimes!important attribute can be of great help. Go figure :)
  • I understand that which is why I asked this question, although I am not sure how I would use jquery in this situation without modifying these files either. – BlueBird Jun 27 '14 at 12:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.