This week in Orchard - 03/22/2019

This week in Orchard

Read our post about implementing content type permissions, prevent loading all workflows in the startup and many more. In this week you will also learn about when you should use layers?

On Orchard 1.x

Orchard 1.10.3 release

In case you missed: new Orchard CMS 1.10.3 release is here including PostgresQL support, new C# version support, and static razor compilation.
You can download the release from GitHub!

On Orchard Core

Fixing TenantApiController swagger support

When you use Swagger, in the case of the TenantApiController there were name conflicts. Swagger could not figure out which method to call on the GET, so now it's explicitly set.

Querying related content items

The GraphQL queries section of the Orchard Core documentation has been updated with content about how to get the related content items GraphQL query.

Use jsDelivr as the CD for Font Awesome

In the past, we used fontawesome.com, but in China, the perf of this CDN is very bad. jsDelivr provides a very good perf in China and everywhere else.

Implementing content type permissions

Every time we have a content type that is marked as Securable, it will appear in the permissions and you can grant permissions on specific content types. So, you will remove the manage content altogether, like edit content or publish content and then you can provide it at the content type level. It's also unlinking the ownership permissions also, which was not done before either. Meaning you can grant permission on editing on content, which means people can edit own articles. That means they can create articles and edit their own, but not publish them or creating drafts.

Prevent loading all workflows in the startup

Following nice guide called How to run tasks on application startup from a module, there is a new HttpRequestRouteActivator inheriting from ModularTenantEvents, that will load all the workflow types, that could wait for a webhook and register their route on the route provider.

Should I use Layers?

When we use the Blog recipe, there is a layer, that will inject the content of the footer from a plain HTML. This is injected by a layer, that is a predicate that could be true or false, that says 'Do I need to inject some HTML based on a condition?'. To evaluate this condition we use JavaScript, so every request, all the layers will be evaluated.
It's fast but it's not free. That would be the slowest thing to do in a page. We have some ideas in the future to improve the performance of the layers.

Now if you want to make it faster just don't use layers. If you don't need layers, don't use layers. Most of the time when you want to inject something, like a footer and you want to be able to edit it, you can create a custom type called section. This could be a FlowPart, that you could build dynamically with custom widgets. In the layout, you can load this content item by its alias and render it, because you can have a condition about in which page you want to render this content item.

So, layers are flexible, but if you don't need them, don't use layers, because it's slower then coding some Liquid or Razor directly.

Document OrchardCore.Tenants.FileProvider

The Static File Provider feature registers a file provider for each tenant in order to serve custom files per tenant, even if they have the same names.

You can find a documentation about the Static File Provider Feature under the Tenants option in ReadTheDocs.

On Lombiq

Orchard Core Demo in Singapore

There was a meetup at March 15, hosted by .NET Developers Community Singapore, about Hastlayer, Posits, and Orchard Core, where three members of Lombiq gave sessions about the mentioned topics. In Benedek Farkas's presentation, you heard the summarized history of the Orchard project and got an introduction to Orchard Core both from a user’s and a developer’s perspective.

You can find more about the .NET Developers Community in Singapore on their website.

Orchard Dojo Newsletter

Now we have 48 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 every time when 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!

If you are interested in more news around Orchard and the details of the topics above, don't forget to check out the recording of this week's Orchard meeting!

No Comments

Add a Comment