Note that there are some explanatory texts on larger screens.

plurals
  1. POString Templatization Engine for .Net
    text
    copied!<p>I’ve hit the need to be able to store templatized content separately from the code that generates the dynamic fields that fill that content (think mail merge in word). The use case generally revolves around the fact that I want to write code that can send out some type of dynamic content (often an email) which I want to allow my users to customize without changing any code.</p> <p>For example, we send emails to our clients. We end up tweaking the emails that go out and adding dynamic content (i.e. for example we may want to say “Dear {Contact.FirstName},”). It’s convenient to throw the format of these emails into the database or some XML file and write the code that gives it the values of all the properties separately. So create an Email.XML with the content and an engine that takes that XML file passes it the Contact object and returns the HTML of the email. Conceptually this fairly similar to the goal of separating the view layer in the MVC pattern (the email is the view in this case, the engine is the controller and the Contact object is the model).</p> <p>It looks like there’s two contenders in the .Net space (both ports of java) (there’s more <a href="http://csharp-source.net/open-source/template-engines" rel="nofollow noreferrer">here</a> but they are fairly niche players).</p> <ul> <li><a href="http://www.stringtemplate.org/" rel="nofollow noreferrer">StringTemplate.Net</a> </li> <li>NVelocity (<a href="http://nvelocity.sourceforge.net/" rel="nofollow noreferrer">original project</a>, <a href="http://castleproject.org/others/nvelocity/index.html" rel="nofollow noreferrer">fork of the castle project</a>)</li> </ul> <p>Has anyone used either of these or other templatization engines? Are the key differences between them I should take into consideration when choosing </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload