Click here to Skip to main content
Click here to Skip to main content

MCMS Placeholder Content Web Part

By , 22 Jan 2005
 

Introduction

This web part displays content from a Content Management Server (MCMS) page placeholder in a Windows SharePoint Services (WSS) site or a SharePoint Portal Server (SPS) site. No actual placeholder content is stored in the web part. If the placeholder is updated with new content in the MCMS site, the web part will automatically show the new content in the WSS site.

Background

There are several ways to pull content from MCMS in a WSS site. Off the shelf so to speak, Microsoft provides the free MCMS Connector for SharePoint Technologies. It comes with a MCMS Page Listing web part that displays a summary list of pages in a particular channel. If your requirements are anything more complicated than that, you will need to write your own custom code.

The simplest approach is to use the Page Viewer web part. It displays any web page content in an IFrame. With the entire web page loaded with its own navigation and everything, it does not provide users an UI experience that the content is part of your WSS site.

If the MCMS site is located in the same box as your WSS site, code your heart out with MCMS API in your web part. As this is the exception rather than the norm in a production environment, you may need to resort to Web Service or custom IFrame development to display just the placeholder content, not the entire MCMS page.

MCMS Web Service is indeed a very good approach though you may run into some authentication issues with a web part calling the web service. Windows Integrated Authentication will not work for the web service as far as I know. If you have a SPS site, I would use SPS' Single Sign-On (SSO) service to authenticate.

Using the IFrame route, this web part calls a custom MCMS page which renders the content of a specific placeholder of your choice into an IFrame. The IFrame automatically adjusts its height based on the length of the content so that no scroll bars will show.

Installation

  1. Web Part

    On the WSS server, run SharePoint Services administration tool Stsadm.exe to install package MCMSWebPartsPackage.cab. Alternatively, you can rebuild the package using the source files included. To install the package, run the following command:

    Stsadm.exe -o addwppack -filename c:\MCMSWebPartsPackage.cab

    Modify web.config to mark the web part as safe:

    <SafeControls>
        .....
        <SafeControl Assembly= "QuestechSystems.MCMSWebParts, 
            Version=1.0.0.0, Culture=neutral, 
            PublicKeyToken=a877c88baf21ba83" 
            Namespace="QuestechSystems.MCMSWebParts" TypeName="*" />
    </SafeControls>

    The "MCMS Placeholder Content" web part should now appear in the Virtual Server Web Part Gallery.

  2. MCMS WssIntegration

    On the MCMS server, copy directory WssIntegration to the root of your MCMS site. Open Visual Studio. Include directory in your MCMS project. Rebuild project.

Usage

The "MCMS Placeholder Content" comes with its own custom tool pane with the following properties:

  1. MCMS Site URL - URL to your MCMS site. For example http://woodgrovenet, http://server/woodgrovenet. The server can be a remote server obviously.
  2. Page - This is the posting display path. It will be automatically populated after you select a placeholder using the Select Placeholder dialog.
  3. Placeholder - This is the name of the placeholder. It will be automatically populated after you select a Placeholder using the Select Placeholder dialog.
  4. Select Page & Placeholder - Clicking this button will open a Select Placeholder dialog. This dialog allows you to select a Posting and the Placeholder in it that you want to render the content.

You may also want to change the web part title in the Appearance section to fit the placeholder you selected.

Remarks

  1. The web part stores the posting path, posting GUID and placeholder name. It uses the posting GUID and placeholder name to retrieve the placeholder content. If the posting is moved to another channel, the web part will still be able to locate the moved posting and renders the placeholder content. However, the posting path displayed in the custom toolpane will not be correct.
  2. The web part renders the raw content of a placeholder. Placeholders like XmlPlaceholder will not be rendered properly.
  3. The web part will render the unpublished view of the placeholder when you are editing or designing a WSS page.
  4. If you only have one MCMS site to pull content from, you can modify GetSiteUrlDefaultValue() in RenderMCMSPlaceholderTool.cs to always display the specific MCMS Site URL.
  5. All hyperlinks in the rendered placeholder content will open up in the main page, not inside the IFrame.
  6. Scroll bars in the IFrame may appear in non-IE Windows browsers. I only tested it in Windows IE.
  7. If the placeholder content uses custom CSS styles, it will not be rendered in the web part like it does in the MCMS site. In the web.config file of your MCMS site, add the appSettings key SiteCssHrefForWss with the HREF of your site stylesheet. For example, if the MCMS site is the WoodgroveNet site:
    <add key="QuestechSystems.SiteCssHrefForWss" 
                value="/WoodgroveNet/Style/styles.css" />

History

  • V1.0 - 2004.12.11 - Base.
  • V1.1 - 2005.01.15 - Resolved cross-site security problems when CMS and WSS sites are on different servers.
  • V1.2 - 2005.01.22 - Added option to insert stylesheet reference when rendering placeholder content (see remark 7 above).

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Stephen Huen
Web Developer Questech Systems
Canada Canada
Member
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
QuestionI can't find the project?membersarama30 Mar '08 - 18:36 
"""Open Visual Studio. Include directory in your MCMS project. Rebuild project."""
 
Where is the project that I should open it in Visual Stodio??
 
I am going to use it throuth sharepoint site, I already added the webpart but about second part,
I think I missed something maybe very simple...
 
Which projest is the one I should open and rebuild??
 
Thanks,
GeneralHelp Needed | SharePoint Web part and MCMSmemberDavendra19 May '06 - 2:47 
Hi All,
 

 
We have a web part control on SharePoint site. The data in this web part is fetched from an HTMLPlaceHolderControl on a page in MCMS site. The problem is that the height of this web part remains fixed. What we need is that the height of this web part should depend on the data coming from MCMS. Has anyone implemented this kind of behavior for web part? Any kind of pointer/link/code snippet in this regard will be of great HELP.
 

 
The web part we are using is MCMS Placeholder Content Web Part.
 

 
Thanks and regards,

 
Davendra
GeneralRe: Help Needed | SharePoint Web part and MCMSmemberStephen Huen19 May '06 - 7:58 
Which browser are you using? It should be floating height in IE.
GeneralRe: Help Needed | SharePoint Web part and MCMSmemberDavendra21 May '06 - 19:38 
I'm using Windows IE but still getting scroll bars. Do I have to do some configuration setting for webpart? Or am I missing something?
 
Regards
 
Davendra
QuestionCan this use Forms authentication?memberdiver726 Jan '06 - 9:07 
Our MCMS website is using Forms authentication for authoring. It is also written in VB.NET.
 
I converted the MCMS code here from C# to VB. That seems to work fine. The issue I'm having is that when I click on the "Select Page & Placeholder" button for the web part it opens the dialog but prompts me for a Windows Authentication. If I enter my credentials it fails with "Access denied". I wondering if the forms authentication is causing this.
 
Any suggestions?
 
-- modified at 15:15 Thursday 26th January, 2006
 
Ok, I changed MCMS to use Windows Authentication and the Select dialog now displays but it's empty. No Channels, No Pages and No placeholders. Frown | :(
 
Why? Confused | :confused:
 
Another thing I discovered is that if the title of the SharePoint page has a space in it this dialog displays a bad query error.
GeneralMCMS 2002 and VStudio 2003 does not worksussEdilberto Sánchez Forero7 Jul '05 - 15:23 
I download the MCMS 2002 but it doest not work with vStudio 2003 (instalation dependencies) What can i do?
 
thanks
 
gracias
GeneralRe: MCMS 2002 and VStudio 2003 does not workmemberStephen Huen7 Jul '05 - 15:55 
Please check out the MCMS Faq.
GeneralRe: MCMS 2002 and VStudio 2003 does not worksussEdilberto Sánchez Forero7 Jul '05 - 16:37 
I just see that, but the available installer in http://www.microsoft.com/cmserver/default.aspx?url=/cmserver/downloads/
 
in the "trial software" is the file "cms2002sp1eval.exe" and I download the complements (sp1, sp1a, connectors, etc.) but this installer do not let continue if the vStudio dependences is complete (of course, i uncheck the other install options, the developer appear disabled and the other two are the only way)
 
What can I do?
 
The url of file is: http://download.microsoft.com/download/4/2/4/424cf9b2-be28-4411-900b-c67daa13b348/cms2002sp1eval.exe
 
And the previous page is: http://www.microsoft.com/cmserver/default.aspx?url=/cmserver/evaluation/evaleditiondl.htm
 
Thanks
 

 
gracias
GeneralRe: MCMS 2002 and VStudio 2003 does not workmemberStephen Huen7 Jul '05 - 17:18 
I am not familiar about the evaluation version. May be a question to newsgroup microsoft.public.cmserver.evaluation will help.
GeneralHaving problemsmembermilesowen12 Jan '05 - 15:24 
I have installed the placeholder web part. I can add the part to my page. I can select the page and placeholder but they do not display in the toolpane fields. Any ideas?

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web02 | 2.6.130523.1 | Last Updated 22 Jan 2005
Article Copyright 2004 by Stephen Huen
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid