Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

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:29

Dynamic Menu's (not DB driven) Possible?


Poster: fiscus
Dated: Thursday May 13 2004 - 3:44:51 BST

Hi,

It's been awhile since i have been in here, so it is good to see that development is still going strong.

I purchased and setup the menu a couple of years ago and have now moved my site to a CMS (phase) system. I was hoping that it is possible to have the menu dynamically created based on what pages/links i have on my webhost.

I have been searching through the forum all morning and all the dynamic menu threads seem to rely on MYSQL DB's to pull the menu data from. While I am running PHP and MYSQL DB's I'm not entirely sure how cretaing a DB with dirs/links of my webpage really works? Shouldn't the idea of having a dynamic menu be that the menu is dynamically created from what is on your server rather than pull info from a DB? How is the DB updated with new files/dirs/etc?

Anyway, basically I am hoping there is a way to create the menu dynamically based on what files i have in a dir.

Say I have a dir /test/

and in there there is
1.html
2.html
3.html
etc.html

I want the menu to list these pages as links. But say I go into my CMS system and delete 2.html and add a new page called new.html. I want my menu to reflect these changes.

Just wonder what the best way of achiving this? Maybe I am confused about the Mysql DB and that is really the best method - but i'm still not entirely sure how the data is put into the DB (is that dynamic? if so, how is it entered?).

What are other peoples throughts/codes/and setup for running a dynamic milonic menu with CMS systems.

Thanks in advanced and sorry for the long post.

EDIT - fixed some spelling and some text.


Poster: fiscus
Dated: Wednesday May 19 2004 - 13:15:36 BST

Hey guys - lots of views but no help yet :(


Basically I am trying to intergrate milonic menu into Phase CMS.
Phase CMS is a new (and personally I think the BEST CMS software package around).

It has only recently been started and it already blows most packages out of the water. You can get it / read up on it here

http://www.cookiebean.com/

I have seen the code in this link http://www.milonic.com/forum/viewtopic.php?t=3228 and I think this is what I need to edit.

The current php code for Phase to display a menu from the DB is

Code:
$sql = "SELECT id, pagetitle FROM $dbase.".$table_prefix."site_content WHERE $dbase.".$table_prefix."site_content.parent=0 AND $dbase.".$table_prefix."site_content.published=1 AND $dbase.".$table_prefix."site_content.deleted=0 ORDER BY $dbase.".$table_prefix."site_content.menuindex ASC;";
$rs = $db->Execute($sql);
$limit = $rs->RecordCount();
$menu1 = "";

for ($y = 0; $y < $limit; $y++) {
   $menu1src=$rs->FetchRow();
   $menu1.="<a href='index.php?id=".$menu1src['id']."'>".$menu1src['pagetitle']."</a><br />\n";
}
$menu1.="";
$MainMenu=$menu1;


does anyone have ANY idea how to edit/combine these two pieces of code so I can get the milonic menu to intergrate with phase and display the pages from the DB.

Many Thanks.

Do you mean this?


Poster: Willem
Dated: Wednesday May 19 2004 - 15:06:07 BST

I have a sample of an menu from a mysql database

http://www.members.lycos.nl/emaus/menusample.php

willem


Poster: Maz
Dated: Wednesday May 19 2004 - 15:58:36 BST

Willem,

That is a really nice example. :D

But I see this is version 3, time for an update to the new menu system?

maz


Poster: fiscus
Dated: Wednesday May 19 2004 - 23:41:54 BST

Willem,

Any chance you could post your code/give a tute on how to do what you have done?

Would be great if you could upgrade to Milonic 5 and then explain.

Re: Dynamic Menu's (not DB driven) Possible?


Poster: mfurf
Dated: Friday May 28 2004 - 17:10:50 BST

fiscus wrote:
Hi,


Say I have a dir /test/

and in there there is
1.html
2.html
3.html
etc.html

I want the menu to list these pages as links. But say I go into my CMS system and delete 2.html and add a new page called new.html. I want my menu to reflect these changes.

Just wonder what the best way of achiving this? Maybe I am confused about the Mysql DB and that is really the best method - but i'm still not entirely sure how the data is put into the DB (is that dynamic? if so, how is it entered?).


Fiscus: I think you want to do menu maintenance manually until such time as you have designed a menu generator into your db code. Seems to me there's not much need for dynamic generation when doing simple menu changes. My understanding of dynamic db-driven generation is that menus change relative to user choices and clicks.

Just manually delete or replace the menu item in your menu data file and make sure it points to the location of the new.html.

I haven't had a look at the generator that Andy was developing. I'm not sure if it's up and running. Anyone with some relational db knowledge could design their own generator. I keep telling myself I'm going to design one for offline use, but then there's only 24 hours in the day. But :D give me time..... /mfurf