Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Hierarchical Viewer Header and Footer transformation View modes: 
User avatar
Member
Member
john.banning-adaptdev - 5/17/2012 6:00:56 PM
   
Hierarchical Viewer Header and Footer transformation
I want to create one HTML table for each time I encounter the following document types in my tree, PRODUCT and the child( which may be many) DOWNLOAD. The table should will uses 2 document types to populate the table values. The document types are nested. The parent doc type, Product, contains information that I want to display on the first row of my HTML table. On the subsequent rows in the table I want to display information from the child doc types downloads. As I said, there is a parent-child relationship in the content tree that (Product > Downloads). There are also many products in the content tree. Each of these have downloads associated with them.

The content tree looks something like:

PRODUCT A
-DOWNLOAD 1
-DOWNLOAD 2
-DOWNLOAD 3
-DOWNLOAD 4

PRODUCT B
-DOWNLOAD 1
-DOWNLOAD 2
-DOWNLOAD 3
-DOWNLOAD 4

I want to open the table tag every time i encounter a Product and close the table tag after encountering the last Download. The table should look like the following:

<table>
-------------------------------------------------------------------------------------------------------------------
|PRODUCT NAME | PRODUCT PRICE | PRODUCT DESC
-------------------------------------------------------------------------------------------------------------------
|Download1 vers | Download1 price |
-------------------------------------------------------------------------------------------------------------------
|Download2 vers | Download2 price |
-------------------------------------------------------------------------------------------------------------------
|Download3 vers | Download3 price |
-------------------------------------------------------------------------------------------------------------------
</table>


I want to use the hierarchical viewer to do these transformation, but am having issues when I attempt to use the HEADER and FOOTER transformation types. It appears that I cannot use the Header and FOOTER transformations types since they are only executed once, the initial instance of Product and the final instance of Product.

Is there another way to do this ? Am I using the FOOTER and HEADER incorrectly?

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 5/21/2012 3:46:58 AM
   
RE:Hierarchical Viewer Header and Footer transformation
Hi,

according to your description it seems that you would like to generate table element for each product.

In this case it would be better to insert your html code into First item transformation and Last item transformation, in in field Document types select your child document type. In the transformation simply copy the code of general item transformation and add <table> into the first item and </table> into the last item.

Best regards,
Ivana Tomanickova