使用jQuery更改SharePoint中的application.master页面 [英] Using jQuery to alter application.master pages in SharePoint

查看:109
本文介绍了使用jQuery更改SharePoint中的application.master页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们将MOSS 2007(SharePoint)用于我们的Intranet。最近,我们的任务是为我们农场的多家公司提供品牌支持。我们很快意识到应用程序页面(由修改后的application.master生成)无法提供多个品牌模板(主题除外)。

We use MOSS 2007 (SharePoint) for our intranet. Recently we were tasked with supporting the branding for multiple companies on our farm. We quickly realized that the application pages (produced by a modified application.master) can't serve up multiple branded templates (other than themes).

我认为正确的修复是保留应用程序页面上的默认Microsoft品牌(我们已经在dev中处理此问题 - 无需修改服务器上托管的文件)。

I think the right fix is to keep the default Microsoft branding on application pages (we were already working on this in dev - no modifications to files hosted on the server).

作为快速修复但是,我以为我可以使用jQuery替换应用程序页面上的一个徽标,少量导航图像和一些颜色。在页面完全呈现之前,基本上从品牌A到品牌B.

As a quick fix however, I was thinking that I might be able to use jQuery to replace one logo, a handful of nav images, and a few colors on the application pages. Basically going from Brand A to Brand B before the page is fully rendered.

我的问题是......这个想法有多糟糕?这样做有什么陷阱?鉴于它只是一个临时解决方案,我应该尝试一下吗?

My question is... how bad is this idea? What are the pitfalls associated with doing this? Given that it is only an interim solution, should I try it?

推荐答案

我认为你的大部分问题都可以解决好的CSS文件。根据我的经验,这比javascript更好,因为它加载速度更快。请记住,SharePoint会生成大量页面(明智的DOM),因此jQuery需要很长时间才能达到 $(document).ready ,甚至更长的时间来操作它大小的DOM - 在IE6上这可能需要几秒钟,给人的印象与慢速站点或服务器相同。

我使用CSS对SharePoint进行了很多自定义:可能需要一些臭!important s,但结果优于javascript。

此外,请记住,您可以设置每个站点的CSS文件(在您设置的同一页面上)子网站的母版页 - 这可以用来代替为每个品牌实际创建母版页。

I think most of your problems can be solved with a good CSS file. This is better than javascript, in my experience, since it loads a lot faster. Keep in mind that SharePoint produces heavy pages (DOM wise), so jQuery takes a long time to get to $(document).ready, and even longer time to manipulate that over-sized DOM - on IE6 this can take several seconds, giving the same impression as a slow site or server.
I've done many customization to SharePoint using CSS: It may take a few smelly !importants, but the result is better than javascript.
Also, remember that you can set a per-site CSS file (on the same page you set the sub-site's master page) - this can be used instead of actually creating a master page for every brand.

这篇关于使用jQuery更改SharePoint中的application.master页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆