Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 373
  • Last Modified:

Coldfusion dynamic site map

Is there a way to make a dynamic site map that consists of all the pages in my website? The pages themselves are not stored in a database. I want to display th epage title and a link to that page.
1 Solution
There is no way to just do this unless you have some logic in place preparing for this.

What I mean is you could do a combination of cfdirectory and cfif statements.
Basicly you'd "crawl" the top level directory making links to files then crawling subdirectories again making links again to files in each directory with a heading of the directory the files are in.

But the problem is (I don't know how you develop but in my case) most of the files found are not to be accessed directly.
so this is where my opening statement "some logic is place" has meaning.
like if you have a folder named "includes" where you have all your includes, you could then do
<cfif name neq "includes"> in your cfdirectory output. This would all get fairly complex but if you really wanted to do it.

To display the page title - you'd have to read the file with cffile and parse looking for <title> as start position and </title> as end position.

semerjAuthor Commented:
Thanks. I thought so.
maybe you can try this


If you created a cfschedule to spider your site on a regular basis it would probably do sort of what you want.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now