Only show items that have a value of "yes" in Hierarchical Viewer

Liz B asked on November 3, 2017 19:42

Hello everyone, I created a child page type for articles that are a part of another custom page type for topics. In my articles page type, I have a form control to select if it's a popular article. I want to be able to manually select which articles I want featured as a popular article. I used a radio button option of Yes or No in my page type. I'm using the Hierarchical Viewer web part to list out the "Popular articles" but I'm not sure how to filter them to only articles that have a value of "Yes" in the form control. Should I put this in the WHERE condition in the web part? Or is there another way to do this?

Any suggestions would be appreciated!

Correct Answer

Brenden Kehren answered on November 3, 2017 21:03

Using the WHERE condition with a field specific to that page type works if you have a single page type selected in the page type filter. It doesn't work so well when you have multiple page types you are displaying/filtering. In this case you'd want to really determine if you need to use the hierarchical viewer or even a repeater and maybe look at using some taxonomy like categories or tags.

0 votesVote for this answer Unmark Correct answer

Recent Answers

Rui Wang answered on November 3, 2017 20:09

It would actually be in the "Where condition" property of the Hierarchical Viewer, you can set the "field name = true or yes", depending on what's actually stored.

0 votesVote for this answer Mark as a Correct answer

Liz B answered on November 3, 2017 21:19

I finally found a solution with a combination of both answers from Brenden and Rui. I kept putting my field name equal to 'Yes' but it wouldn't work and it would result in an error. Brenden made me realize that the reason why is because I was selecting multiple page types in my web part. I changed this to only select one and the WHERE condition works now.

Thanks everyone who helped out!

0 votesVote for this answer Mark as a Correct answer

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