user747858
user747858

Reputation:

Passing parameters between Velocity templates

I am trying to find out how to pass parameter while calling a velocity template from another.

it looks like this

File: _reading_tracker.vm

#parse("student/shared/_bio_data.vm")

I need to pass some arguments to the _bio_data.vm. Not sure how to do this

Upvotes: 9

Views: 10580

Answers (1)

jtoberon
jtoberon

Reputation: 9016

Instead of parsing _bio_data.vm, try creating a macro, and then calling that macro from _reading_tracker.vm.

Or, if you don't want to use a macro, then you should be able to #set($var="value") any number of variables in the outer template, and refer to those variables in the inner (parsed) template.

Upvotes: 4

Related Questions