I am considering the StringTemplate view engine for my ASP.NET MVC application. This application will be built with one skin, but I then expect many more, often very similar skins to be developed for it. This is primiarly the reason for my choice of StringTemplate as the view engine, as there will be zero logic in the views.
In my head,...
I'm trying to print out generate shipping labels, and I know how many I want. So given that I know n, how do I print "x of n" for x=1 to n?
What I'm wanting to do is have an expansion template that will take n and provide the x and n variables to the template I shall pass (StringTemplate is a functional-type templating language, so thi...
Hi,
I'm currently using StringTemplate to create my emails on the fly and its proven very easy to use in creation of the email. However, I'm trying to apply some styling to my emails and dont seem able to do this in the normal manner.
I can style parts of the mail if I write it inline, eg.
<p style="color:red;">Hello again, $name$ !</...
i use GUI tool of vs2008 to generate some LINQ to SQL class, my problem is StringTemplate can not reach attributes of those model
$persons:{
<li>$it.name$</li>
}$
it printed:
<li></li>
<li></li>
<li></li>
name is public property of Person model. If i create a person class by myself, and the same attributes, StringTemplate can get i...
I saw a thread on email templates, with maildefinition class being to limited, bitethebullet.co.uk xml based for simple field/list replacement, and nvelocity and stringtemplate for more complex tasks. Is there some example code out there for nvelocity and/or stringtemplate (c#) used for email templates?
mike
...
I'm trying to write an ANTLR3 grammar that generates HTML output using StringTemplate. To avoid having to escape all the HTML tags in the template rules (e.g. \<p\><variable>\</p\>), I'd prefer to use dollar as the delimiter for StringTemplate (e.g. <p>$variable$</p>).
While the latter seems to be the default when StringTemplate is used...
Im interested in writting something similar to a nested loop using StringTemplate template engine.
In C# have a HashTable of which each Key contains List of Document objects, each Document has a title and source. I would like to list at the beggining of an email, a summary of the document titles per source.
<h1>Summary</h1>
<h2>Source A...
Hi
I am using string template to render some content, but the content may be variable so not sure how to pass it in (using .net / c#)
Basic idea is I have a List> which need to end up as parameters, e.g.
List<KeyValuePair<string, object>> ret = new List<KeyValuePair<string, object>>();
ret.Add(new KeyValuePair<string, object>("elem1",...
For building a document generation engine what would be the primary .NET framework to be used in production. The 2 main ones I see are NVelocity and StringTemplate. NVelocity in all forks to be almost unsupported at this point where as ST been active atleast as of this year.
Are either or both of these stable for use in production (if n...
I am starting to use StringTemplate for the first time, and am stuck trying to figure out how to get StringTemplate to do something like the following:
article.st
$elemenets:article/elements()$
article/elements.st
$if($it.is_type)$ $it:article/type()$
$elseif($it.is_type2)$ $it:article/type2()$
// also tried: $it.value:article/type2...
Hello
I have a problem combining StringTemplate view engine and Areas, i don't know what to do so paths can be recognized. Anyone tried that combination?
...
I'm creating an email using String Template but when I print out a date, it prints out the full date (eg. Wed Apr 28 10:51:37 BST 2010). I'd like to print it out in the format dd/mm/yyyy but don't know how to format this in the .st file.
I can't modify the date individually (using java's simpleDateFormatter) because I iterate over a col...
I'm using StringTemplate to generate some xml files from datasets. Sometimes I have more than 100,000 records in the dataset that is enumerated by a loop in a template. It goes very slow (15-20 secs per operation) so performance is not good for me.
This is an example how I use ST to render a report:
using (var sw = new StringWriter())
...
Hi,
I have a newbie question,, how do i add a string template to the views folder in a .net mvc project?
I have added a reference to StringTemplate.dll and antlr.runtime.dll? but seems that is not enough.
i.e. when i right-click on views and choose Add >> New Item i can't find a file with .st extension in the list that i get...
how d...
I have my environment setup nicely using Scala, StringTemplate within the Google AppEngine. I am having trouble looping through a Map and getting it to display in the template. When I assign a simple List of just Strings to the template it works using:
In Scala Servlet:
var photos = List[String]()
//... get photo url and title ......
I am using StringTemplate in c# and following code to load a template from a subdirectory of my application.
StringTemplateGroup group = new StringTemplateGroup("myGroup", "/tmp");
StringTemplate query = group.GetInstanceOf("Sample");
query.SetAttribute("column", "name");
Console.WriteLine(query);
I have a template file Sample.st in t...
Recently I use stringtemplate,I noticed StringTemplate can't support complex conditional,similar value>1 or value="menu" etc.
who can give me a advise how to work?thanks.
...
The default template file extension of StringTemplate is ".st". Now I have several template files in a folder and their file extension is ".dwt". Is there a way to change the default template file extension and load all of them like below:
StringTemplateGroup group = new StringTemplateGroup("views", viewPath);
...
I'm using StringTemplate as view layer for my web application. Recently I've measured how much time is spent rendering pages and it's around 50ms for simple pages and 500ms for complex pages. This is too much for my needs, so I'm looking for a way to improve ST's performance. How can I do this?
Most of the time is consumed by the String...
I'm developing an application which uses different components to create an XHTML document, I used StringTemplate for creating the document data of the components and then combined them into a one large document. This is an example of a component:
public class BoxImpl extends AbstractContainerImpl implements Box {
private static fin...