Own menu

Discuss phpwcms here, please do not post support requests, bug reports, or feature requests! Non-phpwcms questions, discussion goes in General Chat!
Post Reply
Jens
Posts: 6
Joined: Sat 11. Oct 2003, 14:17

Own menu

Post by Jens »

Hey Oliver,

I try to review your code in order to find a possibility to develop a tree menu. Thus I need to code a function like your "get_struct_data". However your function only sorts by "acat_struct" and "acat_sort" within your "articlecat" db table. Do you have any idea how I can use these columns to sort like a tree, i.e sub1 > sub1.1 > sub 2 ...

Don't worry about this question, you made a great job :D . If I will succeed coding this tree menu I will provide this code for phpwcms' community.

Thanks
Jens
User avatar
Oliver Georgi
Site Admin
Posts: 9900
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

Look at line 28 in content.func.inc.php

Code: Select all

$content["struct"] = get_struct_data ($db); //reads the complete structure as array
This solves your problem about how to read in the site structure.

With array $content["struct"] you can do what you want - sort, revert, combine, cut and so on. This is all you need to create also tree level menus. It's all in there. Do not create a new read out structure function - makes no sense to contact the database sencond time for that.

There is also a function to get all articles

Code: Select all

get_articles_data ($dbcon)
This gives you the ability to combine structure and articles.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
Post Reply