Kentico Repeater HTML Properties showing with selected transformation
Date : March 29 2020, 07:55 AM
should help you out Consider moving your table tags from the html envelope and conditionally rendering them inside your transformation like this: // If this is the first item in the repeater, open the table tag
<%# DataItemIndex == 0 ? "<table>" : "" %>
// your trasformation code
// if this is the last item in the repeater, close the table tag
<%# DataItemIndex + 1 == DataItemCount ? "</table>" : "" %>
<%# IsFirst() ? "<table>" : "" %>
// transformation code
<%# IsLast() ? "</table>" : "" %>
|
Kentico custom page type selected transformation display
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , I am guessing you want when you are on Alert 1 page to use the detail transformation? You should use a repeater, and use transformation 1 (the one with the read more URL) as the Transformation, and use your Detail transformation as the Selected Item Transformation.
|
kentico ascx transformation, every nth
Date : March 29 2020, 07:55 AM
should help you out To start the row, you want to make sure the first record starts a row: <%# ( (DataItemIndex % 4 == 0) ? "<div class=\"row\">" : "" ) %> <!-- Start Row -->
<%# (DataItemIndex % 4 == 3 || DataItemIndex == DataRowView.DataView.Count - 1 ? "</div>" : "") %> <!-- Close Row -->
|
Kentico Page Type Transformation Iteration Display
Tag : chash , By : Daniel Reslie
Date : March 29 2020, 07:55 AM
To fix the issue you can do The easiest way to accomplish this is to use "Text/XML" Transformation Type rather than ASCX, and use K# Kentico Macro syntax to loop through your delimited string. https://docs.kentico.com/k10/macro-expressions/macro-syntax{%
orders = ECommerceContext.CurrentCustomer.AllOrders;
if (orders.Count > 0) {
result = "<ul>";
foreach (order in orders) {
foreach (item in order.OrderItems)
{ result += "<li>" + item.OrderItemSKUName + "</li>" }
};
return result + "</ul>";
}%}
|
Dynamically render page type property as HTML in Kentico macro transformation
Date : March 29 2020, 07:55 AM
This might help you You are seeing the HTML printed on the web page because you are using the HTMLEncode() method - you don't need to use this method for what you are trying to achieve. Just reference the page type field directly in the macro and the HTML generated in the rich text editor will be rendered. Assuming the name of the page type field is "HTMLContent", enter this into your transformation: <div>
{% HTMLContent %}
</div>
|