Hi,
I am playing around with weblocks again, with the goal of rewriting
some mess I made before with hunchentoot and cl-who into something nice.
So it is early days for me in understanding weblocks, but I seem to have
trouble using the navigation widget.
By itself the navigation widget works fine, but if I nest two navigation
widgets it seems to have issues. The most simple case is:
(make-navigation "ROOT"
"A" (make-navigation "A"
"A-a" (make-widget "A-a")
"A-b" (make-widget "A-b"))
"B" (make-widget "B"))
So the navigation looks like
A ---- A-a
| \- A-b
B
When you first access the webpage with
http://localhost:8899
You get displayed the default selection in each menu, which is good, it
shows:
A -- A-a
However if you now click on A-b it will throw an error:
Resource /a-b not found
(The Url it tries to fetch is: http://localhost:8899/a-b )
If you first click on B and than on A and than A-b it works, becuase
the url is changed so it includes the toplevel selection:
http://localhost:8899/a/a-b
Not knowing the internals that well, it seems to me that the first
URI token is used to look up the toplevel menu item, which seems
reasonable. In the first case however, when clicking on A-b,
it does not add the default path upto A-b in the URL,
so the URI token /a is missing.
Now to me the way to fix this is by making sure that when
you select a menu item, the full URI token path upto that item
should be included in the URL.
However this has one drawback, when I briefly looked at it, I saw
in the documentation that a 'nil' key was explicitly allowed
and to be used to be the default selection, so if I want
the toplevel menu [A] to be the default and use the NIL key for that,
it will never generate an URI token and clicking in the submenu
will always fail.
So any ideas how to reconcie this?
One way is to have the following behaviour:
- Do not allow using NIL as a key for default, but add an explicit
keyword e.g. :DEFAULT as a way to indicate the default.
- When there is no URI token present, like now, use the :DEFAULT pane.
- When clicking a menu item, generate a full URI token path (at least up
to clicked item). For default items use the URI token DEFAULT.
However this looks a big ugly.
Another way is to enforce global uniq URI tokens for each navigation
widget. In that case it could be possible to not peel items of
the URI token list, but just see if the token is present somewhere in
the list and use that for the selection.
This of course means that URLs like
.../A/B/C are equivalent to .../B/C/A
all permutations are the same.
Also note, as I said, I might want to try to fix this, but
I am not very well versed in weblocks and I would like some
guidance about the approach to take.
Kind regards,
Wim Oudshoorn.
--
You received this message because you are subscribed to the Google Groups
"weblocks" 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/weblocks?hl=en.