Alternative Nav Module

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
User avatar
sjg
Power Poster
Power Poster
Posts: 310
Joined: Thu Jan 27, 2005 5:11 pm
Location: Los Angeles, CA

Alternative Nav Module

Post 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___
Many modules available from the http://dev.cmsmadesimple.org
The CMS Made Simple Developer Cookbook is now available from Packt Publishers!
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm
Location: Fairless Hills, Pa USA

Alternative Nav Module

Post 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!
User avatar
sjg
Power Poster
Power Poster
Posts: 310
Joined: Thu Jan 27, 2005 5:11 pm
Location: Los Angeles, CA

Alternative Nav Module

Post 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___
Many modules available from the http://dev.cmsmadesimple.org
The CMS Made Simple Developer Cookbook is now available from Packt Publishers!
User avatar
sjg
Power Poster
Power Poster
Posts: 310
Joined: Thu Jan 27, 2005 5:11 pm
Location: Los Angeles, CA

Version 0.2 Released

Post 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!
Many modules available from the http://dev.cmsmadesimple.org
The CMS Made Simple Developer Cookbook is now available from Packt Publishers!
iNSiPiD

Re: Alternative Nav Module

Post 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!
User avatar
sjg
Power Poster
Power Poster
Posts: 310
Joined: Thu Jan 27, 2005 5:11 pm
Location: Los Angeles, CA

Re: Alternative Nav Module

Post 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___
Many modules available from the http://dev.cmsmadesimple.org
The CMS Made Simple Developer Cookbook is now available from Packt Publishers!
Post Reply

Return to “Modules/Add-Ons”