Updated Trumbowyg plugin, configure your Azure Blob and Data Protection with Liquid and many more improvements are waiting for you in our upcoming post. Did we forget to mention that Orchard Core is now on the Area 51 site of Stack Exchange?
Orchard Core updates
Upgrade to ASP.NET 3.1.0
Orchard Core now using the v3.1.0 of the ASP.NET Core framework. This version is included in Visual Studio 16.4.0, so if you are using at least this version, you can build your own solution using Orchard Core. Here you can read a great article about the new features of this release.
Validate Site Settings BaseUrl property
You can set up the BaseUrl of your site under the Configuration -> Settings -> General on the dashboard. If you enter a URL, which is a not fully qualified URL, you will get a validation error. So, here you need to enter an absolute URL.
Template Azure Blob and Data Protection blob configuration with Liquid
You can customize the base path of the Blob Storage for media, for data protection and also for the container that you want to use. These can use a template in Liquid. If you have some custom rules to name your container or the base path, then you can define it this way.
You can have access to the
ShellSettings and the
ContainerName properties. This will give you all the flexibility you need for instance to use the same container for all your tenants and then use a custom folder for each tenant. Or a custom container for every tenant and then the same path. You can also ask for the container to be created and it will be done when the tenant is started.
You can read more about this feature in the documentation.
Trumbowyg 2.21.0 and resizimg plugin
Orchard Core using Trumbowyg, a lightweight WYSIWYG editor, that makes easier to edit your HTML content. Thanks to Antoine Griffard, Orchard Core now using version 2.2.10, including the resizimg plugin. For instance, when you set the Trumbowyg as the editor type of your HtmlBodyPart and insert a media with URL, you can just simply set the size of the image with a friendly user interface.
Use GetLanguageDirection method everwhere
When you check the content of the
OrchardCore.Localization.Abstractions module, you will find a
GetLanguageDirection extension method in the
LanguageDirection static class. This method is used to get the language direction for a given culture. So, if we have an extension method like this, let's use it everywhere in the code. For example, check the code of the
CultureDir extension method in the
RazorHelperExtensions class, where you can see an example usage of the
Fix localization accessors names
In ASP.NET Core we have many ways to use localization. The
IStringLocalizer interface represents a service that provides localized strings and the
IHtmlLocalizer interface provides localized HTML content. In Orchard Core, we used
TH, so it's time to unify these names and avoid the confusion. From now in the source code, the
S will be used for the
IStringLocalizer and the
H will be used for
IHtmlLocalizer. When localizing the views, the name
T will be used like before.
Scoped Liquid TemplateContext
The goal was to improve perf on the Liquid rendering because we were creating a new
TemplateContext and resolving all the services for each template. Here the idea is to create a shared Liquid
TemplateContext only once per scope for perf, on which we do once a shared contextualization and then a specific contextualization before each rendering.
- Shared contextualization is done once per scope: add scoped services in ambient values, call Liquid handlers to add more ambient/scope values and access strategies, add all scoped Liquid filters.
- Specific contextualization before each rendering: e.g contextualize the localizer with the current view context, update the specific model value and its access strategy.
And there are many places where we add a
ContentItem value to the Liquid scope, we could remove them because now most of the time it is already accessible through
Model.ContentItem. Here you can see that there is no need to create a new
TemplateContext and add the
ContentItem and the
Model to it, it's enough to just simply pass the
News from the community
Orchard Core on Stack Exchange Area 51
Area 51 is the Stack Exchange Network staging zone, where users come together to build new Q&A sites. New site ideas are proposed, discussed, and the best go on to beta. There is a request on Stack Exchange to create a custom community for Orchard Core. If you want to create a community you have to push for an idea and people need to approve and follow that idea. For this, it's needed more people to join and every person can vote for 5 questions and create 5 questions so, the community can continue on to the next stage. If you are interested in, check the FAQ of the Area 51 site and feel free to join the proposal!
Orchard Nuggets: How to use Orchard Core without the sample themes?
Try to reference the
OrchardCore.Application.Cms.Core.Targets NuGet package instead of the
OrchardCore.Application.Cms.Targets in your ASP.NET Core web application, that will only add the TheAdmin theme to your solution. In our third Orchard Nuggets post, we show you the differences between these two packages! Check out the other posts for more such bite-sized Orchard tips and let us know if you'd have another question!
Orchard Dojo Newsletter
Now we have 112 subscribers of the Lombiq's Orchard Dojo Newsletter! We have started this newsletter to inform the community around Orchard with the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post published to Orchard Dojo, including This week in Orchard of course.
Do you know of other Orchard enthusiasts who you think would like to read our weekly articles? Tell them to subscribe here!