Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > DocumentType Title in a label View modes: 
User avatar
Member
Member
matan - 6/29/2011 4:06:19 AM
   
DocumentType Title in a label
Hi everyone,
I created a custom document type with two pages: list and detail. Everything seems to work fine but I've a question regarding the detail page.

I'm able to filter the list of DocumentType by using this WHERE condition MyClassName_DownloadsID = {%ToInt(ID, "0")%} into a repeater (setted up with filter and transformation obviously).
Is any way to get the Title attribute of my DocumentType in a not editable label by using the same approach?

A "not so clean" workaround I successfully used is: put the <%# Eval("Title")%> in the transformation code, but I don't like so much this way...

Thank you in advance for any reply.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 7/3/2011 2:41:48 AM
   
RE:DocumentType Title in a label
Hi,

I am sorry but I Am not sure if I am following you.
You want to display the title attribute using macro? Maybe if you could explain it in more details, why and where you want to display it, it would help us understand you better.

From my current understanding, using the Eval function in a transformation is the right and correct way how to display any document type field (attribute) values.

Best regards,
Juraj Ondrus

User avatar
Member
Member
matan - 7/3/2011 5:22:02 AM
   
RE:DocumentType Title in a label
Hi Jurag, thanks in advance for you reply!
I'll try to explain better what I want to do in this post: I've a detail page which contains a Label and a Repeater.
Repeater is filtered by a where condition which allows to display only the item with the ID in the where condition; label will display the "Title" attribute of my document type but I don't want to put this piece of code into transformation of the document type.
Is there any alternative way to do this or, from your point of view, the correct way to implement what I need is to put the label assignment into the document type's transformation?

I hope it's clear now :)
Thank you

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 7/4/2011 2:33:45 AM
   
RE:DocumentType Title in a label
Hi,

Thank you for the explanation. In this case, you can use e.g. a static text web part with custom macro and in the code of the macro yu will read the query string parameter and get the title of the document you want.

Best regards,
Juraj Ondrus

User avatar
Member
Member
matan - 7/6/2011 4:26:12 AM
   
RE:DocumentType Title in a label
Hi Juraj,
thank you for the suggestion. I'll implement asap and I'll give you a feedback.
Regards.