Search for:
Sign in
Register
Menu
Articles
Questions & Answers
Download
Documentation
Support
Marketplace
Old Forums
Search:
Search text
ASPX templates
Version 3.x
>
ASPX templates
>
api help
View modes:
View mode
Threaded
Flat - newest to oldest
Flat - oldest to newest
Member
nedb
-
3/25/2008 6:42:37 PM
api help
Is it possible to access the current document's fields from the templates codebehind using the api?
Kentico Support
kentico_jurajo
-
3/26/2008 2:31:04 PM
RE:api help
Hi,
yes, it is possible. Here you can find the API documentation - http://www.kentico.com/downloads/kenticocms_api.zip
Best Regards,
Juraj Ondrus
Member
nedb
-
3/26/2008 3:39:08 PM
RE:api help
Could you provide a simple example?
Thanks!
Kentico Support
kentico_jurajo
-
3/26/2008 3:43:30 PM
RE:api help
Hi again,
I am sorry I forgot to mention also our developer's guide - here you can find some examples how to manage the documents - http://www.kentico.com/docs/devguide/content_management_internals.htm
Best Regards,
Juraj Ondrus
Member
nedb
-
3/26/2008 3:49:53 PM
RE:api help
Thanks I have reviewed that documentation. I'm confused on how to determine both the nodeId used in the SelectSingleNode example or the documentID in the SelectSingleDocumentID example.
Thanks
Member
nedb
-
3/27/2008 3:20:21 AM
RE:api help
Ok I figured it out after extensive research in the forum.
//get doc id
int docid = CMS.CMSHelper.CMSContext.CurrentPageInfo.DocumentId;
//select the document
CMS.TreeEngine.TreeNode node = null;
CMS.TreeEngine.TreeProvider tree = new CMS.TreeEngine.TreeProvider();
node = tree.SelectSingleDocument(docid);
//access custom attribute
int myage = (int)node.GetValue("age");
Top