Skip to content
This repository has been archived by the owner on Feb 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #171 from skttl/develop
Browse files Browse the repository at this point in the history
Preparing 1.1 release
  • Loading branch information
skttl authored Dec 11, 2019
2 parents 2c6b64b + 8371a86 commit 5770d9a
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
image: Visual Studio 2017

# version format
version: 1.0.0.{build}
version: 1.1.0.{build}

# UMBRACO_PACKAGE_PRERELEASE_SUFFIX if a rtm release build this should be blank, otherwise if empty will default to alpha
# example UMBRACO_PACKAGE_PRERELEASE_SUFFIX=beta
Expand Down
8 changes: 6 additions & 2 deletions docs/developers-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ You can also add your editors using a package.manifest file in a folder in the `
"allowedDocTypes": [...],
"nameTemplate": "",
"enablePreview": true,
"largeDialog": true,
"overlaySize": "medium",
"viewPath": "/Views/Partials/Grid/Editors/DocTypeGridEditor/",
"previewViewPath": "/Views/Partials/Grid/Editors/DocTypeGridEditor/Previews/",
"previewCssFilePath": "",
Expand Down Expand Up @@ -86,13 +86,17 @@ The **Doc Type Grid Editor** supports 3 config options, all of which are optiona
| AllowedDocTypes | String[] | An array of doc type aliases of which should be allowed to be selected in the grid editor. Strings can be REGEX patterns to allow matching groups of doc types in a single entry. e.g. "Widget$" will match all doc types with an alias ending in "Widget". However if a single doc type is matched, (aka **Single Doc Type Mode**), then doc type selection stage (in the DTGE panel) will be skipped. Note, your document type must be an Element type, in order to be usable in DTGE. |
| NameTemplate | String | Allows using any of the doctype's property values in the name/label: {{propertyAlias}} |
| EnablePreview | Boolean | Enables rendering a preview of the grid cell in the grid editor. |
| LargeDialog | Boolean | Makes the editing dialog larger. Especially useful for grid editors with complex property editors. |
| overlaySize | String | Define the size of the grid editor dialog. You can write `large`, `medium` or `small`. If no size is set, the grid editor dialog will be small. Note, the medium size requires a minimum Umbraco version of 8.3 |
| LargeDialog | Boolean | (obsolete, use overlaySize instead) Makes the editing dialog larger. Especially useful for grid editors with complex property editors. |
| size | string | (obsolete, use overlaySize instead)
| ViewPath | String | Sets an alternative view path for where the **Doc Type Grid Editor** should look for views when rendering. Defaults to `~/Views/Partials/` |
| PreviewViewPath | String | Sets an alternative view path for where the **Doc Type Grid Editor** should look for views when rendering previews in the backoffice |
| ShowDocTypeSelectAsGrid | Boolean | Makes the content type selection dialog render a grid, in stead of the default list with descriptions |

By default, a universal grid editor allowing all available element document types is added upon installation.

Since Doc Type Grid Editor does not support culture variation, element document types allowing culture variations is not available for use in Doc Type Grid Editor.

---

### Hooking Up The Doc Type Grid Editor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ public IPublishedPropertyType PropertyType
return _propertyType;
}
}
public string Alias { get; }
public string Alias
{
get
{
return _propertyType.Alias;
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using Our.Umbraco.DocTypeGridEditor.Extensions;
using Our.Umbraco.DocTypeGridEditor.Helpers;
using Our.Umbraco.DocTypeGridEditor.Models;
using Umbraco.Core;
using Umbraco.Core.Models;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.Services;
Expand Down Expand Up @@ -60,7 +61,7 @@ public IEnumerable<object> GetContentTypes([ModelBinder] string[] allowedContent
{
var allContentTypes = Current.Services.ContentTypeService.GetAll().ToList();
var contentTypes = allContentTypes
.Where(x => x.IsElement)
.Where(x => x.IsElement && x.VariesByCulture() == false)
.Where(x => allowedContentTypes == null || allowedContentTypes.Length == 0 || allowedContentTypes.Any(y => Regex.IsMatch(x.Alias, y)))
.OrderBy(x => x.Name)
.ToList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
overlayOptions.allowedDocTypes = $scope.control.editor.config.allowedDocTypes || [];
overlayOptions.showDocTypeSelectAsGrid = $scope.control.editor.config.showDocTypeSelectAsGrid === true;
overlayOptions.nameTemplate = $scope.control.editor.config.nameTemplate;
overlayOptions.size = $scope.control.editor.config.largeDialog ? null : "small";
overlayOptions.size = $scope.control.editor.config.largeDialog ? null : $scope.control.editor.config.overlaySize || "small";

overlayOptions.dialogData = {
docTypeAlias: $scope.control.value.dtgeContentTypeAlias,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
</div>
</div>
<div ng-if="preview"
class="dtge-editor-preview-container"
style="text-align: left;"
dtge-bind-html-compile="preview"
prevent-default>
Expand Down

0 comments on commit 5770d9a

Please sign in to comment.