Loading...
 
Development

Development


Re: Table of Content as Menu

posts: 4656 Japan

I tried an experiment in which I dumped a structure, which outputs a list of the items indented according to depth in the hierarchy, and then added asterisks to make this a group of nested wikisyntax-style unordered lists. (Well, this dumped list is just text, not links, so I added the double parentheses to make the items links.) I then put all this in a div with class="clearfix cssmenu_vert", and used this for the data of a new module. The top items displayed ok, and the children were hidden until the mouseover, but there's a problem displaying the children — the dropdown loses focus and disappears as soon as the mouse leaves the module box or page column. I didn't check closely to see if all the needed CSS is there for this type of menu, but I think this method has potential. You can check the result ("Family Favorites") at cunningham-lee.com.

I didn't try other types of menus, as css (suckerfish) is easy since it only needs an html list for the items. Also I didn't check if there's an easier (automatic) way to get the list directly from a maketoc tag when the tag is not inside the top wiki page of the structure as usual (like, is there are id parameter? How else can one specify which structure to use in the menu if it's in a module?).

Previously, I put a div with the cssmenu classes around a maketoc tag in a page and that worked to make a dropdown menu. But in that case the maketoc list was created as usual and all I did was add the styling.

The cssmenu stylesheets are in the css/ directory in Tiki 2.0 if you want to experiment along this path.

-- Gary

There are no comments at this time.