PDA

View Full Version : code needed for showing sub cats in a list



rickyspires
03-16-2009, 07:31 PM
hello,

im having trouble getting sub cats to show in a drop down list.


<h3 class="menuheader expandable"<img src="images/d-blue.gif" style="margin-right:5px;">Test</h3>
<ul class="categoryitems">
{foreach from=$AllEventCategory item=arr}
- <a href="event-ticket.php?EventCategoryID={$arr.ID}">{$arr.Name}</a><br />
{/foreach}
</ul>

i can use the above code to show a drop down of the 5 main event categories.

as see here : www.eventtrafik.com ( in the top right box - under test).
- Arts & Culture
- Business & Exhibitions
- Entertainment
- Miscellaneous
- Music & Party

but, what code would i need to show the sub cats for each of these?

if you look here : www.eventtrafik.com ( in the top right box) you can see that i have hard coded each sub cat in by typing the url and id number for each sub cat. this takes a long time.

there must be a way to call the lists from the database ???

thanks
rick

CrazyChop
03-18-2009, 07:09 AM
This does not look like PHP to me. Are you by chance using the Smarty template engine?

rickyspires
03-18-2009, 10:57 AM
yes.

also, its a bit strange because the categories are arranged using drag-drop-folder-tree

http://www.dhtmlgoodies.com/index.html?whichScript=drag-drop-folder-tree

http://www.dhtmlgoodies.com/scripts/drag-drop-folder-tree/drag-drop-folder-tree.html


this is the structure in the database: (roughly)

Browse: (14 Rows) event
ID
EventRefNo
ProfileVisit
OwnerID
EventCategoryID
EventSubCategoryID
EventGenreID
EventThemeID


Browse: (55 Rows) event_category
ID
Name
Position
ParentID

(& a few more)...

thanks
rick