Show all blogs from category

Vasyl Chepil asked on April 6, 2016 15:16

I need to show all blogs from category

for this purpose i'm trying to use Repeater with WHERE condition

`CategoryID IN (23)`

but this not work

PS.

Without where condition the repeater shows all blogs

Correct Answer

Dawid Jachnik answered on April 6, 2016 15:38

You can use there K# expression

GlobalObjects.Users.Where("UserID="+ToInt( QueryString["UserId"], 0 )).GetValue("IsExpertIn")
2 votesVote for this answer Unmark Correct answer

Recent Answers


Dawid Jachnik answered on April 6, 2016 15:21 (last edited on April 6, 2016 15:21)

Hello,

if you are using repeater you can use property Category name in properites of Repetear

Image Text

2 votesVote for this answer Mark as a Correct answer

Vasyl Chepil answered on April 6, 2016 15:28

In this field i can't use "sql" but i need it to receive category name

select IsExpertIn from CMS_User where UserID=ToInt( QueryString["UserId"], 0 )

this sql returns me category name

How can i use it in Category name field?

1 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on April 6, 2016 16:04

You can use a macro for the where statement for example:

DocumentID IN (SELECT DocumentID FROM CMS_DocumentCategory WHERE CategoryID = '{?categoryid?}')
0 votesVote for this answer Mark as a Correct answer

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