Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Help with repeater View modes: 
User avatar
Member
Member
lwhittemore-emh - 1/16/2012 11:58:31 AM
   
Help with repeater
I have two repeaters on a page, one shows the selected document on the left and the second shows a list of documents on the right. Both use the same document type.
Is there a way to add a statement to the right repeater's Where condition to only show documents on the right that have the same "Category" field as the selected document?

User avatar
Kentico Support
Kentico Support
kentico_janh - 1/17/2012 1:57:09 AM
   
RE:Help with repeater
Hello,

A selected document is always a current displayed document, so you can use a context macro in your where condition and select only documents with the same CategoryID (or any other field) as the current document has:

WHERE condition: CategoryID = {%CurrentDocument.CategoryID%}


Best regards,
Jan Hermann

User avatar
Member
Member
lwhittemore-emh - 1/17/2012 7:08:51 AM
   
RE:Help with repeater
Thanks, that's what I needed. However, it was throwing an error but I figured it out. I needed to sing quotes around the macro.
WHERE condition: CategoryID = '{%CurrentDocument.CategoryID%}'

User avatar
Kentico Support
Kentico Support
kentico_janh - 1/17/2012 7:34:01 AM
   
RE:Help with repeater
Hello,

You're right, because context macro returns a string, so you need to place it between two quites.

Best regards,
Jan Hermann