Static pages

Static Pages


Static pages just render their template. They are simpler version of custom pages.


@StaticPage
class ExampleStaticPage extends AbstractStaticPage("pages/index", "") {

}

Custom Pages


Custom pages render static html files.


@CustomPage
class IndexPage extends AbstractCustomPage {

    override protected def generate(): Unit = {
        DBHelper.withDbConnection(implicit conn => {
            val mainPages = PageService.getMainPages()
            val context = Map[String, AnyRef](
                "mainPages" -> mainPages.asJava,
                "currentUrl" -> "index.html",
                "page" -> mainPages.find(p => p.title == "Jakon").orNull
            )
            engine.render("content", "index", context)
        })
    }
}