Bubble Foundry


Using Lift’s Menu.params

by Peter.

Quick note for fellow Lift developers: I was happily using a Menu.param when I decided to use a Menu.params instead (see the ScalaDocs) in the hopes of both more descriptive URLs and less to calculate on the actual page. While implementing it wasn’t too hard, my new URL pattern for the menu entry was a little complicated:

Menu.params[MyObject](
  ...
) / "something" / * / * / "to" / *

I had a something.html Template but it wasn’t getting picked up and I was getting a weird 0 (yes, zero) status code returned when I requested the page, with the MyObject being initialized correctly.

The solution I came up with was to manually specify the Template for the Menu:

Menu.params[MyObject](
  ...
) / "something" / * / * / "to" / * >> Loc.Template(
  () => Templates(List("comparison")) openOr <div>Couldn't find template</div>
)

Thought it was worth sharing…