There's no “best practice” here, that I'm aware of, and kind of depends on how you've used Lift's binding-mechanisms and other Scala-language features. My best advice is to just upgrade and incrementally fix compiler-errors as they occur, and ask on this list if you get stuck.
Thank you for your response. Off the top of my head, the htmls use the lift: tags, and surround templates, some of the functions return FuncBindParams and BindParams which were removed and I have no idea how to replace these. I will replace the bind functions with Css selector transforms, what other changes will I need to make?
I don't remember, but you have to go all inn for CssSelectorTransforms, and also use data-lift=
instead of <lift:
-tags although I believe <lift:?
-tags should still work.
I'm not familiar with BindParam
and friends…
Note that in Boot.scala I have:
LiftRules.contentParsers = ContentParser(
Seq("lift", "liftfo"),
(content:InputStream) => S.htmlProperties.htmlParser(content),
identity[NodeSeq](_) // These templates are not surrounded by default
) :: LiftRules.contentParsers
This way we use .lift
for all our HTML-stuff (templates in Lift-speak).
Take this example:
In the folder templates-hidden
:
origo-main-template.lift
<!DOCTYPE html>
<html data-lift="menu.PageLanguageSnippet.render">
<head>
<title data-lift="Menu.title"></title>
</head>
<body>
<div id="mainContainer">
<div id="origo_menu">The main menu goes here</div>
<div id="content">The main content will get bound here</div>
</div>
</body>
</html>
origo-page.lift
<div data-lift="surround?with=origo-main-template">
<div id="top_menu" data-lift="bind-at?name=origo_menu">
<div data-lift="embed?what=origo-main-menu"/>
</div>
<div data-lift="bind-at?name=content">
<div id="main-content"/>
</div>
</div>
Then this template is referenced in Loc
/path/to/page-templates/someRealPage.lift
<div data-lift="surround?with=origo-page">
<div data-lift="bind-at?name=main-content">
<div data-lift="MyViewSnippet.render">
</div>
</div>
</div>
Hi,
Can you help me with the replacement for the lift:band tags that were used in the older versions of lift? I am aware that I am supposed to changed the lift:bind-at 's and others with data-lift=bind-at?.. etc, but cannot find anything for lift:bind?
I have no experience with lift:bind, sorry…