CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge -> General/Other

 navigation for hierarchical structured pages

Print topic Send  topic

Author Message
Rob
Posted: 04/05/2004, 7:30 AM

I want to build a (simple) content management like system and try to discover how I can do the navigation in CC. I use PHP and mySQL.

I want to have a top navigation bar with another navigationbar on the left for any subpages.

This is my table-setup:
Table 1 (pagecontent):
Article_ID, contents, pagenumber.
Contents contains the content of a page (sounds funny huh). Every article refers to a specific pagenumber.

Table 2 (Pagestructure):
page_ID, pagenumbers, pagenames, parent.
Parent refer to parent_ID's.
So the toppages of the hierarchy have a parent of value 0, subpages have values refering to those toppages.

My problem is that I do not get CC to come up with a good way of presenting the navigation structure. I also tried it with tree's, but that didn't do the tric.

Any suggestions?
Rob
Posted: 04/14/2004, 2:45 AM

Does anybody have a clue?
paporter
Posted: 04/14/2004, 3:42 AM

Take a look at the portal sample Rob; it does exactly what your trying to do. You will probably want to do some customizing to make it yours but the technique is there for you.

HTH;

Paul
Rob
Posted: 04/20/2004, 7:54 AM

Actually not Paul, because you cannot change the structure of pages: Events, Links;Club Officers are all pages set before.

I want to be able to change the structure of pages itself. So today I'll have a site with 5 pages and 3 subpages, next week I've changed that to a site with 10 pages and 20 subpages for instance.

That's why I try to do it with a parenting system, so for instance a database could look like this:
pageID, pagename, parent_to_pageID
0,index,0
1, projects,0
2, news,0
3,contact,0
4, newsitemA,2
5, newsitemB,2

So, in the above example pages 4 and 5 are subpages of News.

My problem is that I cannot get CC to show the subpages.

Anyone other suggestion? Can Yes step in here?
peterr


Posts: 5971
Posted: 04/20/2004, 2:22 PM

Rob,
I recommend that you describe in more detail about what didn't work when trying to use the Tree component. I don't know if Tree should work in your case, but someone could try to help you utilize it.
Otherwise your only option may be to create a Label and then in Before Show event create your own function (custom code) that outputs the navigation as you want it. You'd read the database records in a loop and output the HTML as needed.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
paporter
Posted: 04/21/2004, 4:35 AM

Quote Rob:
Actually not Paul, because you cannot change the structure of pages: Events, Links;Club Officers are all pages set before.
[SNIP]
Anyone other suggestion? Can Yes step in here?

Sorry Rob I missed the jest of what you were trying to do.

Paul
Rob
Posted: 04/21/2004, 1:43 PM

What I want almost looks like a tree setup, but it is different:

What I want in the end is what you see in almost every 'standard' website:

a top menubar with main categories plus a side menubar with subcategories and then the main area for content. Simple as that.

Tree is a more or less integrated way of the above but not the same. And I want the 'standard' way, not the tree way.

Hopes this explains it better...
peterr


Posts: 5971
Posted: 04/21/2004, 2:07 PM

This sounds similar to our CC-generated page at http://www.gotocode.com/apps.asp?app_id=3
There is a menu at the top and a menu to the left. You can download that project from http://www.gotocode.com/apps.asp?app_id=17

The left menu is dynamic, while the top menu is static.
This page doesn't use multi-level menu (with subcategories), but this should not be a problem. Instead fo a menu you can use a Label, then in the Before Show event write a loop that reads database records and creates menu items appropriately.
Please also refer to the thread at http://forums.codecharge.com/posts.php?post_id=45834 , which is about CCS, but would apply to CC as well. You can take a any JavaScript menu and dynamically create the array of items that it needs.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Steven

Posts: 15
Posted: 04/23/2004, 11:21 AM

Rob

you could add a column into the mysql table used for the tree/categories

id , cat, par_cat, "menu_item"

edit the admin categories/tree page to add a tick box to tick on/off th emenu_item to a 0 or 1

then make a grid with url links from it as the menu's you want

so that on a main page you are selecting top menus links by

select * from categories where par_cat=0 and menu_item=1

on your links pass the par_cat to the next page vai the url, so that any clicked item can have customised sub menu's showing on the next page

http://www.domain.com/pagestuff4.php?par_cat=4

then for a seperate grid of side menu links, you could take a parameter from this clicked url to show only sub menus that are set to show in a menu

select * from categories where par_cat=4 and menu_item=1

you can use the get param stuff to grab the 4 from the url, then choose all the sub menus from that category where you have set in category admin, the menu_item to be a 1

hope this makes sense

Steven




_________________

View profile  Send private message
Rob
Posted: 04/27/2004, 1:59 PM

makes good sense, I will follow that lead steven, I hope I can do it

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by UltraApps.com  and YesSoftware, Inc.