Availability
Parameter To Context Plugin v0.2 is available at Blojsom3 Plugins download page
.
Description
Parameter to Context Plugin puts all request parameters to context map. Each parameter name will be prefixed with a "param_" string in the context, and can conveniently be retrieved from the Velocity templates.
Installation and Setup
Place param2ctxplugin-x.y.jar in /WEB-INF/lib/ directory.
Add the following to /WEB-INF/classes/blojsom-plugins.xml file.
<bean id="param2ctx" class="com.mbledug.blojsom.plugin.param2ctx.Param2CtxPlugin" init-method="init" destroy-method="destroy"/>
Modify HTML plugin chain from Blojsom administration menu plugins->mappings
Add "param2ctx" to one of the flavor-based plugin chains. You can place it anywhere within the chain, for example:
Usage
Context variables prefixed with the word "param_" are made available for each query parameter.
For example: for URL http://yourhost.com/blog/default/something?first=fooone&second=bartwo
, you can display the values of those parameters with:
First parameter is $param_first
Second parameter is $param_second