Kentico 12 - Limit Page Selector by a given page type

407 Views Asked by At

Is it possible to limit the new widget Page Selector by a given page type? I know you can set it to load a specific path using EditingComponentProperty(nameof(PageSelectorProperties.RootPath) but can't see a way to limit by page type.

2

There are 2 best solutions below

0
On

Currently there isn't, just by path i'm afraid. Not sure if Kentico is working on it, it would be nice to have as we have run into the same thing.

2
On

You could always add a new widget property

In your model properties class

[EditingComponent(TextInputComponent.IDENTIFIER, Order = 0, Label = "Page Selector Class")]
public string PageSelectorClass { get; set; }

In your controller

var pages = DocumentHelper.GetDocuments(GetProperties().PageSelector)
//any other LINQ statements you need