Navigation in depth

1 view
Skip to first unread message

Rayservers

unread,
Oct 24, 2009, 10:42:42 AM10/24/09
to webl...@googlegroups.com
Its the weekend again and I'm grokking lisp. Is there a quick example somewhere
on using the navigation widget to create deeper menus:

+home
+ foo
+ bar
- blog
- cat 1
- art1
- art2
+ cat 2
+ cat 3
- contact

For instance? I looked in tests and found some info, but nothing immediately
working. From a UI usability perspective, I like top level menus across the top,
second level menus below this and the third level across the left, like our
current non-css html-only tables-based blog. Got to learn css. I'm old
fashioned. heh. See http://www.rayservers.com/blog for the menu.

Cheers,

---Venkat.

Leslie P. Polzer

unread,
Oct 24, 2009, 11:20:42 AM10/24/09
to weblocks
On Oct 24, 4:42 pm, Rayservers <rayserv...@gmail.com> wrote:
> Its the weekend again and I'm grokking lisp. Is there a quick example somewhere
> on using the navigation widget to create deeper menus:

You just nest navigation widgets, for example:

(make-navigation "First level"
"Second level" (make-navigation "Second level" ...))

For the actual appearance you need to modify the menu CSS (or the way
your
navigation widget is rendered into HTML, but I don't recommend that).

Leslie

Ray Servers

unread,
Oct 24, 2009, 2:01:15 PM10/24/09
to webl...@googlegroups.com
I had guessed as much, but I must have messed up the syntax. Lets see...

Coolness. Now I can port the blog. Here is the trivial code for those that come
upon this via google...

(weblocks:defwebapp globalisles.net :prefix "/")

(defun init-user-session (comp)
(setf (weblocks:composite-widgets comp)
(make-main-page)))

;; --------------------------------------------------------------


;; Main page is the navigation with children


;; --------------------------------------------------------------


(defun make-main-page ()
(make-navigation 'navigation
'main (make-main-widget)
'blog (make-navigation 'blog
'cat1 (make-cat1-widget)
'cat2 (make-cat2-widget))
'admin (make-admin-widget)))


;; --------------------------------------------------------------


;; Stubs for test


;; --------------------------------------------------------------



(defun make-blog-widget ()
"Hello blog2")

(defun make-main-widget ()
"home page")

(defun make-admin-widget ()
"123")


(defun make-cat1-widget ()
"cat1")

(defun make-cat2-widget ()
"cat2")

Now, on to CSS.

A CMS for these Global Isles...

Cheers,

---Venkat.

http://www.rayservers.com/

>
> Leslie
> >

Reply all
Reply to author
Forward
0 new messages