Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:11
Milonic DHTML Menu with Etomite CMS
Poster: lloyd_borrett
Dated: Tuesday March 7 2006 - 22:01:08 GMT
G'day,
I've now successfully used the Milonic DHTML Menu as the main menu system with a number of web sites built using Etomite CMS (see http://www.etomite.org) which is PHP/MySQL based.
With the first few web sites, I kept the menu data as static .js data files. Obviously not an ideal solution for a CMS based web site where users often end up maintaining the web site and thus adding and deleting web site pages. Plus the ability to publish and unpublish pages at certain times is essentially lost.
Later I came across a basic "snippet" (essentially PHP code) that someone had built to generate the Milonic menu data out of the Etomite CMS document structure. I made it more user friendly, such that it could be more widely used by the Etomite community.
With this snippet in use, there are no menu data files to be maintained anymore. See http://www.etomite.org/forums/index.php?showtopic=3673.
So now I have some web sites where that snippet is being used. Plus quite a few other web site builders are successfully using the snippet and Milonic DHTML Menu on their Etomite based web sites as well.
The problem is, this snippet can only generate the menu data for two menu levels. Many of us have web sites that require more levels of menus to be supported.
My PHP skills aren't good enough to enable me to tackle writing a new version of the snippet that properly uses recursion to generate a menu with all, or just x number of, levels of menus included.
I'm hoping someone who understands both PHP and Milonic DHTML Menu might be able to collaborate with me to achieve this for the Etomite CMS community.
Best Regards, Lloyd.
Poster: Andy
Dated: Wednesday March 8 2006 - 14:08:44 GMT
Hi Lloyd,
I'd like to help but I can only offer a small amount of my time. As you can imagine I get pulled in all directions and time is a little scarce for me at the moment.
If you can send over some kind of structure as to how the menu needs to be built that may help.
Also, if you could get the menu data into an XML file that would make life easier for all of us. There is an XML PHP Menu builder that accompanies the menu download that I think would be the best way to go.
Cheers,
Andy
Poster: lloyd_borrett
Dated: Wednesday March 8 2006 - 23:14:44 GMT
G'day Andy,
With Etomite CMS, we can build an XML file. Indeed, there is already a GoogleSiteMap_XML snippet that does this. You can see an example of this snippet in action at http://www.winenergy.com.au/winenergy-google-sitemap.html. The entire page is generated by the snippet (see http://www.etomite.org/forums/index.php?showtopic=2560) every time the page is requested.
With the Etomite CMS, current best practise is to build menus from snippets every time a page is called. I know menus are fairly static things, but Etomite CMS doesn't yet support a way to generate new static menu files whenever an event that changes the menu data occurs.
Etomite CMS supports having administrators specify that pages be published and/or unpublished at specified times, as well as be moved to a different part of the document tree, added, deleted or edited to change the page identifiers. Thus building the menus for each page every time the page is requested, is the best way to support these features for now. Building static menu data files from an XML document just wouldn't work.
The existing 2-level MilonicMenu snippet (see http://www.etomite.org/forums/index.php?showtopic=3673) is used to put all of the Milonic Menu information and data into the body of the XHTML document. See http://www.winenergy.com.au/home.html for an example web page where this is happening. It actually does this as two snippets. One to generate the details for the top level menu that is called where this menu is to be displayed. The other for the calls to the Javascript and the actual bulk of the menu data, the output of which is positioned just after the body tag.
With Etomite CMS, typically you don't make a SQL query of the document table from the database directly in the snippets to get the menu data, though that is an option if you desire to do it that way. Most snipets just use the appropriate Etomite API functions to access the data.
You can see those API functions at work in the existing 2-level MilonicMenu snippet.
Basically, you can get the complete details of a document. If it's published (active) or not. If it is a folder. If it has children. From this it's pretty easy to build a basic list style menu snippet (see http://www.etomite.org/forums/index.php?showtopic=861) or a site map snippet (see http://www.etomite.org/forums/index.php?showtopic=858) with plenty of configurable options.
My problem is that the Milonic menu data isn't a simple list. The data for each menu is brought together into separate but related "clumps" of data. Thus to handle generating x-level Milonic Menu data, recursive functions are required to group together that information on the pass through the document table structure and then output it appropriately at the end.
I'm confident I can handle the frills around the basic function structure. That is, the initial menu details that have to be output, coding in different menu options etc. I've already done that for the existing 2-level Milonic Menu snippets. What I need now though is the basic function structure to gather and group together the Milonic Menu data for x-levels.
I can certainly appreciate you have other priorities Andy. This is not something I must have tomorrow. However, it is something I know a lot of people would like to have and I've kept coming back to it over the last 6 months without success. So now I'm asking for some help from others with better PHP skills than me. If you can help sometime, I am sure many in the Etomite CMS community would appreciated it.
Best Regards, Lloyd.