Page 1 of 1

Alternative Nav Module

Posted: Thu Jan 27, 2005 5:19 pm
by sjg
Hi!

I've written an alternative navigation module, that's useful for doing a traditional "L-shaped" navigation scheme.

It's CSS-based, and expands the navigation according to the current page being viewed. It has a number of options to allow different functionality.

It currently works pretty well for small sites. It will need to have some database optimizations done for sites with hundreds of pages.

In implementing it, I wrote two functions that are added to the ContentManager. I don't know if these should kept local to my module instead; I think they may be useful elsewhere, which is why I thought to put them in the ContentManager. I'd appreciate it if some of the developers could give me guidance here...

I'd be happy to upload it or otherwise share it. Is there a standard place for uploading new modules?

Thanks,
___Samuel___

Alternative Nav Module

Posted: Thu Jan 27, 2005 5:22 pm
by Ted
Hello,

People usually post their modules here http://wiki.cmsmadesimple.org/pmwiki.ph ... tedModules, as we don't have a better place yet for them. :)

I'd definatly check it out, as I'd be interested in seeing what you did as far as modifications to the ContentManager.

Thanks!

Alternative Nav Module

Posted: Thu Jan 27, 2005 7:07 pm
by sjg
wishy wrote:Hello,

People usually post their modules here http://wiki.cmsmadesimple.org/pmwiki.ph ... tedModules, as we don't have a better place yet for them. :)

I'd definatly check it out, as I'd be interested in seeing what you did as far as modifications to the ContentManager.

Thanks!
OK. I posted it on the Wiki.

To install the module, place it in the modules directory. Since it's alpha code, you'll also have to follow the steps listed in the docs/README.txt, basically pasting the two new functions into the ContentManager.

Please let me know if there are suggestions for changes, or if it doesn't work, or if I've done something stupid somewhere ...

(I'm not very happy with at least one of the two functions I added to the ContentManager, since it forces a full table scan of the cms_content table. I needed a quick and dirty way of getting a hierarchy from the table, though. I'm sure I can come up with a more intelligent way of doing things. It's just at this point, I didn't want to start modifying tables or anything drastic. It's also possible -- likely, even -- that I overlooked a simple, better way of doing the right thing.)

Thanks,
___Samuel___

Version 0.2 Released

Posted: Wed Feb 02, 2005 1:33 am
by sjg
I just posted version 0.2 on the Wiki at http://wiki.cmsmadesimple.org/pmwiki.ph ... tedModules.

This is much improved. I switched to using recursion, which I should have done the first time around. I rewrote much of the code, and fixed numerous bugs. No doubt I created some new ones as well.

Let me know if there are any requested features, changes, or bugs!

Re: Alternative Nav Module

Posted: Tue Apr 26, 2005 2:03 am
by iNSiPiD
Hi sjg,

Does this menu solution still rely on DHTML/javascript or is it all controlled by the CSS?

If the latter, would there be any easy way to turn off the top/horizontal menu? I want the funcitonality for the vertical menu for which I have many elements that would not fit horizintally. I wa then going to include my own static horizintal navbar with just a few items.

Thansk for working on this alternative!

Re: Alternative Nav Module

Posted: Tue Apr 26, 2005 4:58 am
by sjg
This solution doesn't actually do anything to render the menu, other than to spit out links within unordered lists. You can then place whatever CSS on it you want.

The module itself outputs either a horizontal menu or a vertical menu, depending upon what parameters you pass to it. To get the L-shaped nav, you actually have to have two separate tags for the module. So, to answer your question, yes, you can have only the vertical menu. In fact, the "horizontal" or "vertical" orientation only changes the class called in the stylesheet.

Read the help carefully. There's one option, "showtoplevel" which defaults to 0 (off), which is may not be what you want if you only have a single vertical menu.

Let me know if you run into any problems with the module.

Thanks,
___Samuel___