WHERE Condition on Repeater

Patti Love asked on February 22, 2019 23:48

I am trying to hide pages moved to an 'archive' folder in Kentico 8.2. I'm not sure whether I should be using a transformation on the Repeater web part or, a WHERE condition. I've added a WHERE condition statement, DocumentCreatedWhen='1/1/2016' AND DocumentCreatedWhen='12/1/2018' IS HIDDEN ... that's not working. I'm not very familiar with Repeater functionality, which is not helping! Any suggestions, assistance would be AWESOME!

Thanks! PLove

Correct Answer

Brenden Kehren answered on March 1, 2019 21:13

Looks like you have a bit of confusion and incorrect coniguration. Sounds like you want one repeater to show all articles EXCEPT "archives".

If so then your Path property should be:
/Message-From-Ceo/%.

Then in the WHERE condition, you should have this:
NodeAliasPath NOT LIKE '/Message-From-Ceo/CEO-Message-Archive%'

Then if you want to create a separate "archive" repeater, simply use the same values BUT set the path to:
/Message-From-Ceo/CEO-Message-Archive/%

and leave out the WHERE condition.

0 votesVote for this answer Unmark Correct answer

Recent Answers


vasu yerramsetti answered on February 24, 2019 09:31

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on February 24, 2019 21:28

Your repeater where condition should be something like:

DocumentCreatedWhen BETWEEN DATEADD(year, -3, GETDATE()) AND DATEADD(YEAR, -1, GETDATE())

0 votesVote for this answer Mark as a Correct answer

Eric Dugre answered on February 24, 2019 22:03

You're trying to hide all pages that are contained within one specific folder (/Archive), correct? If so, a WHERE condition like this could help:

NodeAliasPath NOT LIKE '%/Archive/%'

This would exclude any page contained anywhere in your content tree that is underneath an "/Archive" parent.. if there's multiple of these and you only want to exclude one, you'd need to be more specific, e.g.

NodeAliasPath NOT LIKE '/Blog/Recipes/Archive/%' 
1 votesVote for this answer Mark as a Correct answer

Patti Love answered on February 26, 2019 17:39

Good Morning, Thank you for quick responses! However, I've tried all of your solutions/recommendations and I'm not able to make either one work. I'm not sure what else I need to do to remedy this issue. Please advise if screenshots of my Repeater would be of any help.

Thanks! PLove

0 votesVote for this answer Mark as a Correct answer

Eric Dugre answered on February 28, 2019 16:20

Patti, I'm afraid it's unclear exactly what your content tree looks like, where this Repeater is placed, and the what the exact desired outcome is, so we were really only guessing at possible solutions. Can you provide any more detail about the scenario, possibly with screenshots?

0 votesVote for this answer Mark as a Correct answer

Patti Love answered on March 1, 2019 21:03

Hi Eric, Thank you for responding. I feel like I'm asking the impossible ... However, since I'm working on an intranet and cannot include the URL for screenshots, I uploaded them to my Google Drive in order to share them with you. The links are below. I truly appreciate your assistance!

  1. Screenshot of content tree: https://drive.google.com/file/d/1MGLPfYK5-3r1rlK6gk6Q4qB1-v6EoShG/view?usp=sharing

  2. Screenshot of Repeater web part (1st section): https://drive.google.com/file/d/1LnxGuqTxXJi2sWAfznMKP_QuS3V5oynG/view?usp=sharing

  3. Screenshot of Repeater web part (2nd section): https://drive.google.com/file/d/1LLhVBAYsSVIGgIo30F6nZo-4o2VFoMoj/view?usp=sharing

  4. Screenshot of Repeater web part Where Condition: https://drive.google.com/file/d/16xtaBzjXMjm8fGrd8pqgbJp4SIqRiNAx/view?usp=sharing

  5. Screenshot of Repeater web part Transformation: https://drive.google.com/file/d/1HEjW5hilQzfdcz0xEcQVE2-zGa-AV9Eg/view?usp=sharing

  6. Screenshot of actual Transformation: https://drive.google.com/file/d/1ZghFtpeE92sbAuung_fAEjvleY_Uwtuv/view?usp=sharing

Please let me know if you would like any additional information.

Thanks again! PLove

0 votesVote for this answer Mark as a Correct answer

Patti Love answered on March 1, 2019 22:18

OMG ... it worked! I added the WHERE condition to the parent folder and all of the files in the archive folders are hidden. Me ... jumping up & down!!

Thank you, thank you! Patti

0 votesVote for this answer Mark as a Correct answer

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