A database structure I need to stay with.
I have an XML format I need to stick with.
I just need a php file that takes my database, and makes the correct xml format… argh:pirate3:
Database structure:
id_field which is just a primary key field
parent_field which is equal to id_field if a submenu, otherwise it is 0, which means it's a main menu item
name_field which is just the name that appears on the menu item.
XML structure needed:
<?xml version="1.0"?>
<menu name="links">
<item name="Carabiners" action="getRecords" variables="Carabiners"/>
<item name="Harnesses" action="getRecords" variables="Harnesses"/>
<item name="Quick Draws" action="getRecords" variables="Quick Draws"/>
<item name="Ropes" action="getRecords" variables="Ropes"/>
<menu name="Miscellaneous" action="getRecords" variables="Miscellaneous">
<menu name="Colors">
<item name="White" action="getSubSubRecords" variables="White"/>
<item name="Black" action="getSubSubRecords" variables="Black"/>
<item name="Blue" action="getSubSubRecords" variables="Blue"/>
<item name="Green" action="getSubSubRecords" variables="Green"/>
</menu>
<menu name="More Colors">
<item name="White" action="getSubSubRecords" variables="White"/>
<item name="Black" action="getSubSubRecords" variables="Black"/>
<item name="Blue" action="getSubSubRecords" variables="Blue"/>
<item name="Green" action="getSubSubRecords" variables="Green"/>
</menu>
<menu name="More Colors">
<item name="White" action="getSubSubRecords" variables="White"/>
<item name="Black" action="getSubSubRecords" variables="Black"/>
<item name="Blue" action="getSubSubRecords" variables="Blue"/>
<item name="Green" action="getSubSubRecords" variables="Green"/>
</menu>
<menu name="Manufacturer">
<item name="Black Diamond" action="getManufacturer" variables="Black Diamond"/>
<item name="Petzl" action="getManufacturer" variables="Petzl"/>
</menu>
<item name="Professional" action="getSubRecords" variables="Professional Series"/>
<item name="Intermediate" action="getSubRecords" variables="Intermediate Series"/>
<item name="Sport" action="getSubRecords" variables="Sport Series"/>
<item name="Beginner" action="getSubRecords" variables="Beginner Series"/>
</menu>
</menu>
I have looked through several tutuorials and such, but having a very difficult time working a solution for the submenu and subsubmenu items in this scenario.
this actually is using the same format that is found on an XML flash driven menu here on this site… any ideas? or any way that others allow people to buld dynamic menu structures, and then also display them… with sub sub sub menus and such?
thanks