locked
Adding the Content Editor Web Part to a SharePoint Layout .aspx page RRS feed

  • Question

  • Hi,

    we've created a layout page that contains the Rich Text Editor web part. But the client requires a web part that allows the embedding of audio/video files. The Rich Text Editor strips out the objects when we try to embed them.

    I've used the Content Editor Web Part to add audio and video files (by manually adding the web part to the page), but I can't find the definition for that web part to include it in the layout page so that the client doesn't need to manually add the web part themselves to every page that requires it. (Which could be many pages.)

    Any help would be appreciated.

     

     

    Wednesday, April 6, 2011 10:53 PM

All replies

  • http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/3afc6422-7402-4d34-9682-89fa69586813/
    Navdeep Madan
    Thursday, April 7, 2011 7:27 AM
  • No you need to create custom layout page, which when end user, creates a page, they can use your custom layout page which you already defined in it the needed webparts, so it will be existing by default when they create page from it.

    Hope that helps.


    Mai Omar | Senior Solutions Developer | ITEgyptCorp | MCP, MCTS, MCPD, MCITP & MCT Microsoft Certified Trainer | Email: mai_omar_86@live.com | Blog: http://maiomar.itegyptcorp.com
    Thursday, April 7, 2011 11:42 AM
  • Navdeep, that link is for a code solution. That's not what I need.

    Mai, we already have a custom layout that includes the RichHtnlField.:

    <PublishingWebControls:RichHtmlField id="PageContent" FieldName="PublishingPageContent" runat="server"/>

    What I'm trying to find is the id to use to include the Content Editor instead of the Rich HTML Editor. I expected it to be somthing like: PublishingWebControls:ContentEditorField.

    But I can't find anything similar to that.

    Kevin

    Thursday, April 7, 2011 7:00 PM
  • I've recently got the same issue. Wanted to add a content editor webpart to a custom page layout.

    I've found my solution here: http://www.sharepointdev.net/sharepoint--design-customization/embedding-a-content-editor-web-part-12176.shtml

    The problem that the user has didn't occured with me. So maybe this is also working with you.

    Just added this code between the <Zonetemplate> tags.

    <!-- CEWP -->
    
    <WebPartPages:ContentEditorWebPart ID="ContentEditorWebPart1" runat="server" __MarkupType="xmlmarkup" WebPart="true" __WebPartId="{F40E10C3-ED3A-473D-8538-996344EE795C}" >
    
    <WebPart xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/WebPart/v2">
    
    <Title>Content Editor Web Part</Title>
    
    <FrameType>TitleBarOnly</FrameType>
    
    <Description>Use for formatted text, tables, and images.</Description>
    
    <IsIncluded>true</IsIncluded>
    
    <PartOrder>2</PartOrder>
    
    <FrameState>Normal</FrameState>
    
    <Height />
    
    <Width />
    
    <AllowRemove>true</AllowRemove>
    
    <AllowZoneChange>true</AllowZoneChange>
    
    <AllowMinimize>true</AllowMinimize>
    
    <AllowConnect>true</AllowConnect>
    
    <AllowEdit>true</AllowEdit>
    
    <AllowHide>true</AllowHide>
    
    <IsVisible>true</IsVisible>
    
    <DetailLink />
    
    <HelpLink />
    
    <HelpMode>Modeless</HelpMode>
    
    <Dir>Default</Dir>
    
    <PartImageSmall />
    
    <MissingAssembly>Cannot import this Web Part.</MissingAssembly>
    
    <PartImageLarge>/_layouts/images/mscontl.gif</PartImageLarge>
    
    <IsIncludedFilter />
    
    <ExportControlledProperties>true</ExportControlledProperties>
    
    <ConnectionID>00000000-0000-0000-0000-000000000000</ConnectionID>
    
    <ID>g_f40e10c3_ed3a_473d_8538_996344ee795c</ID>
    
    <ContentLink xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor" />
    
    <Content xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor"><![CDATA[Edit this text.]]></Content>
    
    <PartStorage xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor" />
    
    </WebPart>
    
    </WebPartPages:ContentEditorWebPart>
    

    I hope this is what you are looking for?

     

    Greetings,

    Jan

    Tuesday, May 10, 2011 8:27 AM
  • This may be a bit of a "duh" comment, but still want to ask what may be the obvious since it wasn't mentioned yet...

    My understanding is you are trying to add the content editor web part to a custom page layout.

    If that is correct, are you using SharePoint Designer?

    If yes, open the page layout, click where where you want the web part to be and go to Insert>SharePoint Controls>Web Part. This will open the Web Part window pane on the right in SharePoint Designer. Locate the CEWP and click Insert Web Part. If when you go to SharePoint Controls and the "Web Part" link is disabled, you may have to save the page first then try again.

    Let me know if I am misunderstanding there.

    • Proposed as answer by AymKdn Tuesday, September 30, 2014 1:53 PM
    Tuesday, May 10, 2011 1:59 PM