| Stefan Goßner [MSFT] 2007-11-05, 1:24 pm |
| Hi Rich,
to access hidden channels you need to use the following code:
CmsHttpContext.Current.SessionSettings.AutoFilterHidden = false;
.... now access the channel.
Don't forget to change it back afterwards as this is a per-session setting.
CmsHttpContext.Current.SessionSettings.AutoFilterHidden = true;
Cheers,
Stefan
"Confused Richi" <Confused Richi@discussions.microsoft.com> wrote in message
news:54798778-2331-45DD-8F7D-3477378BD575@microsoft.com...
> Hi, I am new to MCMS and am having a bit of trouble coding the ASP.NET for
> one of my templates. I need to list out the postings for a hidden channel
> ("Hide When Published") and am hitting problems when I load the code in
> the
> "Live" state as it says the channel "managevacancies" channel is not set
> to
> an instance of an object. Does anyone know a way to access the hidden
> channel
> in the live/published state?
>
> 'Get the Manage Vacancies (managevacancies) channel
> Dim currentChannel As Channel = cmsContext.Channel
>
> Dim parentChannel As Channel = currentChannel.Parent
> Dim parentName As String = parentChannel.DisplayName
> Dim currentCollection As ChannelAndPostingCollection =
> currentChannel.AllChildren
> Dim manage_vac_chan As Channel =
> currentCollection.Item("managevacancies")
>
> Dim vac_collection As PostingCollection = manage_vac_chan.Postings
> '
> << Object reference not set to an instance of an object here...
>
> Thanks in advanced.
> Rich
|