template-engine

Do you think templates represent the best way for separating presentation logic from business logic?

I think most template engines are hard to use for designers and front end developers leaving you, the programmer with the burden of maintaining them. And frequently updating the templates after the designer updates the html mockup is a nightmare because your templates are no longer compatible with the original htmls. I had this problem...

Why should I use templating system in PHP?

Why should I use templating system in PHP? The reasoning behind my question is: PHP itself is feature rich templating system, why should I install another template engine? The only two pros I found so far are: A bit cleaner syntax (sometimes) Template engine is not usually powerful enough to implement business logic so it forces you ...

Template engine for image generation

Does anyone know of any templating engines for generating images, preferably Java-based? What I have in mind is something like StringTemplate where a you have a set of parameterized templates that render to an image (or SVG, etc) rather than text. It needs to be more general purpose than "insert text here to generate a sign". Primitiv...

Trimming Mako output

I really like the Mako templating system that's used in Pylons and a couple other Python frameworks, and my only complaint is how much WS leaks through even a simple inheritance scheme. Is there anyway to accomplish below, without creating such huge WS gaps... or packing my code in like I started to do with base.mako? Otherwise to get ...

is it possible to issue dynamic include in asp-classic?

I mean, like php'h include... something like my_file_to_be_included = "include_me.asp" -- > for what I've seen so far, there are a couple of alternatives, but every one of them has some sort of shortcoming... what I'm trying to figure out is how to make a flexible template system... without having to statically include the whole t...

Which Java MVC frameworks integrate easily with StringTemplate?

It's hard to see how StringTemplate integrates easily (or not) with popular Java web MVC frameworks. Which Java MVC frameworks integrate easily with StringTemplate? A good answer: mentions one solution to integrate with a framework, includes a link to something useful and applicable, like: a tutorial, or documentation, or a referenc...

Send asp.net mvc action result inside email

I'd like to use my Action in asp.net mvc, as template engine, that results in form of string, that I could send in email. Pseudo-Code: public ActionResult Register() { SendEmail(View().ToString()); return new EmptyResult(); } ...

What templating engines are available for ASP.NET MVC Framework?

I was reading some posts on Coding Horror blog about working with the horrors of tag soup. It seems like the only way to simplify html generation is to use a templating engine. Do you know any templating engine for ASP.NET MVC framework? ...

String Templatization Engine for .Net

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...

What's a good HTML template engine for C++?

Planning to write a website in C++. Would like to use a template system like Clearsilver, but maybe there's a better alternative? ...

What javascript templating engine do you recommend?

Do you have experience with a Javascript templating engine, one that is stable, easy to use and has good performance? I need to do apply the same template many times for different data. I prefer to download the template itself once (and have it cached) rather than processing the template on the server. Also, this way the template itself...

Split tags in python

I have a file that contains this: <html> <head> <title> Hello! - {{ today }}</title> </head> <body> {{ runner_up }} avasd {{ blabla }} sdvas {{ oooo }} </body> </html> what is the best more pythonic way to extract the {{today}}, {{runner_up}} etc? I know it can be done with splits/r...

Can anyone point me to a good article on "abstracting HTML"?

I'm currently working on a legacy eCommerce system front-end that has alot of duplicate HTML code. I'm trying to find a way to abstract out the complexity almost as you would when moving the similarities between similar classes into a shared abstract base-class. I.E. "Taking out what changes and abstracting it" I've used Java framew...

How to use Brail as a stand-alone general purpose templating engine (like NVelocity)?

Hi, I've been using NVelocity as a stand-alone templating engine in my text file generator. The problem with NVelocity is that the macros are quite shaky; pretty much all errors I get are from faulty macro implementation. It would be cool if I could just use some other templating engine, such as Brail. That way I would just write funct...

Arrange elements into columns with Smarty

I have a php page that produces an array of elements. For the sake of simplicity let's say that it contains the numbers 1-5 in numerical order. These numbers need to be equally (or as close to equal as possible) split into two columns (using a html table) like so: 1 4 2 5 3 The number of columns might change in the future. Since t...

Do you find the view implementations in PHP frameworks convenient?

All the popular PHP frameworks today use their own view layer implementation that is based on pure PHP templates and lots of helpers. I've tried some of them and always found that this approach introduced huge complications to quite simple things. For example, in Zend Framework forms and the pagination use their own solutions to customiz...

Is the NVelocity project dead? Are there alternatives?

I'm looking for a template engine for .NET/C# to generate email notifications in my application. I read about NVelocity in the past and think it would fit my needs, but it seems this project is dead. Would you still recommended to use NVelocity for that purpose or can you suggest any alternatives? Note: I found some other templating en...

What template language does Tumblr use?

Tumblr uses a very simple template language for it's themes: {block:Text} <li class="post text"> {block:Title} <h3><a href="{Permalink}">{Title}</a></h3> {/block:Title} {Body} </li> {/block:Text} Start.io also uses the same format: <html> <head> <title>{Name} @ start.io</title> </h...

Why choose an XSL-transformation?

For a current project the decision has to be made whether to use XML and an XSL-transformation to produce HTML or to directly use HTML-templates. I'd be interested in arguments for or against the XSL-approach. I understand that in cases where you have to support many different layouts, an XSL-solution has a lot of advantages, but why wo...

ASP.MVC: Implementing a non-templated view engine?

I'm fairly new to ASP.MVC. For our new Web application I'm considering between two options for view engines: Using some of the available view engines (the default one, NVelocity, Brail, etc.) as a primary view code generator. Implementing an application-specific C# DSL for generating HTML code so that the main bulk of the view code is ...