Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Obtain previous item's property in transformation View modes: 
User avatar
Certified Developer v7
Certified  Developer v7
Nathoushka - 5/16/2011 11:03:35 AM
   
Obtain previous item's property in transformation
Hello,

I have a document type called "NewsletterItem" in which I have a property called "Section". I get these in a transformation ordered by that field. I want to store that information somehow while in the transformation so that when the value is different, to show it, then store it again. Then if the value of another item is different, show it and store it.

What I want to have is:

News
News (doesn't show)
News (doesn't show)
Announcement
Announcement (doesn't show)
etc.

Thanks for sharing ideas with me.

Nathalie

» Using Kentico 5.5 R2 with Hotfix 5.5R2.17.

User avatar
Certified Developer v7
Certified  Developer v7
Nathoushka - 5/16/2011 2:34:48 PM
   
RE:Obtain previous item's property in transformation
Well, that might not be clear enought...

I have a page that shows content from the folder "Newsletter" which contains "NewsletterItems" document type.

In my transformation, I get all the NewsletterItems in which I then get the "Section" property and show it:

<% Eval("Section") %>


However, that will show it like:

News
This is a news summary.

News
This is a news summary 2.

News
This is a news summary 3.

Announcement
This is an announcement.

Announcement
This is an announcement 2.



I want it to be:

News
This is a news summary.
This is a news summary 2.
This is a news summary 3.

Announcement
This is an announcement.
This is an announcement 2.



I hope that's more clear.

User avatar
Certified Developer v7
Certified  Developer v7
Nathoushka - 5/16/2011 4:01:33 PM
   
RE:Obtain previous item's property in transformation
Please, disregard this post. Since I don't think there was a way to do it, I've created a User Control in which I use the ViewState to do this.

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 5/17/2011 2:50:32 AM
   
RE:Obtain previous item's property in transformation
Hi Nathalie,

Just to add some thoughts...
Have you tried using nested repeater (listing control), e.g. like described in Controls reference docs.?

You could list all news under each section by a nested control. It would be helpful to see the structure in the content tree and transformations you're using. How is the content ("This is an...") rendered in transformation?

Anyway, good to hear the User Control works fine for your purpose.

Regards,
Zdenek