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

Featured tags

IIS
API
All tags >

Support comments in recipes, multitenant decoupled Blazor InteractiveServer example - This week in Orchard (05/04/2024)

Support comments in recipes, support Create and CreateAsync in DataMigrationManager, and a demo about a Multitenant Decoupled Blazor InteractiveServer Example! Let's see the details! Orchard Core updates Support comments in recipes The recipe reader doesn't support comments in JSON (it's a mode that isn't turned on). This can be annoying when you have a lot of recipes and need to make notes in them as to why you did something. It's because System.Text.Json by default doesn't support comments. We parse using JOptions.Document that is not configured to allow comments. From now on, the settings of the JOptions have been changed to allow comments in recipes. Support Create and CreateAsync in DataMigrationManager You could run into a problem with data migrations: your migrations may not proceed after a module's initialization. The reason for that could be a change of synchronous code to asynchronous. It can happen because you may forget to add the Async suffix in the CreateAsync method. That could be OK, but there is inconsistency in the behavior of UpdateFromX(Async) and Create(Async). Updates work correctly no matter what suffix but Create does not. Now, this behavior has been unified; both Create and CreateAsync methods are now supported. Demos Multitenant Decoupled Blazor InteractiveServer Example In this demo, you can see how to use Orchard Core in a decoupled scenario. There's also a discussion under a GitHub PR to add a Blazor guide for decoupled CMS. Sijmen Koffeman decided to follow this guide and make this a multi-tenant application because that would be very interesting to do in his current situation where he maintains a line of business applications that they provide to several tenants. He took the example from the guide and made it further, and that works so far. In his demo, you can do a deep dive into the code that sits inside the Orchard Core Multitenant Decoupled Blazor InteractiveServer Example repository to see the current state of this work. Head to YouTube for a recording to know more! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 472 subscribers! We have started this newsletter to inform the community around Orchard of the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post is published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news about Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting!

Add a way to Remove User from a Role, Lombiq Hosting - Tenants Email Quota Management - This week in Orchard (15/12/2023)

New Get users by roles and Unassign users from roles activities, add async methods to ContentDefinitionManager to prevent possible thread starvation, and a demo about Lombiq's Tenants Email Quota Management module! Let's get started! Orchard Core updates Add a way to Remove a User from a Role This change introduces two new activities that you can utilize when working with workflows. The first one is called Get users by roles. Here you can easily choose the roles to identify users by using the Roles check boxes. You can see that you can provide a key (Output Key Name) that will be used to store the user's ID in a list that you can use in an upcoming activity in your workflow. The second activity is the Unassign user from roles one. The Roles check box works the same and the UserName text box can be used to provide the user name of the user who you want to update. Here in this silly example, we hard-coded the admin user name but of course, you can use Liquid to have a flexible activity. Add Async method to ContentDefinitionManager to prevent possible thread starvation The idea here is to make all the IContentDefinitionManager methods async to prevent possible thread starvation. To avoid a breaking change, the old ones were marked as obsolete. Here is a list of interfaces that were modified: IStereotypeService IStereotypesProvider IRouteableContentTypeProvider IRouteableContentTypeCoordinator IContentDefinitionService IContentDefinitionManager IContentDefinitionService On this screen, you can see the updated IContentDefinitionManager interface, where the non-async methods were marked as obsolete with a warning message that these methods will be removed in the upcoming releases. So, when you update your solution to the latest Orchard Core version, don't be surprised when you see some warnings after you build your solution. Demos Lombiq Hosting - Tenants Email Quota Management This demo will be about a new Orchard Core module, part of our Hosting Tenants repository, that helps you manage email quotas. Hence the name Email quota management, which could be useful if you have a SaaS provider (like our SaaS provider, DotNest) and you would like to restrict the number of emails sent out per month per tenant only if the tenant is using your SMTP provider. Of course, you don't want to restrict those tenants who are using their own SMTP provider. To set the quota you can use the appsettings.json file or an environment variable. The default value here is 1000 emails per month. Now it's time to try out this project and see it in action! The easiest way is to clone Lombiq's Open-Source Orchard Core Extensions solution. This Orchard Core Visual Studio solution contains most of Lombiq's open-source Orchard modules and themes, as well as related utilities and libraries, containing the Email quota management module too. First of all, you need to enable the Lombiq Hosting - Tenants Email Quota Management module under Configuration -> Features. After that, let's navigate to Configuration -> Settings -> Email. And wow, you can see that we have already sent 997 emails out of 1000 this month. Yeah, we cheated a little bit and we already sent out some emails using workflows. In this case, the users who have site owner permission will receive an email when the tenant reaches 80% of the available email quota for this month. They will get another email if you exceed 90% of the email quota. When you reach your quota for this month, you will get a red notification that can be seen on every page in the admin UI. It means that you will not be able to send out more emails until next month. As always, if you would like to know more about this module, head to YouTube for a recording! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 487 subscribers! We have started this newsletter to inform the community around Orchard of the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post is published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news about Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting!

Extending ISetupEventHandler with new events, your DotNest site (almost) never goes down - This week in Orchard (22/09/2023)

Extending ISetupEventHandler with new events, do not specify placement position in the content field/part display drivers, and a blog post about the reliability of your DotNest sites! Let's see the details in our post! Orchard Core updates Extending ISetupEventHandler with new events We have an ISetupEventHandler interface in Orchard with a method called Setup. When there is a setup on a new tenant, we call this method. Now this method is marked as an obsolete one and will be removed in future releases. If you rebuild your Orchard Core solution in the future, it will tell you to use the new SetupAsync instead. If you have an implementation of this interface, it will still work because the newly added FailedAsync and SucceededAsync methods have default implementations. It means you don't need an abstract base class. Do not specify placement position in the content field/part display drivers Content elements or fields can be attached to a content type. Their UI placement should follow the subsequent guidelines. So, if the first step defines a position, we use that position and look no further. DisplayDriver. A placement is defined on the UI using the OrchardCore.Placements. The placements.json file. Default Position in the content type. Otherwise, it should fall back to the physical placement of the object in the content definition. For this logic to work as expected, the ContentPartDisplayDriver or the ContentFieldDisplayDriver should define a placement location by default, but not a placement position. This way, we can allow to change the order using Steps 2-5 as needed. In the following drivers, we seem to be defining a placement position that prevents the user from being able to change that position at all. FacebookPluginPartDisplayDriver BagPartDisplayDriver FlowPartDisplayDriver HtmlBodyPartDisplayDriver LiquidPartDisplayDriver MarkdownBodyPartDisplayDriver TaxonomyPartDisplayDriver TitlePartDisplayDriver For example, today if you use HtmlBodyPart, there is no easy way to change its placement because the HtmlBodyPartDisplayDriver defines a position 5. Meaning if you have a placement in the driver, there is no easy way to override it from the UI. If we leave these positions, blank it will fall back to the user settings. News from the community Your DotNest site (almost) never goes down Orchard Core and Orchard 1.x sites you host on DotNest almost never go down, with 99.99% availability in the last 3 months. Check out the details in our latest blog post here. If you haven't done it already and want to host your sites on the hugely reliable DotNest, create your site here! We also guarantee reliability in our Terms of Service. Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 505 subscribers! We have started this newsletter to inform the community around Orchard of the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post is published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news about Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting!

Full-Text Search for Admin UI, Orchard Harvest recordings - This week in Orchard (04/08/2023)

Adding an option to allow the user to change the full-text search behavior in the admin UI, new Helpful Shell Extensions, and announcing that the recordings of the Orchard Harvest Conference 2023 are available on YouTube! Check out our post for the details! Orchard Core updates Full-Text Search for Admin UI Currently, when searching for content we search the DisplayText property. It can happen that we want to search content items for other fields like a stock number or serial number. Currently, the only way to do this is by adding any info we want to search for to the title. This may be acceptable in some cases, but not all cases. From now on, additional options have been introduced to enable control over the behavior of the full-text search in the administration user interface for content items. Check out this documentation for details about how you can do that by implementing the IContentsAdminListFilterProvider interface and registering the custom default term name as a search option by adding it to the ContentsAdminListFilterOptions. Helpful Shell Extensions The goal of this change is to introduce various extensions related to tenant management that the contributors can utilize in the future to improve the code quality of Orchard Core instead of doing the same checks repeatedly. And of course, you can use these extensions in the future in your own custom code as well! We have three new classes (ShellContextExtensions, ShellSettingsExtensions, and ShellStringExtensions) with extension methods that tell you whether the tenant is running or not, whether or not the tenant has one of the provided URL hosts, whether or not the tenant is in use in at least one active scope, and so on. News from the community Orchard Harvest Online Recordings We had the first online Orchard Harvest, and it was great to see that we had 188 sign-ups for the conference! It was an excellent opportunity to share knowledge, talk about development plans and ideas, and foremost, meet the rest of the worldwide community. And of course, we recorded every session, which means they are now available on YouTube! Click the link to rewatch all the inspiring talks and discussions! That was a blast! Thank you again, everyone, for taking part, and thanks to the presenters for their great presentations! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 497 subscribers! We have started this newsletter to inform the community around Orchard of the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post is published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news about Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting!

Add a script to clean up the lib/bin and/or node_modules folders, Tenants Environment Robots for Orchard Core - This week in Orchard (16/06/2023)

Fix that GroupId check should be case insensitive, add a script to clean up the lib/bin and/or node_modules folders, and a demo about the Tenants Environment Robots feature! Check out our post for the details! Orchard Core updates Fixing that GroupId check should be case insensitive If you go to a settings page in the Orchard Core admin panel that has a corresponding DisplayDriver, the URL of the page is not case-sensitive, but the if (context.GroupId == GroupId) check in the override of DisplayDriver.UpdateAsync is case-sensitive. This means that you can enter two different URLs for a settings page, both of which will work, but only one of which will actually cause any updates to be applied when the form is submitted. When you searched for that line of code across the Orchard Core 1.5 solution, you find it in 16 drivers, so you would expect this issue affects all of them. The fix here is the GroupId comparison in DisplayDriver.UpdateAsync should be case-insensitive. If the page loads correctly for a given URL, submitting the page should work as expected rather than mysteriously failing to update the settings. Here you can see the changes in updating the checks on the drivers. Add a script to clean up the lib/bin and/or node_modules folders Sometimes it is useful to be able to use the command line to remove all lib and bin folders from every project using the command line. It's even more useful to be able to remove all node_modules from every project using the command line. From now on, if you want to remove the bin and lib folder from all the projects, you can run npm run cleanup. If you want to remove all node_modules folders from all the projects, you can run npm run cleanup node_modules. If you want to clean up bin, lib, and node_modules, you can run npm run cleanup all. Demos Lombiq Hosting - Tenants Environment Robots for Orchard Core The feature that we will check out today is called Lombiq Hosting - Tenants Environment Robots, which is a module that prevents search bots from indexing non-production environments. Let's say you are hosting sites on a staging environment, and we usually want to prevent search bots from indexing the staging environment. And if we enable this feature, this will exactly do that. Let's quickly see it in action! This module is included in Lombiq's Open-Source Orchard Core Extensions solution so we will build this solution. Now we can navigate to Configuration -> Features and find the feature called Lombiq Hosting - Tenants - Environment Robots to enable it. Now let's see how it works! The module works by adding an X-Robots-Tag header with the value noindex, nofollow to the HTTP response of non-production apps. This instructs search engines not to index or follow the links on these pages. Additionally, the module also adds a <meta name="robots" content="noindex, nofollow"> tag to the HTML head of non-production apps for the same purpose. To try this out, let's navigate and open up the homepage of our site, for example, and open up the DevTools window of Google Chrome (or use any other browser, of course). You will notice two things here. First of all, you will find the new meta tag if you click on the Elements tab, which contains the noindex, nofollow values. Now, let's navigate to the Network tab of the DevTools window and find the Response Headers section of the currently loaded page. Here you will notice that we have a header with the following value: X-Robots-Tag: noindex, nofollow. And you can also override this option by setting it to true or false in the appsettings.json file under the Lombiq_Hosting_Tenants_EnvironmentRobots:EnvironmentRobotsOptions:IsProduction section, as the readme file of the module mentions. And as always, if you would like to know more about this feature head to YouTube for a recording! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 465 subscribers! We have started this newsletter to inform the community around Orchard of the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post is published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news about Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting!

Redis connection across tenants, Data Migrations UI feature - This week in Orchard (05/05/2023)

Redis connection across Tenants, simplify email body, and a demo about the Data Migrations UI Feature! Check out our post for the details! Orchard Core updates Redis Connection across Tenants The number of Redis connections scales with the number of tenants. This leads to a large number of Redis connections being required when you have a large number of loaded tenants, even if individual tenants may not have a lot of actual activity. The problem is that when you use something like Azure Redis, you will quickly run into cost issues to allow for enough connections to exist even though Redis is barely being used (CPU/memory usage is very low). If we were able to share the Redis connection pool across all tenants, then scaling would be correlated with the actual usage of the system as opposed to tenant count. From now on, the connection creation was refactored, such that each tenant doesn't have its own connection but you can share the connection to the same Redis instances across tenants. The connection string is the same, and you can use different prefixes for the tenants. The CreateAsync method in the RedisDatabaseFactory class is responsible for returning only one connection, even if there are multiple accesses to the same connection string. Simplify email body Nowadays, when you are trying to create an email message, you should set either Body or BodyText, not only that you also need to set up another property: IsBodyHtml or IsBodyText. This needs simplification to make the setup easier. Furthermore, if someone set IsBodyText to true while they set the Body property, the email will be sent as plain text. So, instead of having two properties to set whether the email body contains HTML formatted text or not, there is a single one, called IsHtmlBody. So, there are no more BodyText and Body properties to set the body of your email. You can simply use the Body one and decide whether the body contains HTML or not based on the IsHtmlBody Boolean property. The IsBodyText and IsBodyHtml properties are also marked as obsolete. Demos Data Migrations UI Feature A few weeks ago, we showed you a conceptabout improving the data migrations in Orchard Core. This time we will check out a new feature, called Data Migrations UI, which allows us to manage the data migrations from the user interface. If you navigate to Configuration -> Features and enable the Data Migrations UI feature, you will find a new option in the root of the admin menu, called Data Migrations. This feature scans and discovers all the migrations from the enabled features and shows them in this list. Here, you can see that we have one migration in the Google Maps feature, which is already migrated. If you click on the Rollback button, you can roll back the given migration. The Migrate button of course runs the given migration. As you can see, the Gravatar feature contains multiple migrations. Migration1 is already applied, Migration2 should be skipped, and there are two migrations that are not applied. If you click on the Migrate button, you can apply the given migration. And as always, if you want to know more about this feature, check out this recording on YouTube! News from the community Orchard Harvest Online As many of you know, we have been working hard over the past months to organize the next Orchard Harvest in Las Vegas after the last Harvest in 2017. Unfortunately, based on the current economic situation and personal feedback, Las Vegas won’t work this year. Not to mention that unfortunately Microsoft Build, announced after we decided on our dates, also falls in line with the original dates we chose. So, a date change was also necessary. However, we did not want to let go of this opportunity to meet completely. Therefore, we are pleased to inform you that we will be holding our first online Orchard Harvest starting on the 31st of May at 13:00 UTC. You can start your registration for the event right now. Of course, we are still looking for speakers. You can apply to present by 12 May at the following link: https://forms.office.com/e/pfiExtEUuZ. Check out the details on the official site of Orchard Core! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 457 subscribers! We have started this newsletter to inform the community around Orchard of the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post is published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news about Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting!

Tenant APIs improvements, MiniProfiler visibility based on permissions - This week in Orchard (10/03/2023)

The MiniProfiler visibility is now based on permissions, tenant APIs improvements, and using ListContent permission instead of ViewContent to see the content items list. Interested in the details? Well, then check out our post for the details! Orchard Core updates MiniProfiler visibility based on permissions MiniProfiler is a library and UI for profiling your application. By letting you see where your time is spent, which queries are run, and any other custom timings you want to add, MiniProfiler helps you debug issues and optimize performance. And MiniProfiler is a built-in feature in Orchard Core that has some updates. Let's say an admin needs to profile a production instance. Enabling MiniProfiler for everyone to see is not acceptable in most cases. Also, a user may want to profile an ajax request to analyze a query or other info. The solution here is to provide new permissions when you enable the Mini Profiler feature. If you navigate to Security -> Roles and hit Edit near any role, you can see the new permissions which enable you to view the Mini Profiler widget on the back end and the front-end pages. Tenant APIs improvements Orchard Core tenant APIs got several updates lately. First of all, there was no way to update some tenant settings from API calls. Meaning, the tenant's category was missing in the ApiController. We should be able to set a tenant's description via an API call, so this property is now included in the sent model. Another improvement is the new Edit endpoint because there was no way to update tenant settings from API calls. The new Edit endpoint in the Tenant's ApiController takes care of this and enables us to modify the tenant settings either if the tenant is uninitialized or running. The updateable properties are the same as what is displayed on the tenant editor on the Admin UI. Use ListContent permission instead of ViewContent Currently, we use View Content as a minimal permission to list the contents in the content items UI. We use the same permission to also show the Content -> Content Items admin menu. Here the List Content permission should be used, not View Content. What if someone wants to allow a user to view content using a direct link but does not want them to list the contents in the UI? Currently, this isn't possible. Additionally, ViewContent is granted to all Anonymous and Authenticated roles, which is fine. But, access to list contents should be granted by the ListContent permission to avoid allowing listing content without explicit permission grant. If you check out the change logs in the docs of the upcoming release, you can read about the updated permissions. News from the community Hastlayer is now fully open-source Hastlayer is being developed by Lombiq Technologies, a software, training, and services company focusing on web development with open Microsoft technologies. Hastlayer transforms .NET software into FPGA-implemented logic circuits. (FPGAs are chips that can mimic other chips.) The result is code that runs faster and uses less power than a code-only solution without sacrificing the ability of further developing your software. Using Hastlayer will optimize your performance and lower the power consumption of hardware, which will bring you more satisfied customers who want your solution and a boost in your company’s revenue. And we have just recently fully open-sourced Hastlayer! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 410 subscribers! We have started this newsletter to inform the community around Orchard of the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post is 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 about Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting!

Improved Feature Profiles feature, self-service tenant registration - This week in Orchard (03/03/2023)

Add placement example for dynamic parts, responsive Admin Theme, improve the Feature Profiles feature, and a demo about self-service tenant registration! Check out our post for the details! Orchard Core updates Added placement example for dynamic parts We have an article on the Orchard Core Documentation site that is about display management and placement files. Any module or theme can contain an optional placement.json file providing custom placement logic. This article describes the format of the placement.json file, how to render a shape, editor shape placement, and so on. Now you can see a new section here as well, telling you the structure of the placement file when you are working with dynamic parts. Responsive Admin Theme Last November, we mentioned that a huge improvement is coming to Orchard Core that makes the Admin Theme responsive. Note, that it's an option that is disabled by default, and you have to do some modifications in the appsettings.json file to make this work (under the StyleSettings section), and after that, your custom editors rendered in the admin have to support this, by utilizing the necessary helpers, like Orchard.GetEndCssClasses(). You can read more about how to set up the TheAdmin theme in the Change Logs of the upcoming release. Improve the Feature Profiles feature If a Feature Profile is renamed, it'll break existing tenants since the name is stored in the appsettings.json file, and also, other modules are not able to contribute to the Feature Profiles setup. We have had Feature Profiles for a long time now in Orchard Core, and if you haven't heard about it, you can check out a demo in this post. In a nutshell, this is about using app settings/configuration to add the ability to restrict the features and/or themes that are available to either a tenant and/or all tenants or a mix of both. You can add Feature Profiles under Configuration -> Tenant Feature Profiles once the Tenant Feature Profiles module is enabled. Here you can set the rules that you want to use. By default, you can have an Include and an Exclude rule. By using these, you can easily say that I don't want to allow the given feature for the assigned tenants or I want to allow my custom feature to the given tenants. The Expression contains the name of the feature, but it can include stars like OrchardCore.*Templates that will match the OrchardCore.Templates, OrchardCore.AdminTemplates and OrchardCore.ShortCodes.Templates feature as well. Let's say that we don't want to allow the TheAgencyTheme and the features with names that start with OrchardCore. and end with .Templates. And if you create a tenant, you can optionally specify which Feature Profile should be applied to the given tenant. You can rename the Feature Profile if you want, and renaming it could cause some issues. So, from now on when using Feature Profiles, we add an ID to the profile instead of using the existing editable name. This way renaming the profile won't break anything. To keep it backward compatible, we treat the current name as the ID for old entries. Note renaming old entries won't cause any issues since we consider the ID as the name before the new name is saved. If you check out the appsettings.json file of this tenant, you will see the ID here. And also, we allow the user to have multiple profiles more than explained in In a SaaS setup, how can the SaaS admin/owner manage the tenant features? Demos Self-service tenant registration In this demo, we can see a module created by Niraj Soni. He provides you with a new way to implement a site sign-up, so you actually create steps for someone to sign up, pay and get access to the tenant in a SaaS environment and everything happens right away. If you install the module, you will see a Registration Pages option in the menu under Multi Tenancy, where you can actually create the flow of the sign-up process. Here is a page called School, where you can capture school-related information using widgets during the sign-up process, like address, city, state, zip, etc. On another page, you can capture information to create an admin account, like user name, password, and email. There is also a step to verify email and capture payment. This contains integration with Stripe, so this will be utilizing Stripe. And finally, you can review and finish the whole process. Using this feature, you can add any page you want; you can remove a page if you want. And that's just the surface! If you would like to see this in action, check out this recording on YouTube! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 406 subscribers! We have started this newsletter to inform the community around Orchard of the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post is published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news about Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting!

Orchard Core Commerce MVP, make Features module optional to non-default tenant - This week in Orchard (03/02/2023)

Make the Features module optional to the non-default tenant, add AddIndexProvider and AddScopedIndexProvider extensions, and a demo of the freshly released 1.0 version of the Orchard Core Commerce module! Check out our post for the details! Orchard Core updates Make the Features module optional to non-default tenant Currently, the module OrchardCore.Features are always enabled. We recently added a feature for the default tenant to be able to manage features on the behalf of any tenant. We can remove the AlwaysEnabled flag from OrchardCore.Features as the Saas owner may not want to allow the tenant to control their own features. It means this change allows to be able to not enable the Features module, such that only the default tenant can add/remove features even if there is an allowlist of features.This also introduces a breaking change which you can read about in the Orchard Core documentation containing the breaking changes of the upcoming release. Add AddIndexProvider and AddScopedIndexProvider extensions This change is about adding two new extensions that you can use in your Startup file to register your index providers in a simpler way. As a reminder, the IScopedIndexProvider is an index provider that will be resolved through DI in a scoped lifetime because it probably requires scoped services. Demos Orchard Core Commerce MVP Orchard Core Commerce will be an Orchard Core port and partial rewrite of the open-source Nwazet Commerce module that was built for Orchard CMS 1.x. Nwazet Commerce was initially built in 2012 by Bertrand Le Roy, loosely based on a commerce sample by Sipke Shoorstra. The initial goal of Nwazet Commerce was to power the website of the hardware startup Nwazet. While Nwazet is no longer operating, the Nwazet Commerce project went on and was further developed by a group of passionate contributors who are using the platform for their own, and their customer's websites. Like Orchard, Nwazet Commerce was built with extensibility in mind, and as such, it has its own extensions (typical examples include local tax and shipping modules). It's also a pure, idiomatic Orchard. Orchard Core represents a major evolution of the Orchard design principles and is sufficiently different that running Nwazet Commerce on it will necessitate significant work. As such, the community decided that starting from a blank slate was the best way to go, so they will port Nwazet Commerce piece by piece, being careful to accurately apply Orchard Core's new design principles. The community also decided to adopt a new name that gets rid of the now obsolete origins and establishes our ambition for the module to become the go-to commerce module for Orchard Core. Last May, we published a demo where you could see the current state of the module. A few months later we reached another milestone when we finished with the basic implementation of Stripe Payment integration (without taxation, shipping, etc.). Stripe is a payment service provider that business owners can use to accept dozens of payment methods, from credit cards to buy now, pay later services. Stripe Payments handles the steps between a customer providing their card information and learning that their payment has been accepted. And as you may know, Lombiq provides stewardship for the Orchard Core Commerce module. That actually means that we do code reviews and work on features and fixes. To have that, we added an Orchard Core Commerce MVP planning survey. This was about asking the community what the most essential features for you would be in an Orchard Core-based e-commerce solution. We had the results, we had a better understanding of what were the topics that made into the MVP as our short-term goals. And now we can proudly present the 1.0 release of the Orchard Core Commerce module! Let's see some of the key features of this brand-new release! You can try it out by cloning this repo or including the NuGet package in your own Orchard Core project. After you cloned the repo and set up the site with the Blog recipe, for example, you can enable all of the Orchard Core Commerce-related features to be able to try out everything that the module could provide to you. But you can run the OrchardCore Commerce - Development recipe on the setup screen, which will do the same. You can find several recipes under Configuration -> Recipes if you filter on the "commerce" word. By using these recipes, you can decide which features of the Commerce module you would like to utilize in your solution. By using these recipes, you can have a predefined Product content type, some sample content items, and everything that you might need when dealing with a commerce site. But as we mentioned, if you would like to see the whole of the Commerce module without doing any additional setup, the best is to run the OrchardCore Commerce - Development recipe on the setup screen. If you do that, you will get a Product content type with one TestProduct content item. In terms of taxation, you can set the gross price of the given product (the price with tax) and the tax rate. You also have simple inventory management, which means you can set the number of items in stock, and you can set the maximum and minimum number of this item one can order. You can also set up discounts if you want. For example, you can say that the discount percentage that is applied to this product will be 50 and you can also set up a beginning and expiration date and time of the discount. In case you want to limit the number of products that the discount can be applied to, you can also do that. Now let's check out what the user sees if they navigate to the display view of this product. As you can see, the price of this product is $10, and the gross price is $12.70 because of the 27% tax rate. We have 5 items in the inventory, and currently, we have a 50% discount. Meaning that the new price with a discount after taxes is $6.35. The MVP also comes with several settings that you can utilize under Configuration -> Commerce. You can set up the Stripe API under the Stripe API option, but you can see two new options here as well. But if you execute the recipe called Orchard Core Commerce - Samples - Custom Tax Rates, you will find another one here called Custom Tax Rates. Here you can add complicated tax handling based on the postal code, state or province, or country. The following screen means that if the country of the user is the United States, and the state or province is New York, the tax rate would be 4%. If the user has a Hungarian address (HU), the tax rate would be 25%. And you have just seen the basics of this release! If you want to know more about the Commerce module, check out the documentation page that contains the key features, and as usual, head to YouTube for a recording! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 390 subscribers! We have started this newsletter to inform the community around Orchard of the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post is published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news about Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting!

Build Version Display module, prevent Users feature from breaking when Roles feature is disabled - This week in Orchard (27/01/2023)

Add permission check for the content type filter, prevent the Users feature from breaking when the Roles feature is disabled, add new database options, and a demo about the new Build Version Display module! Check out our post for the details! Orchard Core updates Add permission check for content type filter The content type filter should only show accessible content types. The user should only see content types that they can view. Before this fix, all of the content types were listed, even if you don't have permission to see it. Let's say that I am an editor user who has no access to view the Blog content type. In this case, when this user navigates to Content -> Content Items and clicks on the content type filter, the predefined Blog content item will not appear in the list. Prevent the Users feature from breaking when the Roles feature is disabled This was an old issue in Orchard Core if you disable the Roles module, the site crashes because the Users module needs the following services to work: IRoleService RoleManager IRoleStore This issue is now fixed, and you can disable the Roles module from the UI without facing an error. You can find the implementation details in this pull request, thanks to Mike Alhayek! Add database options like TablePrefixSeparator, Schema, IdentityColumnType, and DocumentTable Here is a summary of the changes: both TableNameConvention and TablePrefixSeparator were removed from YesSqlOptions. The following properties were added to the ShellSettings of each tenant: TablePrefixSeparator when this value does not exist, we assume _, however, if an empty string is found, we use no prefix for the tables. Schema was added to allow you to provide a specific schema to use. IdentityColumnSize when this value is empty or invalid, we assume Int64. DocumentTable when this value is empty, we assume Document. If adding a new tenant failed due to missing Encrypt=false or TrustServerCertificate=True, we add the error to the log file to provide the admin with more about the issue. The following means that now you can find a new section in the configuration called OrchardCore_Data_TableOptions. Now you can define the name of the Document table if you want to change it, change the table name separator (changing the _ in tenant1_tablename), and the default identity column size, which is Int64 by default. Every existing tenant will work with Int32, but the new tenants will use Int64. It can happen because YesSql now supports Int64 as well. You can find some new lines about these settings in the documentation as well. If you want to migrate the existing tenants, you have to do your own migration. You can also define the schema of the tenant (DatabaseSchema) which is also configurable from the UI. This way all the table names are the same, just the schema that could be changed for each tenant. Demos Lombiq Hosting - Build Version Display The goal of the Lombiq Hosting - Build Version Display for Orchard Core module is to display the build version (i.e., .NET assembly version or other) on the admin of the Default tenant. By using this module, you can see at a glance which version of the app is deployed. But of course, there are various ways to know what's currently deployed into a specific environment (like staging or production), but the goal of this module is to cover the following use case: when you are looking at the app, you will know what's there. The only thing you have to do is to install the module, and navigate to Configuration -> Features, and enable the Lombiq Hosting - Build Version Display feature. After you navigate to the homepage of the admin UI, you will see the following on the dashboard. You can find the Orchard Core version, the version of the .NET assembly is currently being executed, which means the web application. If you have a CI build, usually that will generate a version number for you. And finally, during the build, you can also add a link to the build. This is just a dummy link for examples, but you can link to a GitHub action. You can read more about it in the Readme file of the module. Do you want to quickly try out this project and see it in action? Check it out in our Open-Source Orchard Core Extensions full Orchard Core solution, and also see our other useful Orchard Core-related open-source projects! And as always, if you want to know more about this feature, head to YouTube for a recording! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 396 subscribers! We have started this newsletter to inform the community around Orchard of the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post is published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news about Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting!