Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion paramitized menus
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
David Pollak  
View profile  
 More options Aug 1 2011, 3:41 am
From: David Pollak <feeder.of.the.be...@gmail.com>
Date: Mon, 1 Aug 2011 09:41:14 +0200
Local: Mon, Aug 1 2011 3:41 am
Subject: Re: [Lift] Re: paramitized menus

On Sun, Jul 31, 2011 at 11:51 PM, bishop155 <chrisjbishop...@gmail.com>wrote:

> They is one entry per url I'm trying to achieve (/category/1, /
> category/2), seams abit strange (to me) that the Loc isnt decoupled
> from the menu, so the the loc should match /category/*, but the menus
> be able to point to that Loc with a paramaters, IE /category/1 & /
> category/2.

Loc and Menu are in fact and intentionally intertwined.  I do not see why
this is a problem.

If you want to generate a URL from a Loc, use the createLink method which is
type-safe.  You can display all manner of generated links on the page
where-ever you what, however you want.

> I am a novice with lift, I come from a zend framework background which
> lets me do the described above very easily, which leads me to believe
> I'm doing it wrong or Im missing the point.

> The Loc.Link class seams abit overloaded to me, it used for a)
> generating the url, b) finding the template and c) matching the
> request. This seams to leave the only option is to write a custom Loc,
> where you specify the different Loc parameters separately?

Did you look at Menu.param or Menu.params?  See
http://simply.liftweb.net/index-Chapter-3.html#toc-Chapter-3 and
http://simply.liftweb.net/index-3.2.html#toc-Section-3.2

If you can describe your use case, it would have getting you to the answer
you want rather than trying to map your existing knowledge onto Lift.

> I greatly appreciate your help.

> On Jul 26, 5:32 am, David Pollak <feeder.of.the.be...@gmail.com>
> wrote:
> > On Tue, Jul 26, 2011 at 3:17 AM, Naftoli Gugenheim <naftoli...@gmail.com
> >wrote:

> > > Maybe one day, the menu hierarchy as rendered by the menu snippet
> should be
> > > decoupled from the set of menu entries that define the SiteMap itself
> (as
> > > used for page access etc.), with the rendered tree defaulting to the
> same as
> > > the actual SiteMap. This way, the SiteMap implementation remains the
> same,
> > > but there's much greater flexibility (for those that want to write the
> > > explicit code) in terms of how to display it.

> > That'd be great.

> > Given that the Menu snippets could be user-written code, there's nothing
> > magic about them.  If we see patterns of usage that go beyond the current
> > implementation, I'm all for enhancing the existing snippets or adding
> > snippets to reflect those patterns... but so far, I haven't seen
> patterns...
> > but if others are seeing the patterns, let's reduce them to
> > enhancements/additions to the existing menu/sitemap snippets.

> > > On Mon, Jul 25, 2011 at 5:13 AM, David Pollak <
> > > feeder.of.the.be...@gmail.com> wrote:

> > >> You can only have 1 menu entry per URL.  You cannot do what you're
> trying
> > >> to do.  Sorry.

> > >> On Fri, Jul 22, 2011 at 1:15 AM, bishop155 <chrisjbishop...@gmail.com
> >wrote:

> > >>> I want to create a Menu which has multiple items which differ in only
> > >>> the parameter passed. I'm pritty close:

> > >>> case class Test(id: String);

> > >>> var test = Menu.param[Test]("Test-1", "Test-1",
> > >>>                        s => {Full(Test(s))},
> > >>>                        pi =>{
> > >>>                                pi.id
> > >>>                        }
> > >>>                ) / "category" / * >> Loc.CalcValue(() => {
> Box(Test("1"))
> > >>>  } )>>
> > >>>                Loc.Template(() =>
> > >>> TemplateFinder.findAnyTemplate(List("category")).openOr(<div>Template
> > >>> not found</div>) );

> > >>>                var test2 = Menu.param[Test]("Test-2", "Test-2",
> > >>>                        s => {
> > >>>                                Full(Test(s))
> > >>>                        },
> > >>>                        pi => {
> > >>>                                pi.id
> > >>>                        }
> > >>>                ) / "category" / * >> Loc.CalcValue(() =>
> Box(Test("2"))
> > >>> )>>
> > >>>                Loc.Template(() =>
> > >>> TemplateFinder.findAnyTemplate(List("category")).openOr(<div>Template
> > >>> not found</div>) );

> > >>> val entities =  test :: test2 :: Nil;

> > >>> SiteMap.enforceUniqueLinks = false;

> > >>> But it always matches the first menu item, and never the second. is
> > >>> there a way I can change the doesMatch_? function? (Ive successfully
> > >>> managed to achieve this by writing a custom loc, wondering if theres
> > >>> another/better way to do it?)

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

> > >> --
> > >> Lift, the simply functional web frameworkhttp://liftweb.net
> > >> Simply Lifthttp://simply.liftweb.net
> > >> Follow me:http://twitter.com/dpp
> > >> Blog:http://goodstuff.im

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

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

> > --
> > Lift, the simply functional web frameworkhttp://liftweb.net
> > Simply Lifthttp://simply.liftweb.net
> > Follow me:http://twitter.com/dpp
> > Blog:http://goodstuff.im

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

--
Lift, the simply functional web framework http://liftweb.net
Simply Lift http://simply.liftweb.net
Follow me: http://twitter.com/dpp
Blog: http://goodstuff.im

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.