Navigation channelandpostingcollection
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Microsoft Content Management Server > Navigation channelandpostingcollection




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Navigation channelandpostingcollection  
darryl.clark@gmail.com


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-14-05 12:48 PM

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






[ Post a follow-up to this message ]



    Re: Navigation channelandpostingcollection  
Stefan [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-14-05 10:54 PM

Hi Darryl,

actually I would expect that AllChildren only contains the list of all
direct elements.
So from the list below only

> /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
----------------------


<darryl.clark@gmail.com> wrote in message
news:1131975467.621708.282760@o13g2000cwo.googlegroups.com...
>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
>







[ Post a follow-up to this message ]



    Re: Navigation channelandpostingcollection  
Sathish Kumar K


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-14-05 10:54 PM

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

> 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
>







[ Post a follow-up to this message ]



    Re: Navigation channelandpostingcollection  
darryl.clark@gmail.com


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-14-05 10:54 PM

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






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 04:24 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register