Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > How can I display Page Form contents on Page Template? View modes: 
User avatar
Member
Member
robert-tailor.co - 8/6/2012 6:38:49 PM
   
How can I display Page Form contents on Page Template?
Hi,

I'm using the ASPX development method for Kentico.

I have created a page template.
I have created a document type based on that page template.
I have added a custom form field to that document type (a standard text field).

What is the simplest way to display the value in that custom form field on the page that is rendered?

(Apologies if this is not the correct forum to ask this question).

Thanks!

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 8/7/2012 12:28:46 AM
   
RE:How can I display Page Form contents on Page Template?
Hi,

This usually done by some web part/control from the Listing and viewers category - like repeater, datalist and so on.

You will configure it to list your document type (classNames) and use appropriate transformation to display the data you want.

Best regards,
Juraj Ondrus

User avatar
Member
Member
robert-tailor.co - 8/7/2012 12:37:01 AM
   
RE:How can I display Page Form contents on Page Template?
kentico_jurajo wrote: Hi,

This usually done by some web part/control from the Listing and viewers category - like repeater, datalist and so on.

Hi Juraj,

What if my data is not suitable for a list?

Let's say it's just a single data item (like a colour - 'Red'). Would I still need to use a web part to display 'Red'? If so, which web part/control would be most suitable?

Isn't there some kind of page property I can access in the code-behind of the page template to reference the field directly? If not, why?

Using a web part seems like overkill to simply display a single field entry.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 8/7/2012 12:47:47 AM
   
RE:How can I display Page Form contents on Page Template?
Hi,

You will need to use repeater anyway - how else you want to get the data? You need to specify somewhere which document type - what is the source and which field should be used. This is done in the repeater by default and not only in Kentico but it is standard ASP.Net approach.

You can use also the code behind but you will basically replicate the code which is already available in the repeater - re-inventing the wheel. You can check the API examples to see how to work with documents in the code behind, how to get data of appropriate document.

I do not know what you want to achieve, so from your description I would go for the repeater however, maybe something else is behind and using the API might be more appropriate - this is up to you.

Best regards,
Juraj Ondrus