diff --git a/src/Umbraco.Web.UI.Client/src/common/resources/macro.resource.js b/src/Umbraco.Web.UI.Client/src/common/resources/macro.resource.js
index 73a1651b5e6f..fd7c6c9af9ec 100644
--- a/src/Umbraco.Web.UI.Client/src/common/resources/macro.resource.js
+++ b/src/Umbraco.Web.UI.Client/src/common/resources/macro.resource.js
@@ -105,6 +105,13 @@ function macroResource($q, $http, umbRequestHelper) {
);
},
+ getGroupedParameterEditors: function () {
+ return umbRequestHelper.resourcePromise(
+ $http.get(umbRequestHelper.getApiUrl("macroApiBaseUrl", "GetGroupedParameterEditors"),
+ "Failed to get parameter editors")
+ );
+ },
+
getById: function(id) {
return umbRequestHelper.resourcePromise(
$http.get(umbRequestHelper.getApiUrl("macroApiBaseUrl", "GetById", { "id": id }), "Failed to get macro")
diff --git a/src/Umbraco.Web/Editors/MacrosController.cs b/src/Umbraco.Web/Editors/MacrosController.cs
index 429e8b619065..26b59b9aa923 100644
--- a/src/Umbraco.Web/Editors/MacrosController.cs
+++ b/src/Umbraco.Web/Editors/MacrosController.cs
@@ -229,6 +229,23 @@ public HttpResponseMessage GetParameterEditors()
return this.Request.CreateResponse(HttpStatusCode.OK, Current.ParameterEditors);
}
+ ///
+ /// Gets the available parameter editors grouped by their group.
+ ///
+ ///
+ /// The .
+ ///
+ public HttpResponseMessage GetGroupedParameterEditors()
+ {
+ var parameterEditors = Current.ParameterEditors.ToArray();
+
+ var grouped = parameterEditors
+ .GroupBy(x => x.Group.IsNullOrWhiteSpace() ? "" : x.Group.ToLower())
+ .ToDictionary(group => group.Key, group => group.OrderBy(d => d.Name).AsEnumerable());
+
+ return this.Request.CreateResponse(HttpStatusCode.OK, grouped);
+ }
+
///
/// Returns a error response and optionally logs it
///