Forum Moderators: coopster

Message Too Old, No Replies

dynamically changing navigation order using php

dynamically changing navigation order using php

         

drooh

3:53 am on Mar 10, 2009 (gmt 0)

10+ Year Member



Ok, here is the scenario:

I have a content management system I have written myself. The website using it has 3 levels of navigation, for example

section a -> sub section b -> sub section c

I am looking for guidance in the best approach to being able to manipulate the ordering of these pages for the site.

All of the page content is stored in a mysql database.

the user needs to be able to change the order of the navigation items, so Im guessing this would be done using a "weight" field in the db that would use numbers to set the ordering.

what would a typical row look like for this cms?

Here is what I came up with

id
title
meta
page_name
section
sub1
sub2
html_code
weight

janharders

8:24 am on Mar 10, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



what exactly do you mean by changing the order of the navigation items?
should the user be able to make
section a -> sub section b -> sub section c
become
section c -> sub section a -> sub section b
?

drooh

1:03 pm on Mar 10, 2009 (gmt 0)

10+ Year Member



i think the very top level would not be changeable, just the 2 child sections

so for instance

section apple -> sub1 section bat -> sub2 section cat, sub2 section dog, sub2 section ear

could be changed to

section apple -> sub1 section bat -> sub2 section dog, sub2 section cat, sub2 section ear

or

section apple -> sub1 section bat, sub2 section ear -> sub2 section dog, sub2 section cat