Skip to content

Contentment v1.4.0

Compare
Choose a tag to compare
@leekelleher leekelleher released this 15 Apr 08:31
· 988 commits to master since this release
8e1474e

🤫 Shhhush... (Hey there Umbraco fans!)

(Inside voices please.) This is a very low key release, so please let's give a very quiet welcome to Contentment v1.4.0. 🤫

"So, Lee, what's new in this release?" I hear you ask. 😊 Nooo, it's a secret! (🤫 remember) "P-p-p-please!" 🥺🙏

Okay, okay, but don't tell anyone... 🤫

New Data Sources for Data List

Now that Data List has been used out-in-the-wild for a year or so, some folk have grasped its concept and wanted more - beyond what is shipped out the box - more data-sources, more list-editors. My default response has been "try roll you own custom data-source", which is suffice, but then if it's for a common scenario, and we're all rolling our own, then I start to think, what's the point?

In parallel, for my own client projects, I'd been finding all sorts of scenarios for needing custom data-sources. I put them all in my company's internal code library. Many of them were quite generic, so reached the conclusion to include them with Contentment.

Before we all get too excited, all of these new data-sources are hidden by default. By that, I mean they wont show up in the data-source list on a fresh/default install of Contentment. They all need to enabled in code (via an Umbraco Composer). This may be problematic for some developers, but it's a compromise that I came to after much deliberation. I'll explain...

The main reason to hide all these data-sources was to not overwhelm new and casual users. The new extra ones could be considered
advanced or edge-case, they aren't data-sources for typical use. (I'm sure some folk may disagree with me on that point, but hey-ho, it's my opinion).

Okay, okay, enough chatter, here are the new data-sources...

  • 0723052 .NET Currencies, (that are part of the .NET Framework, as installed on your web server)
  • d178daf .NET Countries, (that are part of the .NET Framework, as installed on your web server)
  • 31b0022 .NET Time Zones, (that are part of the .NET Framework, as installed on your web server)
  • 87a451d uCssClassName - a salute to @marcemarc! 🖖
  • dbd3739 Umbraco Properties
  • 2f94022 Umbraco XPath Content, (hopefully this will satisfy #78 #79 🤞)
  • a026801 Umbraco Entity
  • de81dbb Umbraco Image Cropper (as seen on a recent DEV.to article 😉 )
  • 99e7639 Umbraco Member Group
  • 61e4d7a User-defined (manual) (uh-uh I made a really nice DataListItem editor for this one 😊)
  • e73a069 Umbraco Dictionary

Okay, so how do enable these?
All of the C# classes for the new data-sources are marked as public, so you can add them in your Composer class like so...

composition
    .ContentmentListItems()
        .Add<Umbraco.Community.Contentment.DataEditors.CountriesDataListSource>()
        .Add<Umbraco.Community.Contentment.DataEditors.CurrenciesDataListSource>()
        .Add<Umbraco.Community.Contentment.DataEditors.TimeZoneDataListSource>()
        .Add<Umbraco.Community.Contentment.DataEditors.uCssClassNameDataListSource>()
        .Add<Umbraco.Community.Contentment.DataEditors.UmbracoContentPropertiesDataListSource>()
        .Add<Umbraco.Community.Contentment.DataEditors.UmbracoContentXPathDataListSource>()
        .Add<Umbraco.Community.Contentment.DataEditors.UmbracoDictionaryDataListSource>()
        .Add<Umbraco.Community.Contentment.DataEditors.UmbracoEntityDataListSource>()
        .Add<Umbraco.Community.Contentment.DataEditors.UmbracoImageCropDataListSource>()
        .Add<Umbraco.Community.Contentment.DataEditors.UmbracoMemberGroupDataListSource>()
        .Add<Umbraco.Community.Contentment.DataEditors.UserDefinedDataListSource>()
;

Urgh, that's a bit long winded, how do I enable them all?!! Okay, okay, chill out, to enable all the new extra data-sources, you can do this...

composition.UnlockContentment(); // 😃

Happy? Ace! The reason for the granularity in the first snippet is so that you can pick and choose which new data-sources you want.

"Is that it? anything else in this release?" Golly gosh, there's no pleasing some people, okay, there are these little features...

  • ff85753 Data List Preview - Added JSON tab, to view/copy the raw data.
  • 02e6749 MVC Helper method for Content Blocks, e.g. @Html.DoesPartialExist("partialViewName"), and @Html.RenderElements(Model.ContentBlocks) (it'll work with any IEnumerable<IPublishedElement> values).

Enjoy the release! 🤫

Cheers,
@leekelleher
✌️❤️🕊️


This release is also available on NuGet...

PM> Install-Package Our.Umbraco.Community.Contentment