[英]SharePoint 2007 popup rich text editor displays corporate logo from master page - how can I remove this?
I am currently having problems with attempting to style the HTML rich text editor in our MOSS 2007 site definition. 我目前在尝试在MOSS 2007网站定义中设置HTML RTF编辑器样式时遇到问题。
I have specified a corporate logo inline on a custom master page in the body tag as follows: 我在body标签的自定义母版页上内联指定了公司徽标,如下所示:
<%@Master language="C#"%>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="wssuc" TagName="Welcome" src="~/_controltemplates/Welcome.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="DesignModeConsole" src="~/_controltemplates/DesignModeConsole.ascx" %>
<HTML id="HTML1" dir="<%$Resources:wss,multipages_direction_dir_value%>" runat="server" xmlns:o="urn:schemas-microsoft-com:office:office">
<HEAD id="HEAD1" runat="server">
<META Name="GENERATOR" Content="Microsoft SharePoint">
<META Name="progid" Content="SharePoint.WebPartPage.Document">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<META HTTP-EQUIV="Expires" content="0">
<SharePoint:RobotsMetaTag ID="RobotsMetaTag1" runat="server"/>
<Title ID=onetidTitle><asp:ContentPlaceHolder id=PlaceHolderPageTitle runat="server"/></Title>
<SharePoint:CssLink ID="CssLink1" runat="server"/>
<SharePoint:Theme ID="Theme1" runat="server"/>
<SharePoint:ScriptLink ID="ScriptLink1" language="javascript" name="core.js" Defer="true" runat="server" />
<SharePoint:CustomJSUrl ID="CustomJSUrl1" runat="server" />
<SharePoint:SoapDiscoveryLink ID="SoapDiscoveryLink1" runat="server" />
<asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead" runat="server"/>
<SharePoint:DelegateControl ID="DelegateControl1" runat="server" ControlId="AdditionalPageHead" AllowMultipleControls="true"/>
<style>
body
{
background-image:url(/_layouts/images/corp/corpLogo.gif);
background-repeat:no-repeat;
}
</style>
</HEAD>
... ...
When deployed as a feature, this master page works fine for all of our standard out of the box pages and sites - the logo appears in the top left hand corner (and the code also applies a colour scheme using a separately-defined style sheet). 当作为功能部件部署时,该母版页可以很好地用于我们所有标准的即装即用页面和站点-徽标出现在左上角(并且代码还使用单独定义的样式表应用了配色方案) 。
However, when we try to modify a piece of content using a CEWP, the rich text editor also displays this logo in the top left corner, partially obscuring the text the user needs to edit. 但是,当我们尝试使用CEWP修改内容时,富文本编辑器也会在左上角显示此徽标,从而部分遮盖了用户需要编辑的文本。
I have tried to amend the style in the master page to hide this logo but cannot find a way to do this. 我试图修改母版页中的样式以隐藏此徽标,但找不到解决方法。 I have also looked into amending the
我也考虑过修改
C:\\Program Files\\Common Files\\Microsoft Shared\\web server extensions\\12\\TEMPLATE\\LAYOUTS\\1033\\htmleditor.js C:\\ Program Files \\ Common Files \\ Microsoft共享\\ Web服务器扩展\\ 12 \\ TEMPLATE \\ LAYOUTS \\ 1033 \\ htmleditor.js
and the actual rich text editor itself at 以及实际的RTF编辑器本身位于
C:\\Program Files\\Common Files\\Microsoft Shared\\web server extensions\\12\\TEMPLATE\\LAYOUTS\\RTE2PUEditor.aspx C:\\ Program Files \\ Common Files \\ Microsoft共享\\ Web服务器扩展\\ 12 \\ TEMPLATE \\ LAYOUTS \\ RTE2PUEditor.aspx
but this has not led to any success (and I would really rather not do this anyway!!). 但这并没有带来任何成功(我还是宁愿不这样做!)。
Can someone point me in the right direction? 有人可以指出我正确的方向吗?
I would like a custom branding (logo, css etc.) applying to all pages, but not to the pop up rich text editor. 我想将自定义商标(徽标,css等)应用于所有页面,但不应用于弹出的RTF编辑器。 Is this possible?
这可能吗? If so, how?
如果是这样,怎么样?
The RTE2_GenerateLaunchArguments method in HtmlEditor.js copys all of the stylesheets and styles on the page: HtmlEditor.js中的RTE2_GenerateLaunchArguments方法复制页面上的所有样式表和样式:
var styleRules=new Array();
var styleRulesUrl=new Array();
for (var i=0; i<document.styleSheets.length; i++)
{
var styleSheet_href=document.styleSheets[i].href;
if (styleSheet_href !="")
{
styleRulesUrl[styleRulesUrl.length]=styleSheet_href;
}
else
{
var rules=document.styleSheets[i].rules;
for (var j=0; j<rules.length; j++)
{
styleRules[styleRules.length]=rules[j];
}
}
}
These values are then passed and applied to the modal dialog RTE2PUEditor.aspx. 然后,将这些值传递并应用于模态对话框RTE2PUEditor.aspx。 It looks like the quickest work around is to use the form instead of the body tag:
看起来最快的解决方法是使用表单而不是body标签:
form#aspnetForm
{
background-image:url(/_layouts/images/corp/corpLogo.gif);
background-repeat:no-repeat;
}
The ID of the form on RTE2PUEditor.aspx is RTE2PUEditorForm, while most of the other pages (especially those using your master page) use aspnetForm. RTE2PUEditor.aspx上表单的ID为RTE2PUEditorForm,而其他大多数页面(尤其是使用母版页的页面)都使用aspnetForm。
That said, you might want to look into setting the site logo instead of using CSS. 就是说,您可能要考虑设置站点徽标,而不是使用CSS。 You can set the logo manually by going to Site Settings > Title, Description, and Icon > Logo URL and Description and changing the URL.
您可以通过以下步骤手动设置徽标:转到“网站设置”>“标题,描述和图标”>“徽标URL和描述”并更改URL。 Or you can set it through code using the SPWeb.SiteLogoUrl property.
或者,您可以使用SPWeb.SiteLogoUrl属性通过代码进行设置。 Note, this requires that the SiteLogoImage control is present on your custom master page.
请注意,这要求您的自定义母版页上存在SiteLogoImage控件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.