Monorail CaptureFor

by benl

CaptureFor is a handy means of pushing content up into your layout from a particular view. Some examples of where this can come in handy include setting the HTML page title and linking to script files. Those two being the most common uses for me anyway.

In your view (NVelocity):

#capturefor(pageTitle)
     $!product.Name 
#end

Wherever you want to insert the markup or text in the capturefor, you simple reference the data by the usual means:

<title>$!pageTitle</title>

Simple.

Advertisements