I have html in my before content in a query repeater, but was wondering if there was a way to change the content if the repeater only had 1 result vs many?
Remove the content from the before and after content boxes and add some logic in your transformation:
If(DataItemCount == 1) // do some work
Sometimes we'll use an <asp:PlaceHolder> and set the Visibility property to the above statement.
<asp:PlaceHolder>
Visibility
That will work I guess, I'll have to wrap it in a If(DataItemIndex==0) as well to only get it to show before the first item.
If(DataItemIndex==0)
Thanks!
Depending on your version, IsFirst() and IsLast() work just like what you stated for checking the first item.
IsFirst()
IsLast()
interesting, is there documentation on that?
See here:
https://docs.kentico.com/k11/developing-websites/loading-and-displaying-data-on-websites/writing-transformations/reference-transformation-methods#Reference-Transformationmethods-Booleanoperations
Are you still getting any issues?
Please, sign in to be able to submit a new answer.