Microsoft Content Management Server Resources
MCMSfaq.com
subcribe to the feed.
r.a.d.editor MCMS edition AchieveForms Lite CMS.Rapid MCMS Manager GotDotNet User Samples MondoSearch Metalogix Migration Assistant Cubik OneStopCMS IT Hit Web Author Enhancements
MCMSfaq.com Home >  Code Samples >  MCMSfaq.com Code Samples >  FAQ Placeholder

FAQ Placeholder

Updated: March 28th 2005.

 

Introduction

This placeholder control extends the XmlPlaceholder and allows business users to contribute a FAQ list which is presented as DHTML. In Presentation Mode, users can expand and collapse each FAQ item. In Authoring Mode, users can add, edit and delete items. The underlying data is stored as XML using a standard XmlPlaceholderDefinition.

This sample provides expanded coverage of the FAQ Placeholder Control which shipped as part of the OTGWeb Sample site. In addition the sample has been decoupled from the OTGWeb site and can be easily deployed within your MCMS applications. The following diagrams show the Placeholder in action.

FAQ Placeholder in Authoring Mode FAQ Placeholder in Presentation Mode

Why is this sample of interest?

There are two other FAQ Placeholders available. Kathy Shieh's Placeholder is really just an example of extending the HtmlPlaceholder, with an unusable Authoring Mode and hard-coded presentation. The MSIB Plus Pack control is based around a number of postings providing data for the FAQ. This sample is robust and suitable for commercial deployment, and provides a simple interface for business users which doesn't require an understanding of MCMS concepts

Is there a downside?

Yes! The DHTML is currently implemented using HTCs, and whilst this produces clean markup and is efficient, it is not suitable for browsers which do not support HTCs. In addition to this the control does not allow the ordering of FAQ items, HTML markup (e.g. links) within Items or a spell checker.

Can I customise the styling of the control's output?

The style definitions and the HTML emitted by the HTCs can be easily modified to suit your particular needs.

Using the FAQ Placeholder in your applications

The sample is easy to integrate into your MCMS applications.

      Copy the files AuthoringFaq.htc and PresentationFaq.htc to a folder named shared within your Visual Studio.NET solution.
      Copy the files down.jpg, up.jpg and ResourceRemove.gif to a folder named images within your Visual Studio.NET solution.
      Add the FAQ Placeholder control to your Visual Studio.NET Toolbox. Note there is no need to add the other controls contained within the assembly.
      Create a Template, which includes an XmlPlaceholderDefinition.
      Create a Template file and drop the FAQPlaceholder control onto it.
      Bind the placeholder control to the PlaceholderDefinition.
      Switch to HTML view and modify the HTML element to:
      <html xmlns:faq xmlns:page>
      Add the following two lines within the HEAD element, replacing mcmsfaq with the name of your Virtual Directory:
      <?import namespace="faq" implementation="/mcmsfaq/shared/AuthoringFaq.htc">
      <?import namespace="faq" implementation="/mcmsfaq/shared/PresentationFaq.htc">
      Build your project, and create a posting based upon the new template.

Note: The import directives will prevent you from switching back to design mode. This can temporarily be bypassed by enclosing them in HTML comment tags.

Download the sample files: FAQ.zip (49Kb)


© 2001 - 2006 Triumph Media Limited. All rights reserved.
Microsoft Corporation is in no respect affiliated with www.mcmsfaq.com.
harbar.net