template-engine

Mako or Jinja2 ?

I didn't find a good comparison of jinja2 and Mako. What would you use for what tasks ? I personnaly was satisfied by mako (in a pylons web app context) but am curious to know if jinja2 has some nice features/improvements that mako doesn't ? -or maybe downsides ?- ...

Twig Template Engine Installation-PHP

I am running Mamp as my local server & I Have installed Twig here: /Applications/MAMP/svn/twig/twig/lib. I have included this path in my php.ini file (include_path = ".:/Applications/MAMP/bin/php5.3/lib/php:/Applications/MAMP/svn/zendframework/trunk/library:/Applications/MAMP/svn/twig/twig/lib" ;) What needs to go in my htdocs folder in...

Can PHP communicate with XSLT?

I want to use a combination of xml & xslt as a templating system. The question that I want answered is: can xslt and PHP communicate with each other (i.e share variables)? ...

How to append XML file to another XML file

I'm trying to create an xml-based template system. The idea is to return my views as xml files (xhtml) and then append them to specific nodes in a template xml file. The template xml is then transformed with xslt. My question is: how do I insert these xml files into the template xml file? ...

How to create a custom template system in PHP

Hello friend I want to use a custom template system in my php application, What I want is I want to keep away my php codes from design, I would like to use a tpl file for designs and a php file for php codes I dont want to use any ready maid scripts. Can any one point out some links link or useful info how to build a php templating...

Maven include file contents from one module in another

I have a maven application that looks like this application_name/ module1 src/main/resources file_snippet.xml module2 src/main/resources file_snippet.xml module3 src/main/resources file.xml file.xml should be like this <workflow> <action> <%= module1/src/main...

safe php template engine

I finding a php template engine allow user defined function only or it allow white-list functions only. My problem is I will let my user edit their templates. So I need a safe template engine. ...

twig - pass function into template

Currently I place my function in a class and pass an instance of this class into template and call my required function as a class method. {{ unneededclass.blah() }} I need to do like below {{ blah() }} Is it possible? ...

Passing variables to model instance methods in Liquid templates

I've been playing around with the Liquid templating engine this weekend, and I wonder if the following is possible. Say I have a latest_posts method in a Blog model, which I can pass an integer to to get the latest N posts. Is it possible to use that method in a liquid template? For example: class Blog has_many :posts def latest...

How do I display "image X of Y" in a Lightroom web engine Lua template?

I'm creating a new "web engine" (i.e. gallery format) for Lightroom, which uses Lua templates to generate HTML for the gallery pages. I've got both the SDK and Programmers Guide from here: http://www.adobe.com/devnet/photoshoplightroom/ But none of the SDK docs, examples, nor the Programmers Guide give me any hint of what variables I n...

3 Column Layout - Looping through Dynamic Data

Hello all, I have list of categories that is contained in li's on one column of my page (side bar). I now want it to span the whole width of the page in several columns. I would always like 3 or 4 columns to fit the page. This is the code that generates the one column. <div id="sidebar"> <ul> {insert...

Unable to load template when URLResourceLoader is used with Velocity

Hi, I am getting the following error when I try to access access Velocity template using URLResourceLoader. org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'http://localhost:8080/myvelocityapp/my-template.vm' at org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceMana...

Why templating engine: smarty or phptemplate, any other?

I'm trying to compare between the different template engines for PHP. The 2 that come up are smarty and PHPtemplate. How do I decide which is better for me.. These are some of the questions I'm trying to find answers to What are some of the strengths and weaknesses of these 2 Is one better than the other in some cases or for some typ...

Please Add - list of PHP CMS and the Template Engines they use

For research purposes, I'd like to compile a list of PHP CMSs and the template engine they use. Please add what you use or know and I will add it here Drupal => PHPTemplate (custom theming engine for drupal since 2005) and Smarty ...

Generating html files in a console application

I need to get data from a database and I need to spit out this data in html formatk using my command line app. For this I am planning to use some sort of template-engine. I was wondering if there is anything in .NET that can do this for me? The best option would be if I could reuse the asp.net mvc template engine (razor) in my app, thi...

What issues do you find in this VERY basic Template Engine in PHP using eval?

For some years that I've been using my own PHP template engine, which is not really "my own" as I saw it on a tutorial many years ago. However, I've refactored most of the code making it simpler and easier to use. I rarely make a PHP project without it. It's very basic and the class only has 3 methods, load, assign and render. The load ...

Template processing using Java

Dear All, We have an email template which needs to be processed using Java. We have to replace the variables in the template with actual values. We were able to achieve this using pattern matching , ie; by searching the template for particular patters and replace them with actual values. Now we need have conditions in the XML file.For ex...

Looking for a popular templating language that needs XSS protection

I'd like to experiment with a popular HTML templating language to see if I can solve XSS problems in it. What is a popular, open-source, templating language that I could try to tackle. By templating language, I mean a language used to generate an output language by combining static content in that output language with dynamic data from...

jquery xml based template engine

Judging from the lack of info around, I'm guessing the following question maybe a little "off piste" as they say.. I am trying to find an XML based javascript (pref. JQuery based) templating engine.. A little like say how Ext.JS (Sencha) do things, or SPRY datasets. Something lite.. Obviously there are lots of JSON based ones, and f...

What does it take to make a CMS template work on a normal website

A PHP content management system usually has its own template engine be it smarty or some other custom template engine specific for that CMS. How might I possibly get a CMS theme to work on a normal PHP website without converting the website to a website powered by that CMS? Can I "teach" the website to use the template engine of a cont...