Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > ASCX transformation in email template not resolved View modes: 
User avatar
Member
Member
ddj-datacon - 11/15/2012 4:07:43 AM
   
ASCX transformation in email template not resolved
Hi,

I'm trying to send an orderconformation in Kentico 6. Inside the template is a table where i display the items in the order. For this i use a transformation in the CMS.Root document type. when the transformation was of type text/xml everything worked fine. however the customer would like rownumebrs in the table. I figured the DataItemIndex would be a good way tohandle this. In order to be able to use the DataItemIndex i changed the template to ascx. I now have the following code in my transformation:
<tr>
<td><%# DataItemIndex %></td>
<td><%# Eval("OrderItemUnitCount") %> </td>
<td><%# Eval("OrderItemSKUName") %> </td>
<td><%# Eval("OrderItemUnitPrice").Format("{0:f2}") %> </td>
<td> </td>
<td><%# Eval("OrderItemTotalPriceInMainCurrency").Format("{0:f2}") %></td>
</tr>

This is how i call the transformation:
<td colspan="2">
{% Order.OrderItems.ApplyTransformation("CMS.Root.WebshopOrderLineContent", "CMS.Root.ALTWebshopOrderLineHeader", "CMS.Root.WebshopOrderLineFooter")%}
</td>

The only output generated is the name of the transformation for each item in the collection. So when i have two items it will append:
"WebshopOrderLineContentCMS.Root.WebshopOrderLineContent "

Do you have any idea as to what i've done wrong?

User avatar
Kentico Support
Kentico Support
kentico_janh - 11/15/2012 9:04:10 AM
   
RE:ASCX transformation in email template not resolved
Hello,

You can use DataItemIndex variable in Text/XML transformations as well:
{% DataItemIndex %}

Best regards,
Jan Hermann

User avatar
Member
Member
ddj-datacon - 11/15/2012 9:13:22 AM
   
RE:ASCX transformation in email template not resolved
When i use {% DataItemIndex %} on order.orderItems it doesn't show anything in my table. Are you sure the DataItemIndex is available for order.orderItems?

Best regards,
Daan

User avatar
Member
Member
ddj-datacon - 11/15/2012 9:18:24 AM
   
RE:ASCX transformation in email template not resolved
this is my code now:
<tr>
<td>{% DataItemIndex %}</td>
<td>{% OrderItemUnitCount %} </td>
<td>{% OrderItemSKUName %} </td>
<td>{% OrderItemUnitPrice.Format("{0:f2}" %}</td>
</tr>

User avatar
Kentico Support
Kentico Support
kentico_janh - 11/27/2012 9:30:02 AM
   
RE:ASCX transformation in email template not resolved
Hello,

I am sorry for the delay, however I have good new for you. I have discussed this with our development department and the DataItemIndex functionality wasn't implemented for transformation applied by .ApplyTransformation method, so there was no way how to display order of rows, but this functionality will be added to a hotfix, so you should be able to use it next week.

Best regards,
Jan Hermann

User avatar
Member
Member
ddj-datacon - 11/27/2012 9:32:52 AM
   
RE:ASCX transformation in email template not resolved
Awesome, i'm looking forward to this patch.

Best regards,
Daan