| Author |
Retrieve all postings from root channel and subchannel
|
|
|
| Could anyone show me how to retrieve all postings from the root channel as
well as postings from subchannels. Thank you very much.
| |
| Stefan Goßner [MSFT] 2007-06-15, 7:22 am |
| Hi,
you would need to iterate through all channel recursivly and then look at
the postings collection of each channel.
Cheers,
Stefan
"Mun" <Mun@discussions.microsoft.com> wrote in message
news:A7D6E762-1592-4125-8E00-15E80D434BC0@microsoft.com...
> Could anyone show me how to retrieve all postings from the root channel as
> well as postings from subchannels. Thank you very much.
| |
|
| Hello,
I am quite new to this. Do you have a sample code for that? Thank you.
Cheers
M
"Stefan Goßner [MSFT]" wrote:
> Hi,
>
> you would need to iterate through all channel recursivly and then look at
> the postings collection of each channel.
>
> Cheers,
> Stefan
>
>
> "Mun" <Mun@discussions.microsoft.com> wrote in message
> news:A7D6E762-1592-4125-8E00-15E80D434BC0@microsoft.com...
>
>
>
| |
| Stefan Goßner [MSFT] 2007-06-15, 7:22 am |
| Hi M,
something like this:
Channel c = cmsContext.RootChannel;
CollectChannel(channel);
static private void CollectChannel(Channel channel)
{
PostingCollection pc = channel.Postings;
// do something with the postings
foreach (Channel ch in channel.Channels)
{
CollectChannel(ch);
}
}
Be aware that you should not use such code in your website as it will impact
your site performance badly.
Cheers,
Stefan
"Mun" <Mun@discussions.microsoft.com> wrote in message
news:3A11121B-ADF0-4B5C-A31C-A18E52DDC30E@microsoft.com...[vbcol=seagreen]
> Hello,
>
> I am quite new to this. Do you have a sample code for that? Thank you.
>
> Cheers
>
> M
>
> "Stefan Goßner [MSFT]" wrote:
>
| |
|
| Thank you, Stefan.
Cheers
Mun
"Stefan Goßner [MSFT]" wrote:
> Hi M,
>
> something like this:
>
> Channel c = cmsContext.RootChannel;
> CollectChannel(channel);
>
> static private void CollectChannel(Channel channel)
> {
> PostingCollection pc = channel.Postings;
> // do something with the postings
>
> foreach (Channel ch in channel.Channels)
> {
> CollectChannel(ch);
> }
>
> }
>
> Be aware that you should not use such code in your website as it will impact
> your site performance badly.
>
> Cheers,
> Stefan
>
> "Mun" <Mun@discussions.microsoft.com> wrote in message
> news:3A11121B-ADF0-4B5C-A31C-A18E52DDC30E@microsoft.com...
>
>
>
|
|
|
|