You can write a content handler to store the currently displayed content item for later use in the request:
public class MyContentHandler : ContentHandler
{
readonly IOrchardServices orchardServices;
public MyContentHandler (
IOrchardServices orchardServices)
{
this.orchardServices = orchardServices;
}
protected override void BuildDisplayShape(BuildDisplayContext context)
{
if (context.DisplayType == "Detail" && ((IShape)context.Shape).Metadata.Type == "Content" &&
orchardServices.WorkContext.GetState<ContentItem>("currentContentItem") == null)
{
orchardServices.WorkContext.SetState("currentContentItem", context.ContentItem);
}
}
}
Then you can write a projection filter using the content item reference stored in the state. (See Orchard.Tags.Projections.TagsFilter as an example of how to write a projection filter.)