Velocity
  1. Velocity
  2. VELOCITY-281

passing local variables and velocimacros with #parse()

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.4
    • Fix Version/s: 2.x
    • Component/s: Engine
    • Labels:
      None
    • Environment:
      Operating System: other
      Platform: Other

      Description

      Let's say I have "velocimacro.permissions.allow.inline.local.scope = true".
      It would still be nice to be able to pass variables and velocitymacros to a
      template imported by #parse(). E.g., #parse("foo.vm" $myvar #mymacro) could make
      $myvar and #mymacro accessible to "foo.vm" when it's parsed.

        Activity

        Hide
        Nathan Bubna added a comment -

        Here's my reasons:

        • Variables are already available to the template being #parse'd.
        • Most macros needed by multiple templates should be put in a global library.
        • The syntax is unpleasant.
        • I don't see much interest in this.
        • I would bet that any actual use case could be solved by either a tool or #define() (see VELOCITY-174)
        Show
        Nathan Bubna added a comment - Here's my reasons: Variables are already available to the template being #parse'd. Most macros needed by multiple templates should be put in a global library. The syntax is unpleasant. I don't see much interest in this. I would bet that any actual use case could be solved by either a tool or #define() (see VELOCITY-174 )

          People

          • Assignee:
            Unassigned
            Reporter:
            Marcus Sundman
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development