Organizing your pages

From Lift

Jump to: navigation, search

You can avoid cluttering the src/main/webapp/ folder with your view templates by storing them into sub folders.

+-src/main/webapp/
  +-pages
    +-tests
      -test.html
    +-catalog
      -products.html

test.html will be seen at /pages/tests/test and products.html will be seen at /pages/catalog/products

You will add new Menu objects and append them to your sitemap in the Boot.boot method like so:

src/main/scala/bootstrap/liftweb/Boot.scala (partial boot method):

val entries = Menu(Loc("Home", "/", "Home")) :: Menu(Loc("Test", "/pages/tests/test", "Test Page")) :: 
                Menu(Loc("Products", "/pages/catalog/products", "Test Page")) :: User.sitemap
Personal tools