| Author |
Message |
Guest
|
Posted:
Mon Nov 14, 2005 1:50 pm Post subject:
Navigation channelandpostingcollection |
|
|
I would like to build a sitemap from my channel and posting list.
However I have been playing around with channelandpostingcollection but
this seems to render the items in a non-hierarchial fashion as in the
following:
/Learning/environment/
/Learning/test/
/Learning/environment/nap/
/Learning/environment/rumble/
/Learning/environment/squish/
/Learning/environment/nap/default.htm
/Learning/environment/nap/nap.htm
/Learning/environment/nap/napSub/
/Learning/environment/rumble/rumble.htm
/Learning/environment/squish/squish.htm
/Learning/environment/squish/test.htm
The above uses the following code:
Dim chapost As ChannelAndPostingCollection =
chnStartChannel.AllChildren
chapost.SortByDisplayName()
Dim chnitem As ChannelItem
For Each chnitem In chapost
If chnitem.GetType.ToString =
"Microsoft.ContentManagement.Publishing.Channel" Then
Label1.Text &= chnitem.GetType.ToString & " " &
chnitem.Url & chnitem.SortOrdinal & " CH<br>"
Else
Label1.Text &= chnitem.GetType.ToString & " " &
chnitem.Url & chnitem.SortOrdinal & " PO<br>"
End If
Next
Whereas what I really want is
/Learning/environment/
/Learning/test/
/Learning/environment/nap/
/Learning/environment/nap/default.htm
/Learning/environment/nap/nap.htm
/Learning/environment/nap/napSub/
/Learning/environment/nap/napSub/test.htm
/Learning/environment/rumble/
/Learning/environment/rumble/rumble.htm
/Learning/environment/squish/
/Learning/environment/squish/squish.htm
/Learning/environment/squish/test.htm
So I really want to display a tree view type list really.
Any ideas folks. All help appreciated. As you can see unfashionably I
write in vb so translations from the popular C# would be much
appreciated.
Cheers
Clarkey |
|
| Back to top |
|
 |
Stefan [MSFT]
Guest
|
Posted:
Mon Nov 14, 2005 5:50 pm Post subject:
Re: Navigation channelandpostingcollection |
|
|
Hi Darryl,
actually I would expect that AllChildren only contains the list of all
direct elements.
So from the list below only
| Quote: | /Learning/environment/
/Learning/test/
|
Do you have a recursion or iteration to get to the child elements of these
two channels?
Cheers,
Stefan
--
This posting is provided "AS IS" with no warranties, and confers no rights
New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
Check out the new book as well: Advanced MCMS development:
http://tinyurl.com/8ugwj |
|
| Back to top |
|
 |
Guest
|
Posted:
Mon Nov 14, 2005 5:50 pm Post subject:
Re: Navigation channelandpostingcollection |
|
|
Stefan,
Thanks for your prompt reply.
Sorry, I had the code inside another sub that was being looped. I have
taken it out and put it in it's own sub and everything works fine now.
Cheers
Darryl |
|
| Back to top |
|
 |
Sathish Kumar K
Guest
|
Posted:
Mon Nov 14, 2005 5:50 pm Post subject:
Re: Navigation channelandpostingcollection |
|
|
Hello Clarkey,
You can try the sitemap sample available on the GOTDOTNET. It would help
you have more idea.
http://www.codeproject.com/aspnet/cmssitemap.asp
Regards,
Sathish Kumar K |
|
| Back to top |
|
 |
|
|
|
|