Axe
Axe

Reputation: 739

Orchard CMS Exposing Custom Part data to Query filters

I have a custom part "Feature" here's the model

public class FeatureRecord : ContentPartRecord
{
    public virtual bool IsFeatured { get; set; }
    public virtual string Text { get; set; }

}

public class FeaturePart : ContentPart<FeatureRecord>
{
    [Display(Name = "Is featured")]
    public bool IsFeatured
    {
        get { return Record.IsFeatured;  }
        set { Record.IsFeatured = value; }
    }

    [StringLength(400)]
    [Display(Name = "Feature Text")]
    public string FeatureText
    {
        get { return Record.Text; }
        set { Record.Text = value;  }
    }

}

I want to set up a query for a projection widget, with a filter biased on the IsFeatured value being true

However only Filed values appear on the list of options for the filter. How can I expose custom part data to the filter option values ?

Upvotes: 0

Views: 1258

Answers (1)

Bertrand Le Roy
Bertrand Le Roy

Reputation: 17814

You can add new properties to use with projections through the Bindings tab under projections.

Upvotes: 1

Related Questions