I am familiar with the general discussion about "why create a template parser, since ColdFusion IS a template parser" so I need to give some background info on what I try to accomplish.

I am (started in January this year) creating a CMS with CFML. This CMS is created with the seperation of business logic and presentation layers in mind. Currently I use templates like homepage.cfm, subpage.cfm to render the content into a presentation. What is displayed, is defined in the template with short calls to methods retrieving the content etc.

But ... I want to introduce a template builder. In the backend the users selects a starting template and is able to fill it with containers, building blocks like "article,poll,opt-in,navigation". This means templates will become dynamic.

I have two options:
1)Generate cfml code on the fly, and save the result as a template.
2)Use a custom markup language, and use a template parser to parse all the tags with corresponding content.

Option 1 is more work, not because of the methods which replace the markup language (in option 1 it is pre-generated, in option 2 it is generated on demand), but because I need to keep a reference of the editable regions, where, how, business rules, etc.

So I want to have a sort of dreamweaver template with my custom code:

<html xmlns="smml">
<style type="text/css">
@media all{
  smml:/container{
    border:1px solid red;
  }
  smml:/article{
    font-family:Arial;
    font-size:11px;
  }
}
</style>
<body>

  <smml:container>
    <smml:log type="UsabilityAnalysis" event="all">
     <smml:article action="" frompage="1234" />
    </smml:log>
  </smml:container>

</body>
</html>

Then this would be parsed by the template parser. I want it stack based because this gives me the ability to
1: validate correct nesting
2: more performance
3: enables flow options
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to