I got this working, like this:

    Menu(Loc("Catchall", Pair(Nil, true), "", homepageTemp1 ::
Hidden :: Nil)) ::

If you add this as the last item in your sitemap, it will catch
everything that the other menus don't catch, and render it with the
template you defined in homepageTemp1.

This *almost* works for 404 handling, except you still get a 200 OK
response when you would expect a 404.  I am hoping there is some
mechanism in lift to let me change the status code to 404 for this
menu.

- Alex

On Dec 29, 11:10 am, Alex Black <[email protected]> wrote:
> In my effort to handle 404s without a redirect 
> (seehttp://groups.google.com/group/liftweb/browse_thread/thread/4a9806a63...),
> I am wondering if there is a way to add an item at the end of a
> sitemap which matches every url?
>
> E.g. Lift would look through the sitemap for a match, and always match
> on the last item if none of the others match.
>
> I've tried this:
>
>   val homepageTemp1 = Template({ () =>
>     <lift:surround with="default" at="content">
>       <h1>Found me!</h1>
>     </lift:surround> })
>
> with this at the end of my sitemap:
>
>     Menu(Loc("Catchall", Pair("" :: Nil, true), "", homepageTemp1)) ::
>
> But it doesn't work, it never matches.  However:
>
>     Menu(Loc("Catchall", Pair("bob" :: Nil, true), "",
> homepageTemp1)) ::
>
> That one does match one urls like mysite.com/bob and mysite.com/bob/
> 1234  etc.
>
> - Alex

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.


Reply via email to