I have the following in my NVelocity template:
#if($PO.GiftMessage != '')
<tr>
<td align="left">
<font face="arial" size="2" color="#000000">
<b>Gift Message</b>
<br />
$PO.GiftMessage
</font>
</td>
</tr>
#end
Basically if my object (PO) has the property GiftMessage, and it is not null, i wa...
I am using codeplex NVelocity library on .net and i want to catch an error when I execute Evalute method on VelocityEngine instance and one of the parameter in template text was not found.
How can I obtain this?
I find IInvalidReferenceEventHandler interface in NVelocity.App.Event namespace but I dont't find any information how to use ...
As I saw in some examples, and tried to understand throughout the velocity site, there are three ways of initializing the velocityengine:
- With the default configurations : .Init()
- With the default configurations, plus the properties in a file : .Init(string)
- With the default configurations, plus the properties in a collection : .In...
I'm having some difficulty with using NVelocity in an ASP.NET MVC application. I'm using it as a way of generating emails.
As far as I can make out the details I'm passing are all correct, but it fails to load the template.
Here is the code:
private const string defaultTemplatePath = "Views\\EmailTemplates\\";
...
velocityEngine = ...
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 using Castles' NVelocity Engine to do some template work. Here's the problem. Several of my templates work fine, but one of them isn't.
#foreach($i in $Items)
<div class="grid_3 folioItem"> <a rel="prettyPhoto[portfolio]" href="$i.Link" class="lightBox"><img src="$i.Image" width="220" height="125" alt="showcase" /></a>
<h4>$i.Sho...
Hi,
What is the syntax for an not true or false if statement in nVelocity (or Velocity)?
And more importantly, where is this in the nVelocity docs? I've been Googling for quite a while to no avail.
I've tried several different combinations such as:
#if (!$artist.IsFestival)
$artist.FestivalName
#end
and
#if ($artist.IsFestival ...
I'm looking to use NVelocity in my ASP.NET MVC application, not as a view engine, just for rendering some email templates.
However, I cannot for the life of me get it to work. I have downloaded it from the castle project and followed the example at http://www.castleproject.org/others/nvelocity/usingit.html#step1
No matter what I try I ...
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 using Able Commerce and need to customize the Customer Order Notification email template. I believe Able uses NVelocity for its email templates customization.
I would like to display a message to Non-US customers only. In other words, I would like to prevent the US customer from seeing a message not specific to them.
How do I do...
I have a simple object that has as one of it's properties a decimal named Amount. When I attempt a comparison on this property as part of an nVelocity template, the comparison always fails. If I change the property to be of type int the comparison works fine. Is there anything extra I need to add to the template for the comparison to wor...
Is it possible to have a template with html content in vm for a block component?
I'm doing a lot of stuff in html, and want the html reside in a .vm, not in codebehind.
Here is what i've got:
public class TwoColumn : ViewComponent
{
public override void Render()
{
RenderText(@"
<div class='twoColumnLayout'>
...
I have been asked to update the menu on a website we maintain. The website uses Castle Windors Monorail and NVelocity as the template. The menu is currently rendered using custom made subclasses of ViewComponent, which render li elements. At the moment there is only one (horizontal) level, so the current mechanism is fine.
I have bee...
I am using NVelocity to process various PowerShell scripts before they are executed against a server.
My question is how to escape a backslash trailing a variable:
e.g.
ls \\$computername\c$
$computername should be replaced with a valid computer name at runtime, but the trailing backslash (\c$) means that it does not.
Thanks
Ben
...
I am using NVelocity in my application to generate html emails. My application has an event-driven model, where saving and/or updating of objects causes these emails to be sent out. Each event can trigger zero, one or multiple multiple emails.
I want to be able to configure which emails get sent out at run-time without having to modify...
I'm trying to add two values in velocity and it always returns 0. What am I doing wrong?
#set ($tmpPrice = $orderItem.ExtendedPrice + $discountAmount)
Both $orderItem.ExtendedPrice & $discountAmount are whole numbers with decimals, like this: 99.99
...
How to set build action=content for new and existing *.vm files in vs2010 solution?
...
I'm building a simple NVelocity template but I can't figure out how to test for the existence of a variable -- In this example I want to test if the context contains a property callwed User.
I know I can implement the same functionality as a hacked foreach loop but I was wondering if there's a better way.
Velocity.Init();
Velocity...
how can I escape " in NVelocity ?
e.g.
test.message = "136# 1/4" Test Test Test"
if I do <input type="text" id="Test.Description" value="$test.message"/>
it displays : 136# 1/4
if I do <input type="text" id="Test.Description" value=$test.message/>
it displays : 136
if I do <input type="text" id="Test.Description" value='$test.messa...
I have a fairly simple template that I need to make a method call from. However, NVelocity does not seem to evaluate method parameters that themselves are NVelocity variables. Take the following NVelocity template:
#if (--- CONDITION SNIPPED ---)
<blockquote class="column span-4">
I MADE IT!
</blockquote>
#else
<...