Portal Engine
Version 3.x > Portal Engine > get field from parent document in repeater where condition View modes: 
User avatar
Member
Member
davidgoss - 6/15/2010 4:19:37 AM
   
get field from parent document in repeater where condition
Hi

I'm trying to write a WHERE condition for a repeater which will reference data from the current document's parent. At the moment, I can reference data from the current document in a WHERE condition easily like this:

{%currentdocument.FIELDNAME%}

Neither worked. Is there a way to do it. I do have a custom function that will return a requested field from the parent if you give it the node ID of the current document, but not sure if this can be worked into a WHERE condition?

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 6/16/2010 7:16:52 PM
   
RE:get field from parent document in repeater where condition
Hi,

in the 3.x versions, the context macro expression for parent document cannot be used.
You can use your custom function and define a custom macro, like described in DevGuide - Appendix A / Custom macros. This custom macro should work fine in the WHERE condition.

In current versions (5.x), there is a context macro that can be used:

{%currentdocumentparent.FIELDNAME%}


Hope this helps.

Regards,
Zdenek