conditions in Repeater Transformation

Vasyl Chepil asked on April 8, 2016 09:57

I have next transformation in repeater

Image Text Sorry but i can't insert code here, because it shows wrong.

Is there any posibility to add condition like

{% if (DisplayItemIndex >= 10) {EXIT_FROM_TRANSFORMATION }#%}

before my transformation code

or how can i write condition like

{% if (DisplayItemIndex < 10) {HERE_SHOULD_BE_EXISTING_TRANSFORMATION_CODE}#%}

Correct Answer

Anton Grekhovodov answered on April 8, 2016 10:39

You can use this code to hide content for any item

{% if (DataItemIndex < 10) { %}
  <article>
  ...
  </article>
{% } %}
2 votesVote for this answer Unmark Correct answer

Recent Answers


David te Kloese answered on April 8, 2016 10:08

Hi,

if you don't want to render anything why don't you use the "Select top N pages" property of the repeater?

Image Text

David

0 votesVote for this answer Mark as a Correct answer

Vasyl Chepil answered on April 8, 2016 10:15

Unfortunately this solution is not suitable for me Because i'm tring to write something like lazy load functionality

0 votesVote for this answer Mark as a Correct answer

Chetan Sharma answered on April 9, 2016 08:56 (last edited on April 9, 2016 09:02)

0 votesVote for this answer Mark as a Correct answer

Chetan Sharma answered on April 9, 2016 09:03

Hi Vasyl,

There is an excellent article by our community friend Laura Frese.

I am providing you both with link to its webpart and a link about how to implement it

If you are not making use of where clause in your conditional loading then this webpart should be able to solve your problem.

Thanks, Chetan

2 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.