Our blog contains the activity stream of Orchard Dojo: general news, new resources or tutorials are announced here.

Featured tags

IIS
API
SMS
SEO
All tags >

Admin Dashboard Widgets, GitHub Issue Templates - This week in Orchard (24/01/2021)

This week we will see the new issue templates in GitHub, the new View Media Options permission, and have a demo about a nice upcoming feature called Admin Dashboard Widgets! Check out our current post for more! Orchard Core updates Adding documentation for Resources Libraries If you navigate to the OrchardCore.Resources project and open the ResourceManifest.cs file there you can see the list of the resources used by Orchard Core by default. That means if you would like to use jQuery for example in your site, you don't have to add this resource again from your theme or module because Orchard Core already has it. The goal of this table in the documentation is to collect all the used libraries with their versions. New View Media Options permission You can use the appsettings.json file to configure different media options like the supported sizes, allowed file extensions, and so on. But if you don't remember the exact values off the top of your head you had to open the appsettings.json file to check out the configuration values. To solve this issue, you can just easily navigate to Configuration -> Media -> Media Options that means you just need the admin UI of Orchard Core to see the values. And now you will find new permission called View Media Options that can be used to control who can be able to view the content of this site. GitHub Issue Templates If you found a bug while using Orchard Core or you just have a suggestion or an idea to make the CMS better, feel free to add a new issue on the GitHub page of Orchard Core. All you have to do is to select the Issues tab and click on the New issue button. This will navigate you to a new page where you can select what kind of issue you would like to submit. You can see three different kinds of options here: Bug report, Feature request, and Discussions. If you select the Discussions one, you can start a new discussion. GitHub Discussions is a collaborative communication forum for the community around an open-source project. Community members can ask and answer questions, share updates, have open-ended conversations, and follow along on decisions affecting the community's way of working. Check out the existing discussions related to Orchard Core here! But if you found a bug or have a new feature request, select from the first two options. If you do that, you will be redirected to these pages. Here you can add your issue by using nice issue templates that help us to investigate the given bug, like how can we reproduce your issue. Or if you have a feature request, the template could help us to understand better what is the problem that can be solved by adding this new feature to the system. Feel free to try out and use them when submitting new issues! Refactor media tokens This is about replacing the used Data Protection to encrypt tokens, as the encrypted token changed every server restart (because of course encryption should never produce the same value twice, for a given input). This caused the browser and/or CDN to refresh all the images every time the server is restarted/deployed. The is-cache wasn't affected by this, just the browser/CDN caches. Demos Admin Dashboard Widgets A few weeks ago we wrote about an upcoming new feature called Admin Dashboard that allows you to add cards to the homepage of the dashboard, which is about to represent a piece of functionality of a given feature or module. This feature is still under development and it has changed in the meantime a lot, so it's time to check out the newest improvements! First of all, go to Configuration -> Features and enable the Admin Dashboard feature. If you do that, you will see the following screen when you navigate back to the homepage of your dashboard. You can see one predefined card here with the title Orchard Core, and at the bottom of the card, you can see an Edit and a Delete button. Let's click on the Edit one! As you can see this is an Html Dashboard Widget content type with a Title Part and a HtmlBody Part attached. But under that, you can see a textbox called Position. By using that setting you can control the order of your widgets on the dashboard. We have just this one, so whatever you type here, this will be rendered as the first widget. If you click on the Add Widget button on the dashboard, you can create as many other Html Dashboard Widgets as you want. But now let's look under the hood and see how you can create custom dashboard widgets! Navigate to Content -> Content Definition -> Content Types and create a new type, call it Markdown Dashboard Widget. Add the Title Part, the Markdown Body Part, and the Dashboard Part to it. The Dashboard Part is the one, that you will need to attach to every content type that you would like to mark as a dashboard widget. By using that part you can set the Position of your widget. And the final thing you have to do is to set the stereotype of your content type to DashboardWidget. Now let's get back to the dashboard of the admin UI and select the Markdown Dashboard Widget after clicking on the Add Widget button. As you can see, if we set the position to 1, it will be rendered after the predefined one with the title Orchard Core. If we modify the value of the position, we can change the ordering of the widgets. But that's not all! Head to YouTube now to see a video about this upcoming new feature! News from the community Execute an Orchard Core shape into HTML sample in the Lombiq Training Demo for Orchard Core The Lombiq Training Demo for Orchard Core is a demo Orchard Core CMS module for training purposes guiding you to become an Orchard developer. You can use this module as part of a vanilla Orchard Core source that includes the full source code - which is the recommended way. You can also use it as part of a solution that uses Orchard Core NuGet packages, however, it's harder to look under the hood of Orchard Core features. And now the module just got a new sample about how to execute an Orchard Core shape into HTML! Check it out now if you're learning Orchard and you haven't seen this feature yet! Work with us! You've completed the Dojo Course, congratulations! You’re now officially an Orchard Core developer. Would you like to work on a variety of challenging Orchard Core projects with the biggest Orchard team in the world? Work with us! Just send us an e-mail to crew at lombiq.com. Please include what you’re most interested in professionally and attach around 100 lines of any kind of code that you’re especially proud of or just link to the favorite open-source project of your own on GitHub or else. Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 185 subscribers! 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! 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!

Placements module, Admin UI improvements - This week in Orchard (17/01/2021)

This time we would like to show you the new features of the Placements module, drop a few lines about the 1.0 version of the Shortcodes module and give a recap about the latest improvements of the admin UI. Check out our post for more! Orchard Core updates Placements module V2 We can do quite everything without creating any module or theme, but it's not possible to override default placement. It could be helpful to have a UI where you can easily define placement rules. Either we can add this to Part/Field settings or add a distinct UI (like the "Templates" one) where we can define a list of placement rules. The Placements module adds an optional feature that lets the user define custom placements rules in the admin UI. This V2 of the module is a rewrite of the original one, it uses IShapePlacementProvider to provide placements at runtime. The IShapePlacementProvider interface allows to asynchronously (useful if it relies on an async placement store) build an IPlacementInfoResolver for each IBuildShapeContext. The IPlacementInfoResolver implementation keeps placement rules for the current IBuildShapeContext to be able to quickly resolve shape placements synchronously. But don't go into too many technical details right now, lets's see how you can use this feature! Set up your site using the Blank site recipe then head to Configuration -> Features to enable the Placements module. Now you will find a new option under Design, called Placement. But don't go that far! We set up our site using the Blank site recipe so we don't really have much content on our site. To test out that feature we will need to define at least one content type. Let's do it quickly! We have just created a new Page content type, added a Link Field to it, and some Parts: the Title Part, the Flow Part, and the HtmlBody Part. Let's create a new Page content item and preview it! You should see something like that: the title of the page content item, the link field, the widgets in the Flow Part, and the content of the HtmlBody Part. Now it's time to go back to our Placements module. Let's say we would like to hide the LinkField of our page. To do that, navigate to Design -> Placements and add a new placement. Call it LinkField because we would like to modify that field right now. And the Placement rules text is prepopulated with null values. To hide the Link Field, just simply modify the place value to "-". Note that this will hide every Link Field of the site! But sometimes it's not obvious how to write the placement rules correctly for the first time. You have to know some words about the content templates, shape differentiators, content part and field differentiators, and so on. And here comes another great feature of the Placements module! Let's say we would like to hide the editor of the link field. Navigate to Content -> Content Definition -> Content Types and select the Page. Hit Edit and Edit again near the Link Field. Here you will find a new Edit placements button that contains some predefined placements for our Link Field (named Source). If you click some of those, a new placement will be created. Let's select Placement in admin editor for the Source field in a Page. This will generate the following placement: As you can see here, the type of shape is LinkField_Edit and the differentiator has the Page-Source value. That means to target the editor of the Link Field called Source of the Page content type. If you say "-" for the place, it will hide the editor of the Link Field when creating or editing Page content items. New IsImageFile Orchard helper Instead of using a RegEx or something like that, there is now a new IsImageFile Orchard helper that uses a static HashSet that contains the possible allowed file extensions that an image file could have. Just use this helper to determine if a path is an image file. Shortcodes 1.0.0 is here There is a Shortcodes module in GitHub created by Sébastien Ros that is a shortcodes processor for .NET with a focus on performance and simplicity. It allows text content editors to inject specialized content blocks using custom arguments, like images, Twitter embeds, youtube videos, only with simple blocks like [video 123]. It has several features, like supporting async shortcode to execute database queries and async operations more efficiently under load or supporting named and positioned arguments. And this is the library that is integrated into Orchard Core to be able to work with shortcodes. We mentioned the Shortcodes feature of the CMS several times in This week in Orchard, for example here, now let's focus on the latest changes of the module. The big news is now this module was come out from the beta version! Let's mention the biggest change of this new version. David Hayden was trying to write a blog post with some C# code inside and in the C# code there were some attributes and there were some Shortcodes in the attributes. When you evaluate a Shortcode using this library it just outputs to nothing if it's unknown. This means all the attributes from the code were removed. From now if there is an unknown Shortcode or it can't be parsed, the module will just output it as is. AutoroutesEntries Atomicity and Size This allows for synchronization between multiple nodes of a cluster, specifically for AutoRoutes. If you are on one node and you create a new AutoRoute, then the other nodes will update their AutoRoute mapping for the new AutoRoute. It's not just about data to load, it's also updating the resolution list: a dictionary that maps content items to routes. There is an AutoRoutePartIndex that is used to detect what had changed since the synchronization of the last element. Every YesSql index is updating things with an incremental identifier so, if there is a change on one AutoRoutePart it's not updating the previous indexes, it's just adding new indexes and removing the previous one. Now, this index is used to just sync every node to the new state. It's like a synchronous pattern, the index just shows the new things that happened on the AutoRouteParts, and then it's applied directly to the AutoroutesEntries structure. Check out the AutoroutePartIndexProvider class in the dev branch! Demos Admin UI improvements The admin UI of Orchard Core got several improvements lately. In the demo of our current post, we will check out the updated UI. Let's start! When you navigate to the admin UI of your site you can see the Orchard logo and the name of your site on the left side of the top bar. From now if you click on it, it will navigate to the home page of the admin theme. But don't worry, you can still easily navigate to your site, just use the little arrow at the right of the top bar. Oh, and one more thing: if you click on that little user icon on the right, you can see the user name of the currently logged-in user. If you have the Tenants feature enabled you can add tenants to your site. The list of the tenants is now a little bit different. You can see the name of the database preset, the description, the used recipe, and the state of the tenant. Now let's navigate to the content items list to check out the new design there too. You can see that every line start with the display text of the content item, followed by the content type, the status of the content item, the date of the latest modification, and the author of the content item. You can see that the About article has a draft and a published version too. And lastly, go to the Design -> Widgets page and check out the design there. You could see we have two widgets right now, the one with the display text My widget is a content type of Container that has two versions and associated with the Homepage layer. The other one is placed on the Always layer. And that's not all of the improvements and more are just on the way! Check out this recording on YouTube to know more! News from the community Work with us! You've completed the Dojo Course, congratulations! You’re now officially an Orchard Core developer. Would you like to work on a variety of challenging Orchard Core projects with the biggest Orchard team in the world? Work with us! Just send us an e-mail to crew at lombiq.com. Please include what you’re most interested in professionally and attach around 100 lines of any kind of code that you’re especially proud of or just link to the favorite open-source project of your own on GitHub or else. Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 184 subscribers! 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! 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!

Secrets module, Cookie based dark mode theme - This week in Orchard (10/01/2021)

We start this year by showing you the latest updates of the Dark mode of the admin UI. After that, you can read about how can expose your Lucene or SQL queries through GraphQL! Finally, we will check out the latest improvements to the Secrets module! Orchard Core updates Dark mode V2 (cookie based) A few weeks ago we mentioned that now you can use the dark mode for your admin theme. The only thing you have to do is to go to Configuration -> Settings -> Admin and check Enable dark mode admin theme. The new version of dark mode contains several improvements: Cookie based settings storage. Use only one CSS to prevent flickers and animations when switching from light to dark mode and vice versa. Use data-theme on HTML element. Fixing several modals. Fix GraphiQL styles (Codemirror global styles conflict). But what does cookie based mean? Find the DarkModeService.cs file in the OrchardCore.Themes project and check out the IsDarkModeAsync async method in it. As you can see, there is an adminPreferences cookie collection, that contains a darkMode boolean property. If it's true, that means the dark mode has been applied to the admin theme. And here comes the trick! If you check out the first few lines of the Layout.cshtml file of the admin theme, you will see that the code checks if the dark mode is currently enabled or not and puts the CurrentTheme value into the data-theme data attribute. Tutorials page in the documentation Many external resources are available in order to teach you how to develop with Orchard Core and keep you informed with the latest news and the goal of the Resources page is to give you a nice overview of these resources. Now you can find a new Tutorials page that lists some content that you can use to learn Orchard Core. Here you can find our Dojo Course 3 video series or the Orchard Core Training Demo module! Custom query schema fix and documentation Method BuildSchemaBasedFieldType inside LuceneQueryFieldTypeProvider.cs and SqlQueryFieldTypeProvider.cs was wrong because official JSON schema should look something like this: { "type": "object", "properties": { "firstName" : { "type" : "string" }, "age": { "type": "integer" } } } The line where code tries to get type specifically child["type"] will throw an error of System.InvalidOperationException: 'Cannot access child value on Newtonsoft.Json.Linq.JProperty.'. foreach (var child in properties.Children()){ var name = ((JProperty)child).Name; var nameLower = name.Replace('.', '_'); var type = child["type"].ToString();... The fix was something along the lines of and the properties key should be lowercase. foreach (JProperty child in properties.Children()){ var name = child.Name; var nameLower = name.Replace('.', '_'); var type = child.Value["type"].ToString();... You can find nice documentation here that tells you how you can expose queries through GraphQL. Demos Secrets Module We mentioned the latest updates regarding secret management back in September and now here comes the continuation of this upcoming feature. If you haven't known about it yet, you should definitely check out that post and the two recordings on YouTube. So, let's see what we are talking about exactly! The idea here is to extend some of the places that we can use to store secrets. For example, let's navigate to the Email settings (Configuration -> Settings -> Email) and say we require credentials for authentication. And of course, we need to define a user name and a password. The password is get stored with data protection. But if we export this to a production server where the data protection keys are different, the setting will no longer work and you can get an exception when you would like to use it. As you can see on the screen, the concept here is to have a secret where you select which secret you would like to use. We have already defined one called email, let's select this one. We managed that secret and the value of it under Configuration -> Secrets. Here we can select where we would like to store this secret, which can be the Database Secret Store or the Configuration Secret Store. But if you enable the Azure KeyVault Secrets Store feature, you can use the KeyVault store too. Normally when we have a form, we use an HTTP Request event to drive the form to a workflow. Let's create one Workflow, call it Form Submit and add an HTTP Request event to it. Normally what we have in the query string is a token here which is protected with data protection but we could have a little problem with it. When you use this in a Form widget and you have moved the form to a production server, it doesn't work because the token was no longer valid because it is was stored using a local data protection key. But we have a solution for that too! Here you can notice one new option called HTTP Request Event Secret. You can just simply type a preferred name to the secret and hit enter, which will create the new secret for you. Now let's create a form. If you set up your site with the Blog recipe, you can just simply enable the Forms module and create a new Page. Add the Form widget to the FlowPart where you can see the same picker that we can use to select the given secret that we would like to use. If you pick a secret, you don't need to specify the action (the URL to submit the form to) because it is stored in your HTTP request event secret and that will override the specified action value of the form. If you navigate to Configuration -> Secrets, you can check out the details of the formsubmitted secret that we have just created. The difference here is that now you have a picker here that lists all the workflows that have an HTTP Request Event as a starting activity. By using that picker you can assign this secret to another workflow if you would like to. But we are just scratching the surface of this feature and haven't talked about anything about how you can import/export your secrets using deployments plans. If you are interested in more, don't forget to check out this recording on YouTube! News from the community Our full Orchard Core tutorial series, the Dojo Course 3 is here! After a long wait, the new Orchard Core version of our legendary Dojo Course tutorial series is here, the Dojo Course 3! Are you a newcomer and want to learn Orchard Core from the ground up, both from a user's and a developer's perspective? Are you somewhat familiar with Orchard Core but would like to get up to speed and become an Orchard pro? Look no further, check out Dojo Course 3! Dojo Course 3 guides you from the very basics of Orchard Core all up to be able to write your own themes and modules, utilizing various APIs of Orchard. If you're looking for our previous Orchard 1.x tutorial series check out Dojo Course 2. Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 183 subscribers! 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! 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!

Admin Dashboard, Display titles in the top bar - This week in Orchard (24/12/2020)

Option to display page titles in the top bar on the admin UI, documentation for external libraries, new FileDocumentStoreAttribute, and a lot more are waiting for you in our last blog post for this year. Let's get started! Orchard Core updates Display titles in the top bar Set up your site using the Blog recipe, then navigate to the admin UI of the site. Head to Configuration -> Settings -> Admin. Here you will see a new option, called Display titles in the top bar. Let's put a tick here and see what will happen. If you save it, the titles will be placed in the top bar of the admin theme. The only thing you have to do is to slightly modify the appearance of the title of your page in the admin UI by making sure to put it in the Title zone. <zone Name="Title"><h1>@RenderTitleSegments("My page")</h1></zone> So, if you set that you would like to display the title in the top bar, then the Title section will be rendered in the top bar section of the theme, otherwise, it will stay in its own place. Hide connection string when already set for the tenant When a connection string is defined in an environment variable, the value is displayed on the Tenants creation page: $env:OrchardCore__ConnectionString="server=localhost;uid=root;database=db;password=my-secret-pw;"$env:OrchardCore__DatabaseProvider="MySql" Now if the connection string is coming from the configuration in the setup screen, then it's not displayed anymore, and this way we can't change it. The SetConfigurationShellValues method in the AdminController of the OrchardCore.Tenants module checks the values of the shell settings based on the ConnectionString and DatabaseProvider keys and if there are any, the EditTenantViewModel will get these values. And now we can only show the given sections on the front-end if these values haven't been set from the shell settings. External libraries documentation Orchard Core uses several external .NET libraries, like Jint, YesSql, and Fluid. But you can find several Client-side libraries here too, like GraphiQL, TypeScrip, React, or Vue. The goal of this new page in the Orchard Core documentation is to list all of the used libraries with their version. FileDocumentStoreAttribute providing a FileName By default, the file name is equal to the name of the related document type, e.g. ContentDefinitionRecord => ContentDefinitionRecord.json. So, for compatibility, this attribute allows keeping the current ContentDefinition.json without having to manage this specific case in FileDocumentStore with a hard-coded string. Add the email optional claim steps to AAD integration document If you follow this how-to guide, you can build a blog that allows users to login with their AzureAD account and gets assigned roles based on the Security Groups they belong to. However, the documentation hasn't mentioned yet how to set up optional claims to configure additional information when you are registering a new application (App registration) on the Azure Portal. Now this how-to has been updated with the way how you can add optional claims (like email) to your configuration. Demos Admin Dashboard To see this new feature the only thing you have to do is to just simply set up your site and navigate to the admin UI. After you will get a screen something like this. Here you can see cards, that are dashboard items, that are about to represent a piece of functionality of a given feature or module. For example, the one called Content items is coming from the Contents module and by using that, you can easily do some content-related functions (like listing the latest or the draft content item). It's pretty straightforward, so let's look under the hood to see how you can create your own dashboard items. But first, let's see how the site renders the items on the homepage of the admin UI. The AdminDashboard.cshtml in the OrchardCore.Admin module is just about to display the SummaryAdmin display type of every AdminDashboardItem that can come from any module. Let's see the first card with the title Content items. If you open up the Views folder of the OrchardCore.Contents module, you will find a view with the filename AdminDashboardItem.SummaryAdmin.cshtml. Here you can see the HTML structure of a Bootstrap card item with the custom content inside it, which in our case is some links to the AdminController in this module. We have a driver too to say display the SummaryAdmin display type and place it in a given location. That's all you have to do to have a new card on the homepage of the admin UI. This feature is under development and might be changing in the future. And it has been already changed just before we finalized this blog post. :) But what are the exact changes here? Well, that will be covered in an upcoming post, stay tuned for that! If you would like to know more about this, check out this recording on YouTube! News from the community A new website using Orchard Core: AeroSpace Cornwall AeroSpace Cornwall is a research, development and innovation fund, that enables businesses to take their idea and turn it into a viable product ready for market in the space and aerospace sectors. Check out this site to see the loads of capabilities that you can achieve using the CMS. If you are interested in more websites using Orchard and Orchard Core, don't forget to visit Show Orchard. Show Orchard is a website for showing representative Orchard CMS (and now Orchard Core) websites all around the internet. It was started by Ryan Drew Burnett, but since he doesn't work with Orchard anymore, as announced earlier it is now maintained by our team at Lombiq Technologies. Our full Orchard Core tutorial series, the Dojo Course 3 is here! After a long wait, the new Orchard Core version of our legendary Dojo Course tutorial series is here, the Dojo Course 3! Are you a newcomer and want to learn Orchard Core from the ground up, both from a user's and a developer's perspective? Are you somewhat familiar with Orchard Core but would like to get up to speed and become an Orchard pro? Look no further, check out Dojo Course 3! Dojo Course 3 guides you from the very basics of Orchard Core all up to be able to write your own themes and modules, utilizing various APIs of Orchard. We're publishing a tutorial video every day for 40 days starting on 1 December. So, this is your 40 days of Orchard :). Videos about Orchard Core development are on the way, you can see a new one every day! If you are really interested in the coding part, the upcoming, almost 20 videos are specially for you. If you're looking for our previous Orchard 1.x tutorial series check out Dojo Course 2. Christmas in Lombiq Sometimes we do stuff. Together. Not (just) in front of computer screens. These are some usual events in Lombiq that are all announced and arranged in advance. We periodically have an event called RnDay: this is a few hours long event where we share with each other what we recently worked on and what we plan to do. E.g. if we recently finished a project then the project's team members demo what they've done. Last week we had our last RnDay for this year but this time we have to make it online. We also named this event to The 13th RnDay - Pandemic Edition! We also tried to do our best to make a nice group photo, you can see the result down below. :) We would like to thank you all for reading our posts and making the Orchard community stronger together with us! We hope that we could give you valuable news and demos about the happenings around Orchard and Orchard Core from time to time by reading our posts and of course the This week in Orchard newsletter. We would like to wish everyone a Merry Christmas and a Happy New Year! See you next year! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 178 subscribers! 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! 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!

User Picker Field, the new user ID - This week in Orchard (06/12/2020)

This time we will do a little deep dive and check out some important changes in the code base of Orchard Core. But don't be scared, we promise you will like these changes, especially the demo about the new User Picker Field! Orchard Core updates Allow media width and height values without a token You could see a demo a few weeks ago in this post about the new options for Media Field where you can set the alt text of your image and you can also crop your images using a nice media crop picker. The way it was working is it's putting different kinds of options to the query string that allows you to manipulate your image. Let's see the following URL for an example: https://localhost:44300/media/post-bg.jpg?width=1&height=600&rmode=crop&rxy=0.2,0.5. Here you can see we set the width and height of the image from the media library. We also set the resize mode for the processed image with other parameters as well. A few days later the community introduced a new bool option added to the MediaOptions called UseTokenizedQueryString to encrypt the image processing query string to prevent disc filling, that is true by default. And now here comes another great stuff that allows values for width and height to be provided via the query string even when tokens are enabled. What does it mean? Let's see an example of it! Set up your site using the Blog recipe then open the default banner image URL of the predefined blog post with the following query string parameters: https://localhost:44300/media/post-bg.jpg?width=1024&height=600. Note that the tokens are enabled by default, but you can still set the width and the height of the image now. Don't forget that this will only work if the height and width values match the supported sizes array values. Introduce Culture Scope There is a new CultureScope class that you can use if you want to locally set the current culture (the current user interface culture and the culture used by the current thread). You can find several unit tests to see how you can use it, but check out this one for now. Here you can see that the culture is set to French, but that setting only applies inside the using statement. Implement UserId All the user profiles that you have locally, now have a new property called UserId, which is unique. We used to use a name, the user name as the way to identify a user. But now the community decided to use a unique ID such that you can't guess user ID or you can't recover another set or permission or ownership by mistake, because an account has been deleted and someone created a new account using the old name and somehow the logical references are still kept based on this name and you would inherit something from that. So, to prevent that, Orchard Core is using now a user ID. If you take the latest version of the dev branch and just run your code there will be a migration that copies the user names of the existing users as the user ID. This way you don't have any change in your content, it will still work the same and be careful that your user ID equals a string like 4gq8jagmrtxrwvg21csa0b6y4y, which is safe, because the next time someone creates a new user, they can't impersonate anyone else like recovering an old account, because it will be a newly generated unique identifier that can't match something like that. And how can you find the currently logged in user? Check out the code in the DefaultContentsAdminListFilter where you can see that now, instead of using the user.Identity.Name, you can use the FindFirstValue extension method from ASP.NET Core to return the value of the first instance of the specified claim type, or null if the claim is not present. And then you can set that value as the Owner of the content item. Demos User Picker Field Let's say you would like to create a blog where multiple users can create blog posts and you want to connect the user account of the author user with the given blog post by showing the name of the user somewhere in the detail view of the post. It's easy because the users can log in to the admin UI of Orchard Core and publish their own posts. In this case, they will be the authors of the given content items. But let's say we don't want to give them access to the site. We just want them to send the content of the blog post to a given email address and the site editors will edit and publish the posts. Is there an easy way to connect content with user accounts in Orchard Core? Set up your site using the Blog recipe. This recipe comes with a predefined blog where you can create new blog posts. The posts can have several properties: the title, the banner image, tags, the category, and so on. We will modify the content definition of the Blog Post to do some tricks. Navigate to the admin UI of Orchard Core and head to Content -> Content Definition -> Content Types and edit the Blog Post one. Click on the Add Field button and find the recently added one, called User Picker Field. This field allows you to connect users with a content item. Here you can say that you want to allow multiple users to be selected, allow the picker to display users from all roles, and many more. If you put a tick on the Display All Users checkbox, every user will be in the list that you can choose from, if you remove the tick, the available roles in the system will be listed and you can choose from them. Now if you edit the predefined blog post, you will see the User Picker Field in action. In this case, we have two users in the system named admin and editor. The admin is the superuser with the Administrator role and the editor user has the Editor role. We can see both of them because we said we would like to allow the picker to display users from all roles. If you save your content item, the field will show you the user names of the selected users seperated by a comma (if you selected multiple ones). And you will see a No users. message is you haven't selected any users. You can find some lines about the User Picker Field in the documentation of Orchard Core and a nice presentation of this feature on YouTube! News from the community Our full Orchard Core tutorial series, the Dojo Course 3 is here! After a long wait, the new Orchard Core version of our legendary Dojo Course tutorial series is here, the Dojo Course 3! Are you a newcomer and want to learn Orchard Core from the ground up, both from a user's and a developer's perspective? Are you somewhat familiar with Orchard Core but would like to get up to speed and become an Orchard pro? Look no further, check out Dojo Course 3! Dojo Course 3 guides you from the very basics of Orchard Core all up to be able to write your own themes and modules, utilizing various APIs of Orchard. We're publishing a tutorial video every day for 40 days starting on 1 December. So, this is your 40 days of Orchard :). In the first few videos, we gave you an introduction to Orchard Core and showed you a way about how to set up your first Orchard Core website. After we started to talk about the content model of Orchard Core, checking out the basics of content management. We will stay in the admin UI for a little in the upcoming days and check out the other basic features of the CMS like how to add widgets with layers, managing the menus, and the media files. After we will see how can you search and index content items, and build forms using the Forms and Workflows feature. But we will not spoil the topics of the upcoming videos. :) If you're looking for our previous Orchard 1.x tutorial series check out Dojo Course 2. Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 172 subscribers! 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! 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!

Dark mode admin theme, new locale Shortcode - This week in Orchard (20/11/2020)

The dark mode for the admin theme is here! But first, let's check out the new locale Shortcode, the new Select HTML tag in the Forms module, and many more! Orchard Core updates New locale Shortcode This Shortcode will take the text between the tags and only display it if the current culture is the one specified. In this case, write English Text for the English culture and write French Text for the French culture. It also supports culture fallbacks. So, if your culture is en-CA and you would like to show the French text, it will fall back to en. Note that it's not content localization, it's just text localization that you want to use in your templates. Read more about it in the docs! [locale en]English Text[/locale][locale fr]French Text[/locale] New HTML select tag with options for Forms Set up your site using the Agency recipe. Then navigate to the admin UI of Orchard Core and head to Configuration -> Features to enable the Forms module. Now create a new Page content item. This content type has a Flow Part attached and because of that, we can add widgets to this content item. We added a new Form widget here and inside the Form, we added the new Select widget. By using the Select widget, you can have an HTML <select> tag that creates a drop-down list with the options you provided. In this case, we created a Donation drop-down list with two options. You can also predefine the option you would like to be selected by default. Listing Code owners When submitting a PR updating code you're not familiar with, it's not always easy to determine who's the right person to be assigned to for review. To fix that, the community established a list of code owners who will be automatically pinged when the code they own is updated by a PR. Read more about the code owners feature of GitHub here! Add classes / IDs to buttons in admin to allow easier selection in E2E tests This improvement is about adding IDs and classes to different HTML tags in the admin interface. This will allow us to write better selectors for E2E testing. So from now on, if you would like to target specific elements of the admin UI, like buttons to enable or disable a given feature or to run a given recipe, you will have an easier way to do that, because of the additional classes and IDs that you can find in the HTML source code. Recommended development tools for Orchard Core What tools do we recommend to build your app with Orchard Core, or work on Orchard itself? In the end, this is up to your personal preference since as long as you can edit source files and build the app you can use any tool on any platform that .NET Core supports. Check out this page in the documentation to get you going for the general editing experience as well as for other useful tools. Orchard Dojo Library is a portable package of coding and training guidelines and development utilities. These are also part of the best practices and guidelines we use at Lombiq. This library contains Visual Studio code snippets to quickly generate code in some common scenarios for developing Orchard Core modules and themes. To effectively use this collection of VS snippets just point the Snippets Manager to where you cloned or downloaded this folder. To do this, go to Tools → Code Snippets Manager → select the C# language → Add and add the whole folder. For Razor snippets to also work select the HTML Language and do the same. Do note that Razor snippets will only be suggested when you hit Ctrl + space first. You can download the snippets from this GitHub repository and check out this recording to see more snippets in action! Add support for sending email attachments You can use the SendAsync method from the SmtpService to send emails from Orchard Core. The MailMessage class represents a class that contains information about the mail message. And now this class has a new property called Attachments which is a collection of message attachments. Use the MailMessageAttachment class to provide attachments by setting the attachments' filename and the attachments' file stream before calling the SendAsync method to send out your email. Demos Dark mode admin theme Set up your site and navigate to the admin UI. Then go to Configuration -> Settings -> Admin and check Enable dark mode admin theme. If you save the setting you have the option to toggle dark mode for the admin theme. If your OS is using dark mode, it will automatically applies the dark mode theme for you. You might notice that there is a new button in the upper-right corner of the admin theme with different icons: Sun and Moon represent the light and dark mode, respectively. If you switch to the dark mode the admin UI will have the following look and feel. But that's not all of it! Check out this recording on YouTube to know more about the dark mode! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 168 subscribers! 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! 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!

New full_text Liquid Filter, Media Field improvements - This week in Orchard (14/11/2020)

See the improvements of the Media Field, the new full_text Liquid Filter, the enhancements of the admin UI, and many more in our upcoming post! Orchard Core updates ListContent Permission as Content Type dynamic permission Install your Orchard Core site with the Blog recipe and head to the admin UI. Navigate to the Security -> Roles and hit Edit near one of the roles. Type list in the search box that will list you some new permissions: the new ListContent permission on each Content Type. However, the global ListContent permission is of course priority over these. That means now you can decide which content items you want to list to the users in the given roles by using this dynamic permission. New full_text Liquid Filter Now there is a new Liquid filter called full_text. This lets you extract the full-text aspect of a content item. A full-text aspect being like metadata that we can get from any content item to represent it as full text. The goal being to be able to define custom full text for custom content types that will themselves use a full text of subitems. Let's say you have a Bag Part and you want to make your full text comprised of every full text of the items that you have in the Bag Part. To do that you can do a foreach on every item in the Bag Part and then you can call into their full text to provide it. Sticky bars on top while scrolling Last week we mentioned that the Features page has a new sticky bar on scrolling for very long pages instead of the scroll to top button. The good news is now more and more pages get this sticky bar on the admin UI. The Content Types page (Content -> Content Definition -> Content Types), the Content Parts page (Content -> Content Definition -> Content Parts), the Tenants page (Configuration -> Tenants), the Users page (Security -> Users), and the Recipes page (Configuration -> Recipes) are now also have a sticky bar. Fix double encoding of non-HTML strings in feed You can use the PopulateAsync method of the CommonFeedItemBuilder to build the RSS feed items using your content items. The RSS feed items have several properties like the link, guid, title, description, and so on. When we set the value of the title by calling the feedItem.Element.SetElementValue, the text that we pass will be encoded, so we don't need to encode it again, otherwise, we get it encoded twice. The same issue has been fixed in the ListFeedQuery feed query provider too. Initializing Liquid Include Filter There is an Include tag in Liquid that allows you to include an external Liquid file and in Fluid it's available through a FileProvider property, and in this case, the FileProvider property of the ILiquidFileProviderAccessor will be assigned to the LiquidTemplateContext. That means you can use it in your modules and your embedded assets. But how can you use that Include filter? Include your Liquid file using the {% include "Areas/TheBlogTheme/Views/Test" %} expression. This will include the Test.liquid file from the Views folder of the Blog theme. Demos New Media Field option to encrypt the image processing query string You could see a demo last week about the new options for Media Field where you can set the alt text of your image and you can also crop your images using a nice media crop picker. The way it was working is it's putting different kinds of options to the query string that allows you to manipulate your image. Let's see the following URL for an example: https://localhost:44300/media/post-bg.jpg?width=1&height=600&rmode=crop&rxy=0.2,0.5. Here you can see we set the width and height of the image from the media library. We also set the resize mode for the processed image with other parameters as well. Now there is a new bool option added to the MediaOptions called UseTokenizedQueryString to encrypt the image processing query string to prevent disc filling. That's true by default so you can try it out right away! To do that just simply open the predefined blog post and view the page source in your browser. Find the header HTML tag, where you can see how Orchard Core sets the URL of the background image. And that's not all of it! If you would like to know more about this feature, don't forget to check out this recording on YouTube! Orchard Core OpenID Connect Code Flow Api BlazorWASM We mentioned the Blazing Orchard project two weeks ago here in This week in Orchard that is a modular application framework that turns your Blazor project into a CMS-powered Blazor application by leveraging Orchard Core as a decoupled backend/CMS server using its REST & GraphQL APIs. In this demo, you will see a solution, that contains an updated version of Blazing Orchard that also contains OpenID Connect Authentication! Head to YouTube now to see the recording of this demo! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 169 subscribers! 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! 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!

Distributed cache, Media crop picker - This week in Orchard (08/11/2020)

This week we will see the new IDocumentStore, which is a cacheable, committable, and cancellable document store allowing to get documents from a shared cache. And don't forget to watch a demo about how you can add an alt text and crop the images of your Media Field! Orchard Core updates Make features actions sticky while scrolling If you navigate to the admin UI of Orchard Core and head to Configuration -> Features, you will see all of the currently available features of Orchard Core. This list is now getting longer and longer, so the idea here is to use a sticky bar on scrolling for very long pages instead of the scroll to top button. The first page that gets this sticky bar is the Features page, which looks like the following now. Edit button for lists in DetailAdmin view This is a feature that was already there in Orchard 1. When you want to edit something in the admin, you can return a route to the controller that will edit an entity. Or that will display it as a list or display it as a detailed object in the admin. And when you have a list, you have two options. Either you want to show all the content of this list or you want to actually edit the list itself. And to do that, when you see a blog and you click the link of the blog in the content items, it will go to the list of blog posts. This is the DetailAdmin view. And if you actually want to edit the blog you need to click on the edit button. This feature is about adding a new button for the list and you are now not confused about clicking the link or click in the properties button. Move feeds to feature There is a new feature now in Orchard Core called Feeds. Don't forget to enable that module if you would like to have feeds capabilities on your site! Generate xml documentation (comments) for nuget packages Whatever documentation we put on the files, they were not available, because if you don't put the GenerateDocumentationFile tag then it's not generated in the XML file that contains all the documentation, it's not embedded into NuGet, and Visual Studio won't load it. You need that to export your API docs. Not even to generate documentation, just to be able to have it in the NuGet package for the IntelliSense. If you don't do the NoWarn, every public member that doesn't have an API doc would fail the build. The <NoWarn>$(NoWarn);CS1591</NoWarn> removes the warning that some public members do not have comments. Now you will have more documentation when they use the NuGet packages to build sites! Distributed cache Whenever you want some cacheable document that is stored in the storage using YesSq for instance you need to inject the IDocumentStore interface. This will use YesSql to load the document and it will be able to cache it. So, for instance, if you would like to get the site settings you can use the IDocumentStore to do that because it's stored as a document and you want to cache it. And then when you load the site settings using IDocumentStore by passing the type, you can say GetOrCreateImmutableAsync or GetOrCreateMutableAsync. Mutable meaning that when you load the site settings just to read it, you want to say I want an immutable object. And when you want to load the site settings to update it, then use the GetOrCreateMutableAsync method. The difference is in the way that it will either cache it or not and also would it take it from the cache or not, or put it back in the cache or not. Or invalidate the entry in the cache. And there is the IFileDocumentStore which has the same methods as the IDocumentStore, but it's a totally different service. This one can be used to store a document on the file system that can be also cached. But it's a different store. We use the IFileDocumentStore to store the content type definitions. Demos Media crop picker and Alt text editor Set up your site using the Blog recipe. That recipe comes with the Blog Post content type that has the Banner Image Media Field by default. Let's check out the predefined blog post content item to see the new features of the Media Field. If you select the post-bg.jpg image and click on the button with the speech bubble icon, you can set the alt text for the image. Another new button is doing a more interesting thing. If you click on the button with the target cross icon, another new modal window will open where you can select the anchor for the selected image. Using the target cross, you can easily specify the crop point of the image. If you open the preview in another window you can easily see the changes of the image in real-time. But how you can enable/disable these options? Navigate to Content -> Content Definition -> Content Types and hit Edit near the Blog Post and edit the Banner Image settings. Here you will find two new options. One is about allowing alt text and one is to allow the center cropping. These are on by default, that's why you could see the mentioned buttons when you edit the media field. And that's not all! If you would like to know more about this feature don't forget to check out this recording on YouTube! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 172 subscribers! 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! 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!

Blazing Orchard, Replace and Delete Content Definition Deployment Steps - This week in Orchard (30/10/2020)

Blazing Orchard is a modular application framework that turns your Blazor project into a CMS-powered Blazor application by leveraging Orchard Core as a decoupled backend/CMS server using its REST & GraphQL APIs. Check out our current post to read more about Blazing Orchard and many more! Orchard Core updates Introduce Replace and Delete Content Definition Recipes The Content Definition Recipe deployment step always merges settings. When using this on a dev/stage/prod environment this means arrays, like BagPartSettings and FlowPartSettings are merged. When you've removed a content type on dev, and removed it from the BagPartSettings this change is not reflected on the server when the content definitions step is running. What also happens is the widget content type definition also remains, as the recipe only focuses on updating the definitions in the step. Of course, this is good for the scenario where definitions may have changed on both servers, and for bringing them into sync (kind of, but that scenario gets a bit confusing). But don't worry! Here comes two new deployment steps and recipes to the rescue! Replace Content Definitions: Replaces or Creates Type and Part Definitions. Delete Content Definitions: Allows a comma-separated list of types and/or parts to delete. Let's check them out! Set up your site using the Blog recipe then navigate to the Configuration -> Import/Export -> Deployment Plans and create a new deployment plan. Hit the Add Step button if you are ready and search for the Replace Content Definitions step in the Available Steps modal. Here you can see a list containing all of the available content types and content parts that you have in your tenant. If you choose something from the list, the type and part definitions will be removed and recreated. The Delete Content Definitions deployment step is just about to delete your content type and content part definitions. Remove type="text/javascript" from script tags The W3C validator checks the markup validity of Web documents in HTML, XHTML, SMIL, MathML, etc. The validator found a warning in an Orchard Core site that says: The type attribute is unnecessary for JavaScript resources. If you open up the MDN web docs by Mozilla you can learn more about the script element. Add ShapeResult - RenderWhen The problem is that SummaryAdmin shapes are added during BuildDisplayAsync so the conditions will be evaluated for every front-end BuildDisplayAsync display, even though they're only intended to be placed in a SummaryAdmin display. The goal here to add a Func to the ShapeResult that can be invoked after placing a shape in a location, to evaluate whether it should be placed. This would mean that for all of the SummaryAdmin shapes the RenderWhen will only run after they have been placed in SummaryAdmin. So the evaluation will not occur during a Detail or Summary view on the front end. The AuthorizeAsync isn't a super heavy call, but we often want to conditionally evaluate in a driver whether to return a ShapeResult so it makes sense to have something that can be applied later in the BuildDisplayAsync pipeline when we know that we are actually going to place the shape in a location. The ContentsDriver renders the ContentsButtonActions_SummaryAdmin shape, that is responsible to display the Publish, Preview, Unpublish, etc. buttons. You need to have some permissions to be able to see these buttons. See the refactored logic here using the RenderWhen method. Adding ID for FormPart Now there is a new content part called FormElementPart that turns a content item into a form element by providing an ID to the form. Now the built-in Form widget has this part attached meaning that when you add the Form widget to a FlowPart, you can define an ID. And here comes the modifications in the Form.Wrapper.cshtml wrapper. If the content item has the FormElementPart attached, then get the ID from that and use it as the ID for the form HTML element. Demos Blazing Orchard Blazing Orchard is a modular application framework that turns your Blazor project into a CMS-powered Blazor application by leveraging Orchard Core as a decoupled backend/CMS server using its REST & GraphQL APIs. Orchard Core is used here as a headless CMS, which means that Orchard Core is a separate application in the solution. The Blazor application is also a separate project. Therefore you need to host these two separately in a separate container for example. Clone the repository of the solution and check it out yourself! The structure is the following. The BlazingOrchard.Web.Application is shared by both the Blazor client host (BlazingOrchard.Web.Client) and both the server (BlazingOrchard.Web.Server). Let's see how you can render stuff with the help of Blazor in this solution. Check out how the menu rendering works! There is a NavMenu component (NavMenu.razor) in the Shared folder of the BlazingOrchard.Web.Application project, which comes with the default placement template. But here we are using a custom component (Menu.razor) that comes from the BlazingOrchard.Menu library. This thing is also using another component called ContentItemView, which gets the data from Orchard using an HttpClient. It's reusable, which means you can use this in other components too, like in the ContentPage component. Let's navigate to the server and manipulate the menu items of the Main Menu by adding a new Link Menu Item to it called Readme. Now you can see that the menu structure has been updated in the Blazor application. Or let's see the CounterButton component. This piece of code is about having a currentCount int variable to store how many times the user clicks on that button. The IncrementCount method is responsible to do the business logic for this. If you navigate to the Orchard Core server and create a new Liquid Page, you can use Liquid expressions to render this component. To do that, you can just simply add the following Liquid expression to the body of the content item: {{ "CounterButton" | shape_new | shape_render }}. Notice that here we are creating a new shape based on the CounterButton component and render it in the body of the Liquid Page. The CounterButton component has a public ButtonText parameter. And - because we are dealing with shapes here - you can set the value of that variable by providing it in Liquid when creating the shape like: {{ "CounterButton" | shape_new: ButtonText: "Click on this button!" | shape_render }}. This way we can use the CMS to configure these components. And you can do a lot-lot more using this PoC solution thanks to its creator, Sipke Schoorstra! Head to YouTube and check out the recording of this demo now to know more about what you can achieve by using this solution! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 167 subscribers! 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! 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!

VueForms module, Obsolete IContentAliasManager - This week in Orchard (22/10/2020)

We prepared with a huge demo about showing you how you can use the custom VueForms module for Orchard Core! But first, let's check out the latest news around Orchard Core. Read our current post to find out an obsolete interface! Orchard Core updates Fix sizing of HTML/MarkdownEditor settings to be consistent in the correct zones There were some inconsistencies with the sizing of some field elements settings and other views. Some hints were full-width, some were restricted to col-md-6, other col-sm-6. Hint boxes should also align together with the rest of the fields.And one more thing here: the general settings/common to all editors should be in the Content zone and editor modes should be in the Editor zone. The issues had been fixed, they all look like this now, without uneven padding, and shapes are consistently ordered. Obsolete IContentAliasManager The IContentAliasProvider was renamed to IContentHandleProvider. The idea behind that is the alias was a bad name because it was in conflict with the AliasPart and they are two different things. They are related somehow because a handle now can come from an alias, but a handle is a generic term to say you can get a content item from different ways, like using a content item ID or a slug or alias. Whatever kind of identifier you want to give to your content item and then when you load a content item by its handle, you provide a prefix. In the past, the IContentAliasManager was just marked as obsolete and make it backward compatible, but the backward compatibility code didn't work. So, don't forget, if you injected the IContentAliasManager in the past and you update your Orchard Core solution to the latest, you will need to use the IContentHandleManager instead. Ensures shell terminating and disposing When e.g. we enable a feature for a given shell through the admin, the shell is released in the context of a shell scope, and at the end of this scope (if it is the last one for this shell) the terminate events are called and then the shell is disposed. But when e.g. we reload a tenant through the admin or when a shell releases its dependents, a shell may be released without having any current scope on it, so it is disposed immediately but without calling the shell terminate events. So here, in that case, we create a new scope (without using it) and dispose it to let it manage the shell state as usual. Note: In that case, the terminate events are called synchronously, we would need a shell ReleaseAsync(), but at least there are called. Another suggestion would be to get rid of the terminate events that are not used in the current code. So, in summary Here we ensure that the shell terminating/terminated events are called, even if the shell is not terminated by the last shell scope, e.g when the shell is released by dependency or when changed through the tenant's admin UI. So, right now we kept the terminate events. Here we also call the shell terminating/terminated events before the BeforeDispose callbacks that we use to call the session commit asynchronously, which is better if a terminate event uses an ISession. Demos VueForms module The StatCan Orchard Core repository houses a collection of custom Orchard Core resources, modules, and themes that support various web applications and software-as-a-service (SaaS) products. Built on top of Orchard Core CMS, developers have a suite of web application features out of the box (e.g. content management, authentication, forms, themes, etc) by customizing the selection and configuration of components. The extensibility of the framework allows new features and components to be added easily. One of the custom modules called VueForms, which aims to simplify the creation of client-side forms in OrchardCore. Let's see that module in action! Clone this repository and set up your site. Now go to Configuration -> Features and enable the VueForms and the VueForms Localized modules. The first is about provide a Form content type that simplifies using VueJs forms in the frontend and the second one is about to weld the LocalizedText part to the VueForms. The difference between the built-in Forms module and this one is that it's using client-side validation using Vue.js, Vuelidate, and Vuetify. Now if you navigate to the Content menu option, you will find a new one called Vue Forms. Here you can manage your Vue Form content types. Let's create a new one called Contact us! You have the option to disable or enable your form. If you disable the form, you can set an HTML, that is displayed when someone tries to render a disabled form. This feature is about creating the form on the back-end and no one can access it on the front end. If the server-side validation passes you will get the message that you can provide in the Success Message text box. Or it's doesn't, you can display the text that you can type in the Error Message textbox. Next one is the client init script. This is actually a client-side JavaScript, where you can set client-side actions. Right now here we set the required fields and in this case, we use it to localize the VeeValidate field validations. The required messages are coming from our localize liquid filter. The OnValidation is a server-side script, this is using Jint. Here you can get the form data and then you can perform validation here. This is not complete yet, the end goal would be to have widgets and the validation would be placed inside the widgets. The widgets would generate the client-side and server-side validation together. The addError() method allows you to add an error and map that input into the client-side. Here comes the OnSubmitted section. This is where you would perform actions after validation. Let's say the validation passes, there are no errors added, that means this script is called. In this case, we are creating a new predefined ContactRequest content item. And in the Localized Text section, you can create localizations with a key-culture pair. Here you can add as many as you want by clicking on the Add button, you can delete them by clicking on the trash bin icon, and reorder them with the little hamburger icon. The getLocalizedTextValues() function in the OnValidation section is used to get the localized text for the current culture that you defined here. This content type has a Form Part too that you can use to add a new Vue Component widget. Using that you can set the VueJS Component template. It's basically code, you are writing your Vue.js component here. You provide the template and you also have the script that is a typical Vue.js component script. The template is using the ValidationProvider component that wraps your inputs and provides a validation state using scoped slots. Now let's publish this new content item and view it in the front-end! Here you can see we have already filled out this form with some data but the email address is wrong. If we click on send, we will get the Your email is invalid error message, which is a client-side validation error. But that's not all! Enable the Workflows module and create a new workflow type called VueForm submitted. Click on the Add Event button and you will find a new category in the modal window called VueForm. And there is a new VueForm Submitted event that is fired when a VueForm passed validation and is submitted. Here you can also select the forms for which this workflow runs. We have only the Contact Us right now, so select this one. And using that event you can say send an email to the site admins if the form submission was successful. The whole repository and this module have great documentation where you can read more about these scripts and how to customize your VueForm content items. And don't forget to check out the recording of this demo on YouTube! News from the community Using the OrchardCore OpenID management feature with an existing OpenIddict deployment Kévin Chalet is one of the main contributors of Orchard Core. He developed the OpenID management feature for Orchard Core. In his blog post, he writes about how you can use the GUI of Orchard Core with an existing OpenIddict server, that is typically located in another project. Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 163 subscribers! 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! 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!