[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 224
  • Last Modified:

Sitemap based off site folder structure

Hi

I would like to create a sitemap for a large static site.  Each page on the site has its own folder - e.g.

home
-->about_us
-->contact_us

so within the about_us and contact_us folders we have index.asp files.  The folders can have several levels of child folders.

Is it possible to generate a sitemap based off the folder structure or will it have to be a manual job?

Thanks
0
Jackass03
Asked:
Jackass03
  • 4
  • 3
1 Solution
 
pgkooijmanCommented:
You could look through the sub folders:

Set fsRoot = fsFileSystem.GetFolder(strDirectory)
Set RootFolders = fsRoot.SubFolders
For Each Folder IN RootFolders
    Response.Write "HTML for Sitemap"
Next

0
 
Jackass03Author Commented:
Hi

I have given that a go and it gives you the full path to all the top level folders.  Is there anyway to display the folder name and its sub folders in a list?

here is my code so far:

<%

set fsFileSystem = CreateObject("Scripting.FileSystemObject")

path ="D:\\www"

Set fsRoot = fsFileSystem.GetFolder(path)
Set RootFolders = fsRoot.SubFolders
For Each Folder IN RootFolders
    Response.Write Folder
Next
%>

Hope you can help
0
 
Jackass03Author Commented:
Folder.Name will return the foldername - just stuck on making into a list with the child folders
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
kevp75Commented:
what are you trying to do.....drill down through the folders?
0
 
kevp75Commented:
try this out

<%
Set FSO = CreateObject("Scripting.FileSystemObject")
ShowSubfolders FSO.GetFolder("d:\path to your folder")
Sub ShowSubFolders(Folder)
    For Each Subfolder in Folder.SubFolders
        response.write Subfolder.Path & "<br />"
        ShowSubFolders Subfolder
    Next
End Sub
%>
0
 
Jackass03Author Commented:
kevp75 - thats cracking, do you know how you could display the different levels as a <ul> list?
0
 
Jackass03Author Commented:
kevp75 - all sorted, just banged in a response.write <ul><li> before the function and closed it off after.

Thanks again
0
 
kevp75Commented:
perfect.  no prob, thanks for the points :)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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