[MAGNOLIA-2455] add request parameters to freemarker renderer context Created: 30/Oct/08 Updated: 23/Jan/13 Resolved: 24/Jan/09 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | templating |
| Affects Version/s: | 4.0 |
| Fix Version/s: | 4.0 |
| Type: | Improvement | Priority: | Major |
| Reporter: | Teresa Miyar | Assignee: | Teresa Miyar |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Template: |
|
||||||||
| Acceptance criteria: |
Empty
|
||||||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||
| Date of First Response: | |||||||||
| Description |
|
make user params available in the templates just like jsp does. |
| Comments |
| Comment by Jan Haderka [ 30/Oct/08 ] |
|
you can already access request parameters via context in FM paragraphs like ${ctx.myParam!"default"}
|
| Comment by Magnolia International [ 30/Oct/08 ] |
|
And besides, they should probably somehow be wrapped in the action/model class ? (if this is needed to validate/process forms) |
| Comment by Philipp Bracher [ 30/Oct/08 ] |
|
ctx.name: good point form: yes here we handle that nicely (by the model) I just realized the need during the discussion with Teresa (and in jsp we normally use params.*) Should we drop the support of params in freemarker and just document the ctx.name feature? |
| Comment by Magnolia International [ 31/Oct/08 ] |
|
ctx.parameters['tralala'] should also work - and I'd be in favor of using that rather than ctx['tralala] |
| Comment by Sean McMains [ 22/Jul/11 ] |
|
Out of curiosity, did this ever get documented anywhere? My googling only led me to this ticket. Alternately, it might be nice to use RequestParameters, as that seems to be a fairly standard Freemarker feature, and more familiar to people who already use Freemarker in other contexts: http://freemarker.sourceforge.net/docs/pgui_misc_servlet.html |
| Comment by Magnolia International [ 22/Jul/11 ] |
|
Good point. Also surprised we didn't rollback the initial change, seems like this "params" variable is still there in 4.4. |