Search:

Apache » Lenya
project logo
  • Project
  • Developer
  • Community
  • Version 2.0
  • Version 1.2
  • Version 1.2
    • Installation
      • Download
      • Subversion Access
      • Install Instructions
    • Tutorial
      • Introduction
      • 1. Understanding Lenya
      • 2. Installing Lenya
      • 3. Anatomy of the Pipeline
      • 4. Editing in Lenya
      • 5. Custom Navigation in Lenya
      • 6a. Mod Proxy and Lenya
      • 6b. Mod Proxy and Lenya
    • How-To
      • FAQ
      • New Publication
      • Deploy Publication
      • Look and Feel
      • Custom Resource Type
      • Adding Mime Types
      • Site Navigation
      • LDAP Authentication
      • CMS Menus
      • CMS Screens
      • Search Publications
      • External Data
      • Unit Tests
    • Components
      • Access Control
        • Basic Terms
        • Access Controllers
        • Access Controller Resolvers
        • Authenticators
        • Authorizers
        • Policies and Policy Managers
        • Accreditable Managers
        • SSL Encryption
      • Authoring
        • Adding a new document creator
        • Image Upload
        • OpenOffice
      • Deployment
        • Proxying
      • Editors
        • HTML Form Editor
        • HTML One Form Editor
        • Bitflux Editor
        • Kupu
        • Xopus
      • Layout
        • Navigation
        • XHTML templating
        • Serving static resources
        • Lenya Menubar
      • Publication
        • PageEnvelopeModule
        • Site tree
      • Resource Types
        • Resource Types
      • Revision Control
        • Revision Controller
        • RCML
        • Check In
        • Check Out
        • Revisions
        • Rollback
      • Repository
        • WebDAV Servers
      • Search
        • Searching with Lucene
      • URI Handling
        • URI Parametrizer
        • URI Scheme
        • Usecases
      • Asset Management
        • Asset Management
      • Link Management
        • Link Management
      • Meta Data
        • Meta Data Handling
      • Multilingual Documents
        • Multilingual Document Handling
      • Tasks
        • The Task Concept
        • Defining Tasks
        • The TaskAction
        • Scheduling a Task
        • Included tasks
          • AntTask
          • DefaultFilePublisher
          • StaticHTMLExporter
          • MailTask
        • Developing Tasks
      • Workflow
        • Terms
        • The State Machine
        • Configuration
        • Implementation
      • Site Management
        • Archive
        • Copy
        • Deactivate
        • Delete
        • Delete the trash
        • Move
        • Move Up/Down
        • Rename
        • Restore
    • Miscellaneous
      • Namespaces
      • Reserved Names
      • XInclude Processor
    • 1.2 API (Javadoc)

Current Event

Built with Apache Lenya

XHTML templating

Table of Contents
  • The XHTML Templating Concept

The XHTML Templating Concept

There are various approaches to templating within a Lenya publication. The XHTML approach is effective under the following conditions:

  • Designers want to edit the layout with their conventional tools.
  • The page layout contains large parts of static HTML.
  • Pages are typically composed of simple elements.

If these conditions are met, it is possible to define the overall layout of a page in a XHTML document, using tools like Dreamweaver. Special placeholders need to be inserted to indicate where Lenya elements should later be substituted. This can be done by inserting <div id="navigation" /> as the placeholder for the navigation, for instance, or <div id="cmsbody" /> for the body part of a page.

If these XHTML documents are finished, they can then be called from Lenya, and the placeholders be substituted with CMS content. Schematically, this process looks as follows:

1)

XML document (article) ->

XML document (navigation) -> Aggregation to one XML document

XHTML template ->

2)

aggregated XML document -> Processing with XSLT

Step 2) identifies the various placeholders ( <div id="navigation" /> and <div id="cmsbody" /> in this example) and applies XSL transformations to substitute the placeholders with the transformed contents of (navigation, article) respectively.

What are the advantages of this approach?

  • less XSLT is required, making it easier to delegate design work
  • XSLT are easier to understand, as they only affect a small part of a page

What are the pitfalls of this approach?

  • it may not be appropriate to put the content (here: article) into the XHTML format
  • template reuse may be hampered

Copyright © 1999-2011 The Apache Software Foundation. All rights reserved.

Apache Lenya, Apache, and the Apache feather logo are trademarks of The Apache Software Foundation.