ASPX templates
Version 5.x > ASPX templates > Displaying a Document Type View modes: 
User avatar
Member
Member
imuir-piehead - 2/3/2011 1:04:37 PM
   
Displaying a Document Type
I know this is a very simple question, but I haven't found a simple answer in the documentation.

I've created a document type (for case studies) and created a transform to use when rendering it. What is the best way to display an instance of this document type in a page?

I've tried using a CMSViewer control, but I have to figure out the path in the code-behind for every page.

It seems like there should be a simple way to just render the document associated with the current path without using code-behinds to look up the path. Am I missing something?

User avatar
Kentico Support
Kentico Support
kentico_radekm - 2/9/2011 8:46:16 AM
   
RE:Displaying a Document Type
Hello.

I am not sure I understand properly. Do you have some documents of given document type created in your content tree? If so, they are somewhere in tree under some path. You can see path expressions here: http://devnet.kentico.com/docs/devguide/appendix_b___path_expressions.htm

When using CMSViewer, you just need to set required properties as you can see them here: http://devnet.kentico.com/docs/controls/cmsviewer_overview.htm The path does not need to be set dynamically in code – you can use path expressions for this purpose. I would recommend you to test other viewer web part (control) as well, like cms:repeater for example.


Best Regards,
Radek Macalik

User avatar
Certified Developer v7
Certified  Developer v7
adam-syndicut - 2/16/2011 10:43:13 AM
   
RE:Displaying a Document Type
just put it in a cmsrepeater have a look through the documentation for the settings