Search code examples
orchardcms

Content Item tokens always coming through empty in Projection Query


I'm trying to create a Projection Query that has a Title Part filter based on a property of the current content item - let's say the Display Text ({Content.DisplayText}) for example.

enter image description here

The query is not working and when I debug the solution and set a break point on the GetFilterPredicate method of the StringFilterForm class the token value is always coming through as an empty string. It's as if it's not being resolved. I am seeing the same behavior for all the tokens in the Content Items group.

Other tokens are working just fine, like the QueryString ({Request.QueryString:*}) token for example.

Why are the Content Item tokens always coming through empty in my query filter? I'm using Orchard v.1.7.1.0


Solution

  • 2 years later, but in Orchard 1.9.2 you can query based on the current content item using the token:

    {Request.Content.*}
    

    I was missing the Request part of the token. Not sure if this worked at the time I originally asked the question.