ASPX templates
Version 4.x > ASPX templates > Issue loading custom document type properties View modes: 
User avatar
Member
Member
lcrowe-teamspirit.uk - 1/26/2010 5:57:36 AM
   
Issue loading custom document type properties
Hi

I really hope somebody could help me with this issue ASAP!

I have a custom document type for a home page, this page has many custom properties.

I have a master page that is used on many other templates which contains a user control that uses content within the custom properties on the home page.

When the home page is published and I retrieve the homepage by calling new TreeNode(row, row["ClassName"].ToString().Trim()); everthing works fine.

Once I save the homepage and do not publish it the custom properties exist when calling ContainsColumn() but there values are null as if they have not been loaded in.

To get around this I am now using TreeHelper.SelectSingleDocument(documentID). This works fine apart from the fact that this loads a PUBLISHED document version.

I need a way of loading an unpublished page with all of it's custom form property values fully popuplated!

Is there a way to do this as when I am in edit mode I want pages that pull in content from other pages to reflect there save state content as well rather than published?

Thanks

Lee


User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 2/1/2010 9:58:43 AM
   
RE:Issue loading custom document type properties
Hi,

I'm adding my answer (sent also via email) for anyone who might come across this:

For manipulation with versioned documents, DocumentHelper class should be used.
The best method for your purpose is mostly:
GetDocument(TreeNode, TreeProvider)
Description in API Reference says: Returns the latest version of the document if versioning is used or the document itself if not

You can find some recommendations and comparison at http://devnet.kentico.com/docs/devguide/versioning_internals.htm


Regards,
Zdenek C.