One option:
LiftRules.snippetDispatch.append { case "V1TestSnippet" => new v1.site.snippet.TestSnippet case "V2TestSnippet" => new v2.site.snippet.TestSnippet }
Then your fragments should inherit DispatchSnippet and define def dispatch = { case "test" => test _ } , etc. Then you call fragments from the template like V1TestSnippet or V2TestSnippet .
Alternatively, something like
LiftRules.snippets.append { case "V1TestSnippet"::"test"::Nil => (new v1.site.snippet.TestSnippet).test _ case "V2TestSnippet"::"test"::Nil => (new v2.site.snippet.TestSnippet).test _ }
I believe List is the name of the fragment in the template, broken into dots.
source share