Microsoft Content Management Server - Channel Render Script and Default Pages

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > April 2006 > Channel Render Script and Default Pages





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Channel Render Script and Default Pages
awburns@gmail.com

2006-04-01, 2:40 pm

I've created a Channel Rendering Script for Channels that contain no
pages. Basically, it's my template, less the content placeholders. It
has all the things it needs like the Web Authoring console, etc..

The problem I have is, when you create a page and publish it, if you
then go to that Channel's URL, you still get the Channel Rendering
Script page, and not the new posting. The posting is definitely there -
it can be found by it's URL - but it isn't behaving as a default.

I've got the Channel configured to set the first page as default. I've
tried using a named page as default. Both times, same result - I only
ever get the Channel Rendering Script page, and not the default
posting.

How do I get it to display the default posting. I'm happy to do this by
named post, first post, whatever, I just want to get away from the
Channel Render Script's page!

Stefan [MSFT]

2006-04-01, 2:40 pm

Hi,

this behaviour is by design. If you add a channel rendering script then the
channel URL will always open this channel rendering script.
What you now have to do is to add some logic to the Page_Load event handler
that checks if a posting exists in the channel and if yes redirects to this
posting.

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


<awburns@gmail.com> wrote in message
news:1143813114.656817.148740@e56g2000cwe.googlegroups.com...
> I've created a Channel Rendering Script for Channels that contain no
> pages. Basically, it's my template, less the content placeholders. It
> has all the things it needs like the Web Authoring console, etc..
>
> The problem I have is, when you create a page and publish it, if you
> then go to that Channel's URL, you still get the Channel Rendering
> Script page, and not the new posting. The posting is definitely there -
> it can be found by it's URL - but it isn't behaving as a default.
>
> I've got the Channel configured to set the first page as default. I've
> tried using a named page as default. Both times, same result - I only
> ever get the Channel Rendering Script page, and not the default
> posting.
>
> How do I get it to display the default posting. I'm happy to do this by
> named post, first post, whatever, I just want to get away from the
> Channel Render Script's page!
>



awburns@gmail.com

2006-04-01, 2:40 pm

Hi Stefan,

Yeah, I was beginning to think that. The book I'm reading implies
otherwise.

Okay, Page_Load : I've got some questions. I was working on something
similar - just in the onload event...

protected override void OnLoad(EventArgs e)
{
PostingCollection pc = CmsHttpContext.Current.Channel.Postings;
if( pc.Count > 0 )
{
foreach( Posting p in pc )
{
if( "_CHANNEL" == p.Name.ToUpper())
{
Response.Redirect ( p.Url );
}
}
}
base.OnLoad (e);
}


How do I determine which is the default posting? At the moment, I've
just got it coded to display a page "_CHANNEL" for the channel (items
begining with _ aren't shown on the live site in my navigation)

Also, is there a reason to not use Server.Transfer rather than
Response.Redirect? The latter uses an extra request/response cycle...

Sorry about the battery of questions - bit new to CMS (and .NET)

Andy

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com