Navigation channelandpostingcollection
Windows Server Forum Index Windows Server
Server discussion on Windows platform.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web winserverhelp.com
Navigation channelandpostingcollection

 
Post new topic   Reply to topic    Windows Server Forum Index -> CMS Server
Author Message
Guest






Posted: Mon Nov 14, 2005 1:50 pm    Post subject: Navigation channelandpostingcollection Reply with quote

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 Reply with quote

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 Reply with quote

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 Reply with quote

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
 
Post new topic   Reply to topic    Windows Server Forum Index -> CMS Server All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




New Topics Powered by phpBB