Technical support This forum is closed.
Version 1.x > Technical support > Don't show editiable regions when document not checked out. View modes: 
User avatar
Member
Member
trint99 - 9/12/2006 8:31:16 PM
   
Don't show editiable regions when document not checked out.
Is there a way to have the editable regions not render as editable if a document is not checked out? I would much prefer that if the document is checked in it would render the document as it will appear on the web site (the way it looks when you select the "published version" radio button). This is the only way a content editor can see what the content will really look like without publishing it.

If there is not currently a way to do this, could you please move this to the suggestions forum?

Thanks,
Trint

User avatar
Guest
admin - 9/13/2006 10:00:30 AM
   
Re: Don't show editiable regions when document not checked out.
Hello,

this will be supported in version 1.9b (and, of course, in 2.0).

Best Regards,

User avatar
Member
Member
trint99 - 9/13/2006 4:56:04 PM
   
Re: Don't show editiable regions when document not checked out.
That's great news. Thanks.

Do you have a time line for the next release? My web site is scheduled to be opened to the content editors on October 1st. I'd like to have this fixed by then.

Thanks,
Trint

User avatar
Guest
admin - 9/13/2006 5:54:59 PM
   
Re: Don't show editiable regions when document not checked out.
Unfortunately, 1.9b will be avaialble at the end of October 2006, after 2.0 release.

Regards,

User avatar
Member
Member
trint99 - 9/20/2006 12:22:51 AM
   
Re: Don't show editiable regions when document not checked out.
That is unfortunate.

In that case, I'm going to have to hack the current Kentico controls until the fix comes out. Could you set me in the right direction.

From what I see so far, I need to find a way to set this.Context.Session[ "CMSBrowseMode" ] to "browse" when the document is not checked out to the current user (rather than "edit"). But I can't seem to find were the value is being set to "edit".

User avatar
Guest
admin - 9/20/2006 8:01:23 AM
   
Re: Don't show editiable regions when document not checked out.
Unfortunately, there's no simple workaround for this.

User avatar
Member
Member
trint99 - 9/23/2006 2:47:23 AM
   
Re: Don't show editiable regions when document not checked out.
The following code is a stop-gap fix until the new version comes out. (Hey, Kentico guys. If you want to use this for your fix, that's fine with me.) All of this code was scavanged from various parts of CMSPageManager.cs. Use with caution as I don't use culture on my site so I left out some things.

In CMSControls_CS/CMSEditableRegions.cs starting around line 219...

private void ReloadControls()
{
// Clear control collection.
this.Controls.Clear();

// BEGIN EDIT: To prevent editable controls from displaying when the page is not checked out.
int userId;
if( this.Context.Session["CMSUserID"] == null )
{
userId = 0;
}
else
{
userId = System.Convert.ToInt32( this.Context.Session["CMSUserID"] );
}

Kentico.CMS.TreeEngine.TreeProvider tree = new Kentico.CMS.TreeEngine.TreeProvider();
tree.UserID = userId;
Kentico.CMS.TreeEngine.TreeNode node = tree.SelectSingleNode( this.CurrentPageAliasPath, Kentico.CMS.TreeEngine.TreePathTypeEnum.AliasPath );

int checkedOut = System.Convert.ToInt32( node.GetValue( "CheckedOutByUserID" ) );

// Add child controls to the control collection.
if( checkedOut == userId & this.IsEditable == true & this.IsAuthorized == true )
//if ( this.IsEditable == true & this.IsAuthorized == true )
// END EDIT

Pretty simple workaround, if you ask me.

Thanks!

User avatar
Member
Member
trint99 - 11/2/2006 12:38:58 AM
   
Re: Don't show editiable regions when document not checked out.
FYI... This hack is causing lots of problems. If anyone runs across this as a fix, it might not be the best choice.

I'm removing this for now and hoping to upgrade to 2.0. We'll see if that helps. Hopfully the 2.0 upgrade process will not be too painful. I've got content editors working on the site round the clock trying to get done by deadline.

BTW, we bought the license plus source. How do I go about getting the 2.0 source?

Thanks,
Trint
trint.ladd@altn.com

User avatar
Guest
admin - 11/2/2006 10:28:07 PM
   
Re: Don't show editiable regions when document not checked out.
Hi Trint,

Thank you for your message. This issue will be fixed in 1.9b upgrade that will be released later this month (we had to postpone the release due to the delay of the 2.0 release).

We will send out an e-mail with all information on 2.0 version to 1.x clients at the beginning of the next week, as soon as we finish our new web site.

Best Regards,