SharePoint 2007 弹出富文本编辑器显示母版页中的公司徽标 - 如何删除它?

发布于 2024-08-25 05:00:25 字数 3094 浏览 2 评论 0原文

目前,我在尝试在 MOSS 2007 站点定义中设置 HTML 富文本编辑器样式时遇到问题。

我在正文标记的自定义母版页上指定了内联公司徽标,如下所示:

<%@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>

...

当作为功能部署时,此母版页适用于我们所有标准的开箱即用页面和网站 - 徽标出现在左上角(并且代码还使用单独定义的样式表应用颜色方案)。

然而,当我们尝试使用 CEWP 修改一段内容时,富文本编辑器也会在左上角显示此徽标,部分遮挡了用户需要编辑的文本。

我尝试修改母版页中的样式以隐藏此徽标,但找不到方法来执行此操作。我还考虑修改

C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033\htmleditor.js

和实际的富文本编辑器本身

< strong>C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\RTE2PUEditor.aspx

但这并没有带来任何成功(而且我真的宁愿不这样做! !)。

有人能指出我正确的方向吗?

我希望将自定义品牌(徽标、CSS 等)应用于所有页面,但应用于弹出的富文本编辑器。这可能吗?如果是这样,怎么办?

I am currently having problems with attempting to style the HTML rich text editor in our MOSS 2007 site definition.

I have specified a corporate logo inline on a custom master page in the body tag as follows:

<%@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.

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

and the actual rich text editor itself at

C:\Program Files\Common Files\Microsoft Shared\web server extensions\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. Is this possible? If so, how?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

哎呦我呸! 2024-09-01 05:00:25

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];
        }
    }
}

然后将这些值传递并应用到模式对话框 RTE2PUEditor.aspx。看起来最快的解决方法是使用表单而不是正文标记:

form#aspnetForm
{
    background-image:url(/_layouts/images/corp/corpLogo.gif);
    background-repeat:no-repeat;
}

RTE2PUEditor.aspx 上表单的 ID 是 RTE2PUEditorForm,而大多数其他页面(尤其是使用母版页的页面)使用 aspnetForm。

也就是说,您可能想考虑设置网站徽标而不是使用 CSS。您可以通过转到“站点设置”>“手动设置徽标”标题、描述和图标 >徽标 URL 和说明以及更改 URL。或者您可以使用 SPWeb.SiteLogoUrl 通过代码进行设置 属性。请注意,这需要 SiteLogoImage 控件存在于您的自定义母版页上。

The RTE2_GenerateLaunchArguments method in HtmlEditor.js copys all of the stylesheets and styles on the page:

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. It looks like the quickest work around is to use the form instead of the body tag:

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.

That said, you might want to look into setting the site logo instead of using CSS. You can set the logo manually by going to Site Settings > Title, Description, and Icon > Logo URL and Description and changing the URL. Or you can set it through code using the SPWeb.SiteLogoUrl property. Note, this requires that the SiteLogoImage control is present on your custom master page.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文