English 中文(简体)
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.

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 FilesCommon FilesMicrosoft Sharedweb server extensions12TEMPLATELAYOUTS1033htmleditor.js

and the actual rich text editor itself at

C:Program FilesCommon FilesMicrosoft Sharedweb server extensions12TEMPLATELAYOUTSRTE2PUEditor.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?

最佳回答

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.

问题回答

暂无回答




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

Drop down background url in Safari Issue

selectBox.selectCSS { background: url(/Images/replacementSelectBackground.png) top left no-repeat height:auto; } I have an issue in Safari only where the image is not rendering on top ...

CSS specific for Safari

How do you target specifically safari in css with styles?

Aligning textarea in a form

Ive used the following css code to align my form elements: form { position:relative; } form input { position:absolute; left:11em; } However, the textarea element is not aligned correctly with the ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

CSS problem with page footer

I have defined my page footer in the css file as: #footer { position: absolute; height: 50px; text-align: center; background: #66CCCC; bottom: 0px; left: 0px; width: 100%; height: ...

热门标签