Hi,

In addition to the usual primary menu (Home, List entries, Add entry,  
Log in/out, ...), I would like to introduce a secondary, record-aware  
menu to my site. The entries in this menu would contain, for example,  
"Edit current record", "Delete current record", "Show current  
record", ...
There are multiple types of records (which all have their own separate  
edit/delete/show/... snippet), and all of those link targets have a  
corresponding (currently hidden) entry in the sitemap.
So I thought it'd be nice if I could reuse the sitemap for this, by  
creating a separate Loc group for all the secondary menu entries for a  
given record type.

I am currently using SHtml.link and RequestVar's to handle links, e.g.

object requestedResource extends RequestVar[Box[T]](Empty)
object requestedReturnTarget extends RequestVar[Box[URL]](Empty)

SHtml.link("/edit", () => { requestedResource(Full(theRecord));  
requestedReturnTarget(Full(returnTarget))) }, "Edit")

Now I am wondering what's the best way to merge the functionality of  
the menu with SHtml.link.
How can I get a menu entry to use the current values of some  
RequestVars to generate its link, such as a "edit current record" menu  
entry?

Or would I have to bring the record-ID into the Loc in order to  
achieve something like this, such as
Menu(Loc("EditRecord", List("record",  
RecordOps.currentRecord.is.id.toString, "edit"), "Edit"))
and then use some pattern matching during dispatching to retrieve the  
record ID again?

Thank you,
Clemens

--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to