From 04dbb4112508b1a2f87996f250c8ead1440855ec Mon Sep 17 00:00:00 2001 From: Garion Herman Date: Tue, 20 Dec 2016 23:44:49 +1300 Subject: [PATCH] Add documentation for limiting allowed widgets An addendum to clarify that yes, you can lock a WidgetArea down to certain widgets, and how to accomplish this. --- docs/en/getting-started.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/en/getting-started.md b/docs/en/getting-started.md index 2b0353a..058fda0 100644 --- a/docs/en/getting-started.md +++ b/docs/en/getting-started.md @@ -156,3 +156,14 @@ An example widget is below: $Title <% end_control %> +## Limiting Allowed Widgets for a Pagetype + +You can lock down a particular `WidgetAreaEditor` to only allow adding certain widgets by passing them as a second parameter. + +**GreatPage.php** + + :::php + $fields->addFieldToTab( + 'Root.Widgets', + new WidgetAreaEditor('PhenomenalWidgetArea', ['ParticularlyEpicWidget', 'LessGreatWidget']) + );