Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic sitemap generation

Status
Not open for further replies.

webron

Programmer
Apr 16, 2000
47
NL
Imagine a dynamic website. The site consist of sections and pages.

home
intro
vacancies
vacancy 1
etc
contact

sections and pages are stored in separate tables

stblsections
----------------
SectionID int (primary key)
Title varchar
parentSectionID
sortorder int

stblpages
----------------
pageID int (primary key)
title varchar
sectionID int
sortorder int

is it possible to make a query (or view / stored procedure) that will return some sort of a sitemap?
I'm thinking something like this:

SectionID | pageid | title | level | sortorder
1 1 home 0 1
null 2 intro 1 1
3 null vacancies 1 2
null 3 vacancy 1 2 1
null 4 etc 2 2
null 5 contact 1 3
 
from where Level comes from?

Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top