Hi,
I'd like to have some construct like this in a template:
#if(templateExists($template))
#parse($template)
#end
Is there a canonical/approved way of doing this? I've put the
VelocityEngine into the context and tried:
#if($engine.resourceExists($template))
...
#end
But
I have a desire to hook when unknown directives are called from a template.
The use case is to enable Velocity as a templating engine for JRuby on Rails
(and other JRuby'ish things, possibly Sinatra, etc). I've created some code to
get part of the way there:
${v.charAt(0)}a.xx should do the trick. When in doubt, surround with curly
brackets :)
Erik
On Sep 19, 2012, at 07:31 , christoff.schm...@finaris.de wrote:
Hi,
The evaluation of the following Velocity Template produces an invalid
output:
#set($v = a)
$v.charAt(0)a.xxx
I
One trick I use when confronted with context objects that aren't behaving as
I'd expect is to output:
$object.class
and then it's clear what object type you're dealing with.
Erik
On Aug 7, 2013, at 18:10 , O. Olson wrote:
Thank you very much Sergiu and Alex.
Philiippe - I just noticed you posted this to the velocity user list. How Solr
uses Velocity is perhaps a bit niche/different, so best to ask over on the Solr
user list for future questions about the Solr/Velocity integration. But I’m on
both lists :)
Erik
On Oct 9, 2014, at 4:19
, etc.
In other words, can you add a Velocity template to a Tomcat server as easily
as you can drop a .php file in an Apache server's DocumentRoot directory.
Many thanks.
Philippe
- Mail original -
De: Erik Hatcher erik.hatc...@gmail.com
À: Velocity Users List user
If you could show me what you’ve done, I’d be happy to adjust VrW to better
suit your needs if that makes sense.
Feedback welcome!
—
Erik Hatcher, Senior Solutions Architect
http://www.lucidworks.com http://www.lucidworks.com/
On Feb 19, 2015, at 10:16 AM, phi...@free.fr wrote:
Hi Erik
You mean like the macros? Since you’re in Solr-land, look at the
VM_global_library.vm file and how those pieces are used. (it’s a bit uglier
than it should be in the Solr example macro library, but should give you some
insight there).
—
Erik Hatcher, Senior Solutions Architect
http
#end
---
- Mail original -
De: Erik Hatcher erik.hatc...@gmail.com mailto:erik.hatc...@gmail.com
À: Velocity Users List user@velocity.apache.org
mailto:user@velocity.apache.org
Envoyé: Jeudi 19 Février 2015 16:19:25
Objet: Re: $link
If you could show me what you’ve
for URL escaping. It’s used to $esc.html()
and $esc.url() in the example templates.
Happy to help work through this, and even add the LinkTool if you feel it’d be
helpful (or work through a way to make tools pluggable in VrW).
Erik (author/maintainer of VrW)
—
Erik Hatcher, Senior
—
Erik Hatcher, Senior Solutions Architect
http://www.lucidworks.com http://www.lucidworks.com/
On Feb 19, 2015, at 11:19 AM, phi...@free.fr wrote:
Hi,
is there a way to use Java classes in SOLR 4.9's Velocity Engine?
If so, how?
Thanks.
Philippe
I’m trying to set up a system that has some built-in (to a JAR, class path
loader) macros defined (in _macros.vm) and allows the user, in their own file
system loader path, to define macros.vm (without underscore prefix) to add
their own.
I’m trying this:
.
But I’m curious - what’s the need here?It’s a very unusual request for this
type of thing, so I’m concerned you’re trying something that should be done a
different way instead.
—
Erik Hatcher, Senior Solutions Architect
http://www.lucidworks.com http://www.lucidworks.com/
On Apr 9, 2015
13 matches
Mail list logo