RawXml for /wsg_presentation/Part2_cms_xslt.xf?slideNum=2

This website produced with XsltFilter. The Page.Response buffer output is shown below.

Return to normal view of page  

<? xml-stylesheet type="text/xsl" href="presentation.xsl" ?>
<presentation  title="CMS and XSLT" comment="Part 2 of the the presentation. Contains the CMS demos">
<!--   *************** new slide ************************************* -->
<slide caption="Introduction"> This presentation contains the CMS related part of the talk I gave at WSG. <br/>
<br/>
If you understand how to build a site using XSLT, then adding a CMS isn't that difficult. It simply involves getting the XML data from a database, and managing some session details to indicate when a person is actively editing the content blocks. <br/>
<br/>
This is part 2 of this presentation. Read <a href="Part1_using_xslt.xf"/>Part 1/</a> first.
<index/>
</slide>
<!--   *************** new slide ************************************* -->
<slide caption="Frequently Asked Questions">
<question>How does this differ from normal CMS?</question>
<answer> Normal CMS systems rely on storing the content in a database, and formatting that information via code. Using XSLT relies on storing the XML data in a database, and letting the XSL processor transform the XML into HTML as it sees fit . </answer>
<question>Which system do I use?</question>
<answer> I have written my own CMS using ASP.NET. Since I use XsltFilter, the CMS simply outputs XML and knows nothing of any transformations taking place. </answer>
</slide>
<!--   *************** new slide ************************************* -->
<slide caption="Using XSLT with Content Management Systems"> CMS systems which use XML and XSLT are very flexible, and much easier to implement than a traditional CMS system.<br/>
<br/>
A comparison of the methodolgies should highlight the differences between them. For this comparison, we will assume that a vendor is implementing an established CMS for a new client.
<section heading="Storing the data"> A XML based CMS uses a single table to store the content in an XML format. This differs from a traditional CMS where there is a different table for each different type of content.<br/>
<br/>
<comparison caption="Comparing the data storage needs">
<XML>no re-development (every implementation is identical)</XML>
<Trad>re-develop the database to match the CMS requirements</Trad>
</comparison>
</section>
<section heading="Editing the content"> No matter what type of CMS is implemented, there must always be forms and form handlers to edit the CMS data. With a traditional CMS you must also develop the database side of things for each implementation.
<comparison caption="Comparing the development of an editing system">
<XML>develop a form to display each type of content</XML>
<XML>develop a form handler to convert the text from each form into XML</XML>
<Trad>develop a form to display each type of content</Trad>
<Trad>develop a form handler for each form</Trad>
<Trad>write code to read each type of content from the database</Trad>
<Trad>write code to store each type of content in the database</Trad>
</comparison>
</section>
<section heading="Displaying the data"> Use XSLT to transform that XML content into whatever HTML is defined in the XSLT stylesheet. (Note: If you have chosen to use XSLT for the site, then there is no additional work to display the CMS based content.)
<comparison caption="Comparing the development required to display the content">
<XML>write XSLT template rules to format the XML as HTML. (req even if no CMS used)</XML>
<XML>every placeholder automatically finds the matching template rule (zero development)</XML>
<Trad>development required to read the CMS data from database</Trad>
<Trad>development required to format the database content as HTML.</Trad>
<Trad>each placeholder must be correctly coded</Trad>
</comparison>
</section>
</slide>
<!--   *************** new slide ************************************* -->
<slide caption="In place edit-links for the CMS"> My CMS uses in-place edit links for the content blocks. Some people who are used to traditional CMS's seem amazed when they see this as it is so simple to use, and they wrongly assume it must be hard to implement. It is actually easier to implement. <br/>
<br/>
The basic concept is:
<ol>
<li>You must use XSLT to figure out what HTML is generated. This is a pre-requisite.</li>
<li>When in normal mode, the content block contains only the XML content.</li>
<li>When in Content Editing mode, the CMS wraps a <ContentEntry> tag around the content block.</li>
</ol>
An example is shown below...
<section heading="XML Content block"> The XML for a typical content block would look like this.
<code type="xml">
<para heading="">Coming Soon... (honestly)</para>
</code>
</section>
<section heading="Same XML Content Block when in editing mode"> When the CMS is placced into editing mode for the session, it adds a <ContentEntry> tag around the content.
<code type="xml">
<ContentEntry Key="Bikes" SubKey="1" SiteVer="1" Approved="True" ValidRootNodeNames="para">
<para heading="">Coming Soon... (honestly)</para>
</ContentEntry>
</code>
This <ContentEntry> tag is transformed into in-place editing containers on the page, and within the editing container, a call is made to <xsl:apply-templates/> which then automatically finds the standard template rule for that content.
<img src="cms_inplace1.jpg" width="208" height="53" alt="A CMS block ready to be editing" border="0"/>
</section>
</slide>
<!--   *************** new slide ************************************* -->
<slide caption="Sample CMS page"> This is an example of the code for a CMS driven page. <br/>
<br/>
The page runs in a DotNet environment - it's a standard ASPX page, though I use an '.xf' extension to clearly differentiate the pages made using <a href="http://xsltfilter.tigris.org"/>XsltFilter/</a> from other ASPX pages. <br/>
<br/>
Notice how there is almost no code, and the intent of the code is very clear.
<code><?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="styles/demo.xsl"?> <page> <MainPageContent heading="CONTACT US> <%= Content.GetXml("ContactUs","para") %> </MainPageContent> </page> </code>
And yes, this page works, and work well. Those 7 lines are really all thats required to have a CMS based website. <br/>
<br/>
PS: In this example, the 'Content' object has been declared in the Global.asax <br/>
<br/>
PPS: I would normally inherit the page class from a custom written base class that provides the XML headers and <page> node, making this page only 3 lines long... but that would make the example less clear. </slide>
</presentation>