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

Show a badge if a user is locked out, Lombiq Orchard Visual Studio Extension v.1.8.1 - This week in Orchard (27/06/2025)

This week's topics include displaying a badge when a user is locked out, renaming the ResetIndexProfile and RebuildIndexProfile recipe steps, and enhancing documentation for the indexing module. And have we mentioned that we've released a new version of our Orchard Visual Studio Extension, which now includes support for Razor Pages to the Dependency Injector?

Latest tutorials

Featured tags

IIS
API
SMS
SEO
MCP
All tags >

Gulp pipeline Guide, Security module - This week in Orchard (10/06/2022)

New Gulp pipeline Guide, fix content item display coordinator when a GroupId is provided, demo about the new Security module, and many more! Check out this post for the details! Orchard Core updates Gulp pipeline Guide There is a new Guide in the documentation that explains how the Gulp pipeline works and how to use it (what files to read, what files to output and bundle). If you would like to know more about the Gulp pipeline used in Orchard Core, check out this nicely-detailed page here! Use display names in registration settings If you enable the Users Registration module, you can have some registration-related settings under Security -> Settings -> User Registration. This page contains a Configure users registration drop-down where the values that the users can see was simply the names of enum that holds the user registration types. Now with this minor fix users can see nice-looking display names in this drop-down with spaces and everything. Fix content item display coordinator when a GroupId is provided When using the IContentItemDisplayManager build-editor for a specific GroupId, the drivers for each of the corresponding part never gets called. Steps to reproduce the behavior: Create a content part that generates special results when the content.GroupId is set to test. Create a content type and attach the content part you previously created. Now create a new controller to render the content items under a specific GroupId in the controller caller the driver like so _displayManager.BuildEditorAsync(contentItem, _accessor.Updater, true, "true", "some-prefix"). The expected behavior would be that the driver for each attached part would get called. It's then the driver's responsibility to return something, nothing, or something different when the groupId is set. The fix is that now we call shapeResult.OnGroup(context.GroupId); to ensure the shape is rendered with a provided groupId. Demos Security module The Security module right now is really focusing on security-related HTTP headers. Of course, you don't need a module for that or, you can write your own. You can just add headers directly, but the point here was to provide some defaults and secondly provide a way to easily configure them from the admin. This is especially interesting of course if you have a multi-tenant application and you don't want to hand-configure everything for everybody from code. First of all, you need to navigate to the admin UI of Orchard Core and enable the Security module under Configuration -> Features. After that, you will find a new option under Security -> Settings, called Security Headers. Here you see a UI to edit the Security Headers. The admin UI is not the only way to edit them, so just as with all these technical modules, it's also possible to configure it from the appsettings. There is also an example in the documentation of how to do that. The main sections are that we have content security policy-related headers (pretty much all of those, that are supported by browsers) and permissions policy headers, everything related to various peripherals, devices, etc. And finally, we also have one configuration for referrer policy. Let's try it out quickly! Let's say we set the referrer policy to Origin. If we open up the DevTools window of Google Chrome and navigate to the Network tab, you will see that the referrer-policy value of the response is now set to origin. If you like to use it check out the latest release of Orchard Core, and if you would like to know more about this new module, head to YouTube for a recording! News from the community Orchard Core Commerce MVP planning and survey A few weeks ago, you could see a nice demo about the Orchard Core Commerce module. And in that blog post, we also mentioned that Lombiq provides stewardship for this module. That actually means that we will do code reviews and work on features and fixes. To have that, Márk Bartha (who is the project leader from our side) started this thread and added this survey. This is about asking the community what the most important features for you would be in an Orchard Core-based e-commerce solution. If you do e-commerce or if you have an opinion about e-commerce, please share your opinion here. The point of this is to try to do not all the things but focus on what is really needed first. Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 277 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 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 around Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting!

Orchard Core 1.4.0, Lombiq Base Theme for Orchard Core overview - This week in Orchard (03/06/2022)

We are thrilled to announce that Orchard Core 1.4.0 is now available! Check out this post to know everything about the latest release of Orchard Core! Now let's see the newest features and additions of the current release that we will continue next week too! Let's get started! Orchard Core updates Remove form tag from allowed tags during sanitization Now we explicitly remove the form tag when we do sanitization. The default HtmlSanitizerService doesn't do that, but for security reasons, the community decided to do it. The documentation has been updated as well, so if you want to be able to render the form tags, then you need to configure it. Set security stamp when the user is disabled Disabling a user should invalidate the user's security stamp. When the security stamp validator revalidates the cookie, the user will then be expired. Here you can see the new UserDisabledEventHandler, which calls the UpdateSecurityStampAsync method, to update the security stamp for the user who needs to be disabled. Ignore IUpdateModel and BuildPartDisplayContext in console_log The console_log on FlowPart shape returned logs of C# Runtime objects. To reproduce the bug, you had to follow these steps: Use {{ Model.Content | console_log }} or @Orchard.ConsoleLog((object)Model). Log model containing FlowPart. See the browser's log and find C# Runtime properties logged. The expected behavior would be to just log the shape-related properties and ignore IUpdateModel and BuildPartDisplayContext properties in console_log for shape JSON. Now you can see that the view models for editing and displaying the BagParts and FlowParts gets the IgnoreDataMember, and BindNever attributes to do not log these properties. Demos Lombiq Base Theme for Orchard Core A few weeks ago, we mentioned that our Base Theme for Orchard Core is officially released. After that, we showed how you can use the Resource Management feature to include assets based on different conditions easily and how to construct your home page menu structure using the main navigation name in the Base Theme. Our goal with this Base Theme for Orchard Core is to have all the common things that you usually do when making a theme, like setting up the layout and the zones, setting up variables and mixins, and so on. We hope this makes the whole theme development easier and faster for you. This time we just want to give you a short overview of the other useful features that you can get if you build your own custom Orchard Core theme by using our Base Theme for Orchard Core. The theme has some built-in zones (you have to run the Lombiq Orchard Core Base Theme - Layers and Zones recipe that creates these zones), which could be familiar to you if you used Orchard 1.x in the past because it has the same names as you faced with the default theme of the previous version of Orchard. The theme by default uses a front-end menu which is the same as the admin menu just uses the Main name instead of admin. The Layout.cshtml file of the theme automatically sets up the normal things like the viewport, language, etc, injects the Header, and injects the latest Bootstrap, so it actually overrides the one coming from Orchard Core with the one that you set up in your theme via npm. This is good if you need some features that are newer than the one in the release. You can also find a very tiny JavaScript helper that lets you have a ready event. It makes the library a little bit slimmer. If you would like to know more about this theme, head to YouTube for a demo! News from the community Orchard Core 1.4.0 Orchard Core 1.4.0 is now available! If you open up nuget.org and search for the OrchardCore.Application.Cms.Targets package, you will find the updated version of Orchard Core! There is a new page in the documentation with the breaking changes and the new features. Upgrade your solution to 1.4.0 now! Feel free to drop on the dedicated Gitter chat and ask questions or use GitHub Discussions! Orchard Core Commerce MVP planning and survey A few weeks ago, you could see a nice demo about the Orchard Core Commerce module. And in that blog post, we also mentioned that Lombiq provides stewardship for this module. That actually means that we will do code reviews and work on features and fixes. To have that, Márk Bartha (who is the project leader from our side) started this thread and added this survey. This is about asking the community what the most important features for you would be in an Orchard Core-based e-commerce solution. If you do e-commerce or if you have an opinion about e-commerce, please share your opinion here. The point of this is to try to do not all the things but focus on what is really needed first. Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 275 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 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 around Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting!

Bootstrap 5 in the default Admin theme, Orchard Core Commerce survey - This week in Orchard (27/05/2022)

The default Admin theme now using Bootstrap 5, logging warning when a Zone isn't a Shape, adding documentation on Query API results changes and if you do e-commerce or if you have an opinion about e-commerce, please share your opinion with us by filling out this survey! Orchard Core updates Bootstrap 5 in the default Admin theme The Admin theme now using Bootstrap 5! The change only affects the Admin theme, there is no change in the built-in themes, you can use whatever Bootstrap version would you like to use there (or any other framework of course). If you open up the ResourceManagementOptionsConfiguration file in the Resources module, you can see that now you have the option to use the new Bootstrap version. Log warning when a Zone isn't a Shape You can't use both <zone> tag helpers and widgets for the same zone. If you have a widget in the zone, the content in zone tag helpers are ignored. Steps to reproduce the behavior: Create a new Orchard Core CMS Web App solution. Add a new Orchard Core Theme project. Replace the Views/Layout.liquid with Views/Layout.cshtml having the following content to keep it simple: @inherits OrchardCore.DisplayManagement.Razor.RazorPage<TModel>@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers@addTagHelper *, OrchardCore.DisplayManagement@addTagHelper *, OrchardCore.ResourceManagement<zone name="Footer"> <p>Hello from zone tag helper!</p></zone>@await RenderSectionAsync("Content", required: false)@await RenderSectionAsync("Footer", required: false) Launch and set up the web app. Go to /Admin/Themes, and select the newly created theme. Confirm "Hello from zone tag helper!" is visible on the home page. Create a zone "Footer" and a layer "Always" (boolean true condition). Create a widget content type with Html Body and add a new item with "Hello from Widget!" to the Footer zone. Go back to the home page. You only see Hello from Widget! and any tag helpers are ignored. The expected behavior would be that you should see Hello from zone tag helper!Hello from Widget! in the footer. From now, the code will log a warning instead of failing silently if the zone is not a shape. Here you can see the logging in the ZoneTagHelper and in the ZoneTag. Add documentation on Query API results changes If you called the api/query/{name} endpoint in Orchard Core 1.0.0, the query returned with the following schema: [ { "Id": 321, "UserName": "test", "Email": "[email protected]" }] If you upgraded to Orchard Core 1.1.0, this endpoint returns the data in a different format: { "items": [ { "Id": 321, "UserName": "test", "Email": "[email protected]" } ] } To make sure you handle the response correctly, the documentation of Orchard Core has been updated to reflect these changes. News from the community Orchard Core Commerce MVP planning and survey A few weeks ago you could see a nice demo about the Orchard Core Commerce module. And in that blog post, we also mentioned that Lombiq provides stewardship for this module. That actually means that we will do code reviews, and work on features and fixes. To have that, Márk Bartha (who is the project leader from our side) started this thread and added this survey. This is about asking the community what the most important features for you would be in an Orchard Core-based e-commerce solution. If you do e-commerce or if you have an opinion about e-commerce, please share your opinion here. The point of this is to try to do not all the things but focus on what is really needed first. Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 271 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 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 around Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting!

Update ImageSharp.Web v2, Lombiq Helpful Libraries - Resource Management for Orchard Core - This week in Orchard (19/05/2022)

Updating ImageSharp.Web v2, removing pagenum=1 from the 1 pager link to improve SEO, adding OnMessageSendingAsync() protected method and news and updates around the Lombiq Helpful Libraries. Check out our current post to read about the details! Orchard Core updates Update ImageSharp.Web v2 ImageSharp is a new, fully-featured, fully managed, cross-platform, 2D graphics library. Designed to simplify image processing, ImageSharp brings you an incredibly powerful yet beautifully simple API. ImageSharp is designed from the ground up to be flexible and extensible. The library provides API endpoints for common image processing operations and the building blocks to allow for the development of additional operations. ImageSharp.Web is a high-performance ASP.NET Core Middleware built on top of ImageSharp that allows the processing and caching of image requests via a simple API. ImageSharp.Web provides API endpoints for common image processing operations and the building blocks to allow for the development of additional extensions to add image sources, caching mechanisms, or even your own processing API. A few weeks ago ImageSharp.Web v2 had been released, and now Orchard is using the latest version of ImageSharp thanks to Dean Marcussen. ImageSharp is used in Orchard Core when you would like to work with Media Profiles or when you work with images (like setting up a crop point) from the Media Library using the Media Field. Remove pagenum=1 from the "1" pager link to improve SEO There's a minor SEO problem with the pager when pagenum=1. Since the content of pagenum=1 is identical to the page where the pagenum parameter is absent, SEO audit tools want a canonical URL to be specified. Though arguably, the pagenum parameter should just be removed when the value is 1. Steps to reproduce the behavior: Set up your site with the Blog recipe. Navigate to Configuration -> Settings -> General and set the Page size to 1. View the content items and observe the pager behavior. The expectation would be the pagenum parameter to be removed for the 1 link like it is for the < and << links. From now, you will not find pagenum=1 when you would like to navigate to the first page of your lists, even when you are hovering over the list item that contains 1 in your pager. Adding OnMessageSendingAsync() protected method There is a new protected virtual method called OnMessageSendingAsync, which is called before you want to send a new email using the STMP service. Now you can define how to configure the SMTP client before sending your message. News from the community Lombiq Helpful Libraries - Resource Management for Orchard Core The resource filter makes it possible to include resources automatically based on the current context. E.g., inject home page styling only when the home page is being loaded., Let's see a quick and simple sample about how you can use it and, what can you do exactly with this filter! Last week we mentioned that our Base Theme for Orchard Core is released, which contains all the foundations to build Orchard themes efficiently with included detailed samples. If you want to quickly try out this project and see it in action, clone our Open-Source Orchard Core Extensions full Orchard Core solution and also see our other useful Orchard Core-related open-source projects! We will clone the Lombiq's Open-Source Orchard Core Extensions repository for this demo as well. We will set up our site using the Blog recipe. After that, you can navigate to Design -> Themes and enable the Lombiq Base Theme and Lombiq Base Theme - Samples themes. You can also make the Samples one as the current site theme. Don't forget to enable the Lombiq Helpful Extensions - Helpful Widgets feature from Configuration -> Features. And now, you can go to the home page of your site and open the predefined blog post that comes from the recipe. You will see that our theme is applied with our stylesheets too, which will apply a different look when the site renders the detailed view of a blog post content item. And here comes the resource filters. To add resource filters the IResourceFilterProvider interface needs to be implemented, and the registration needs to be added to the service collection as well. As you can see here, we used the Always, and WhenContentType methods to define when to inject the stylesheets that we registered using the RegisterStylesheet method. We also have a RegisterFootScript and a RegisterHeadScript method to register scripts that will be displayed in the head or at the foot of the page. If you always want to inject the resource named Site, you can use the Always method. And if you only want to inject the resource named BlogPost when we display the detail view of the BlogPost content type, use the WhenContentType method and provide the BlogPost as the name of the content type. And don't forget to activate the resource filter middleware by adding app.UseResourceFilters() to the Configure method of the Startup file located in a common module or the web project. E.g.: public override void Configure(IApplicationBuilder app, IEndpointRouteBuilder routes, IServiceProvider serviceProvider){ app.UseResourceFilters();} If you check out the ResourceFilterBuilder.cs (right side of the screen) you will find any other helpful methods that can be used to conditionally inject resources. Like the WhenHomePage and the WhenPathStartsWith ones, which have self-describing names. For more information, don't forget to check out the readme file about Resource Management. Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 253 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 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 around Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting!

Fixing in the ContentPickerFieldIndexProvider, Lombiq Base Theme for Orchard Core - This week in Orchard (13/05/2022)

Fixing that unpublishing and editing content item with uninitialized ContentPickerField breaks, renaming ReverseProxySettings permission to ManageReverseProxySettings, and our Base Theme for Orchard Core is officially released! Check out our current post to read about the details! Orchard Core updates Rename ReverseProxySettings permission to ManageReverseProxySettings The Reverse Proxy Configuration module enables the configuration of hosting scenarios with a reverse proxy, like enabling the forwarding of the HTTP header X-Forwarded-For and so on. You can manage these options under Configuration -> Settings -> Reverse Proxy, but you need to have the proper permission to do that. Now this permission has a new name, called Manage Reverse Proxy Settings, that you can manage for every role under Security -> Roles. Unpublishing and editing the content item with an uninitialized ContentPickerField breaks If you have a custom ContentPart that contains a ContentPickerField and it's not initialized (so null) and you try to unpublish the content type, it will say it was unpublished, but that won't be true. If you try to edit and publish the same content item, you will get "An unhandled exception occurred while processing the request." error. Dávid El-Saig realized this can be avoided by giving the field a default value (public ContentPickerField Related { get; set; } = new();), but it's easy to miss, and the resulting symptoms are not easy to connect with the true problem. Steps to reproduce the behavior: Create a content type via migration. Start and set up the web app. Create a new content item of the content type. Add a part (e.g. public class RelatedPart : ContentPart { public ContentPickerField Related { get; set; } }) via migration update step. Start up the web app again. Try to unpublish or edit the content item created in step 3. Experience the bug described above. The expected behavior would be that the unpublishing or editing should be successful. And the problem was the following: the if (jPart == null) and if (jField == null) will never be true because if the value is JSON null, it will be a JValue type, so the cast on the preceding line will cause the exception as you can see on the screenshot. This can be fixed if type matching is used instead of casting. And as you can see, there is a new GetContentFields extension that uses the GetContentField extension which contains using the type matching instead of casting. News from the community Lombiq Base Theme for Orchard Core is officially released Our Base Theme for Orchard Core is now officially released! It contains all the foundations to build Orchard themes efficiently with included detailed samples. It can contain any shared content that is not specific to a specific project's theme. You can find the sample module with a commented walkthrough in this repository here. If you want to quickly try out this project and see it in action, clone our Open-Source Orchard Core Extensions full Orchard Core solution and also see our other useful Orchard Core-related open-source projects! We will clone the Lombiq's Open-Source Orchard Core Extensions repository for this demo as well. If you remember, two weeks ago, we mentioned that the Lombiq Helpful Libraries contains an abstract class called MainMenuNavigationProviderBase for creating a home page menu structure using the main navigation name. If you use the Lombiq.BaseTheme, it automatically displays the generated menu as a widget in the Navigation zone. Now it's time to see it in action! Just run our Open-Source Orchard Core Extensions solution and set up your site using the Agency recipe, for example. After that, you can navigate to Design -> Themes and enable the Lombiq Base Theme and Lombiq Base Theme - Samples themes. You can also make the Samples one as the current site theme. Now let's enable some features. Our home page menu structure will display as a widget in the Navigation zone. To have the MenuWidget, we need to enable the Lombiq Helpful Extensions - Helpful Widgets feature. The HelpfulLibrariesNavigationProvider sits in the Samples project of Helpful Libraries, so we have to enable the Lombiq Helpful Libraries - Samples feature as well. Now we can navigate to the home page of our site. The styling looks quite awful, but that's not the point here. As you can see, the Helpful Libraries drop-down now appears with the submenu items that we defined in the Build method. You can see the special LINQ to DB label, and the divider as well. And of course, you have the option to navigate to the given actions to test out the LinqToDbSamplesController that provides some examples of querying the database with Lombiq.HelpfulLibraries.LinqToDb and the TypedRouteController. Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 247 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 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 around Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting!

Feature aware Razor Pages, Orchard Core Commerce - This week in Orchard (06/05/2022)

This week you can read that the Feature attribute was not working for Razor Pages, the Lucene documentation updates, and a demo of the Orchard Core Commerce module! Are you interested in the details? Check out this post for more! Orchard Core updates Feature attribute was not working for Razor Pages The Feature attribute was not applied to Razor Pages because Razor Pages were always tied to the module. What does it mean? Well, let's follow the steps below: Create a Module with a feature. Add a Razor Page. Add the Feature attribute to a Razor Page. Enable the module and the feature it will serve the Razor Page. Disable the feature - notice that Razor Page is still served. Now, the feature is disabled, and the site should not serve the Razor Page, but it was still served. Now, this has been fixed and you can also try it out if you enable the Orchard Core and Orchard Foo Demo features that sit in the Orchard Demo project. Note that this project is not referenced by default, so if you would like to try it out, you can simply add it to the OrchardCore.Cms.Web, for example. You can find two Razor Pages (Edit and List) with the Feature attribute OrchardCore.Demo.Foo. Meaning that if you enable the Orchard Demo feature but keep the Orchard Demo Foo disabled, you can not reach these pages. Lucene documentation updates You can write elaborate Lucene Queries with the ElasticSearch DSL. This includes the match query type (akin to using the my search term syntax in the search box) and match_all (like writing "my search term" for exact search). And you can optionally use the parsed Lucene search syntax in the search text box. However, the documentation of the Lucene module had some missing examples about how you can combine the two and how to use the search syntax with a Query. The simple_query_string is also available but was missing from the docs, it has been added too. Demos Orchard Core Commerce 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 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. This work is in its initial design phases and will focus at first on porting a minimum viable feature set. In this demo, we will check out the current state of the module. To set up your dev environment, you should clone this repository, build and run the SampleWebApp project (set up with any recipe) and enable the Orchard Core Commerce, Orchard Core Commerce Session Cart Storage, and the Orchard Core Commerce Settings Currency Selector features. From now on, you can start using the features by creating a new Product content type and adding the Product part to it, and so on. But you can run the built-in recipes (MultiCurrencyProduct, Order, and Product) to set up your content model just by a few clicks. Meaning you will have a Product content type with a Product Part and multiple Price Parts. Order content type with an Order Part, a shipping address, and a billing address. Product content type with a Product Part and a Price Part. And if you check out the recording below you will know how to create products like this one, where you can define the SKU(Stock Keeping Unit), the base price of the product, and you have the option to attach the built-in Boolean/Numeric/Text Product Attribute Fields that can help you to define the available sizes for the given T-shirt for example. News from the community Lombiq provides stewardship for Orchard Core Commerce You saw the current state of the Orchard Core Commerce module, and if you follow the news around Orchard and Orchard Core, you may notice that the project is moving a little slow because of the level of the contributions. We'd like to announce that Lombiq Technologies provides stewardship for the Orchard Core Commerce project. Bertrand, who initially founded the Orchard 1 and Orchard Core Commerce modules, reached out to us if we are interested in actively maintaining the project. We at Lombiq are really excited about this opportunity. We want to move this forward with proper planning and frequent contributions to the repository. On our side, Márk Bartha will be the project leader. A few seasoned Orchard developers are ready to implement features. But first, we want to hear your opinion about what you need first and most for the MVP. We'll put together a short survey to collect your ideas in an organized manner. Until then, feel free to comment and let us know your thoughts! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 248 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 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 around Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting!

Leverage CSPROJ meta information, Lombiq Helpful Libraries - Navigation for Orchard Core - This week in Orchard (29/04/2022)

Adding an AppSetting option to disable SQLite connection pooling, leveraging your CSPROJ meta information and news and updates around the Lombiq Helpful Libraries! Check out our current post to read about the details! Orchard Core updates Remove Lucene from built-in recipes This is about making the built-in setup recipes lightweight: Lucene is a feature that you don't need on every site, especially due to it storing files on the local file system that need to be preserved (i.e., not temp files) it needs special considerations for hosting (you need to take care of those files when moving the app between environments and doing deployments). The goal here is to not enable Lucene by default in the following recipes: Headless: just remove it. Blank: just remove it. Blog: Create an SQL RecentBlogPosts Query and don't enable Lucene by default. Have a separate, non-setup recipe to set up the search just for a frontend search page (i.e., 90% of what happens related to Lucene in the recipe now). Have a second non-setup recipe that runs the previous one and also swaps out RecentBlogPosts with a Lucene Query. And from now you can find two new optional recipes in the TheBlogTheme: Lucene Query Recipe: this recipe runs the Blog Lucene Search recipe and as an example, the recipe replaces the RecentBlogPosts SQL query with a Lucene query. Lucene Search Recipe: this recipe enables the Lucene feature and creates the Search setting, Lucene indices, and permissions. The Recipes and Starter Themes page of the Orchard Core documentation has also been updated to reflect these changes. Leverage CSPROJ meta information Out of the box, a Manifest.cs file is generated, which includes the ModuleAttribute, FeatureAttribute, ThemeAttribute, and so forth, that describe the Orchard Core meta-information about your projects. However, let's say you want to connect available meta properties at the CSPROJ level, i.e., such properties as $(MSBuildProjectName), $(AssemblyVersion), $(PackageTags), to name a few. At its core, you may want to follow a pattern similar to InternalsVisibleTo, i.e. <ItemGroup> <AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo"> <_Parameter1>Test.$(MSBuildProjectName)</_Parameter1> </AssemblyAttribute></ItemGroup> The principles are the same, but in prior versions, the attribute constructors were not available to lean into. Michael W Powell also decided to provide helpful MSBuild Items as a more accessible, self-documenting shorthand input. From now, you can connect available meta properties at the CSPROJ level by leveraging CSPROJ meta information. If you are interested in how to leverage Orchard Core CSPROJ item lists and properties to enrich and get the absolute most from your authoring experience, this is the page you should take a look at! News from the community Lombiq Helpful Libraries - Navigation for Orchard Core The Lombiq Helpful Libraries contains various useful libraries that can be handy when developing for .NET, ASP.NET Core, and Orchard Core, to be used for your own projects. This time we would like to show you two helpful abstract classes: the NavigationProviderBase and the MainMenuNavigationProviderBase. NavigationProviderBase: an abstract base class for creating reducing boilerplate in INavigationProvider for checking the name parameter and if the user is authenticated. MainMenuNavigationProviderBase: an abstract base class derived from NavigationProviderBase for creating a home page menu structure using the main navigation name. If you use the Lombiq.BaseTheme automatically displays the generated menu as a widget in the Navigation zone. There is a Lombiq.HelpfulLibraries.Samples project for various examples in the form of an Orchard Core module. And that project contains a class called HelpfulLibrariesNavigationProvider. This class inherits the MainMenuNavigationProviderBase, which overrides the NavigationName with the "main" value. And if you check out the sample code here, you can see some other interesting stuff, like how we set up where to navigate users when they click on the given menu items. .ActionTask<LinqToDbSamplesController>(context, controller => controller.SimpleQuery())) In this case, we say that let's navigate the user to the SimpleQuery action of the LinqToDbSamplesController. And of course, you have the option to provide additional arguments as well if you check out the NavigationItemBuilderExtensions static class. Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 247 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 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 around Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting!

Make Resources module always enabled, Content Preview module - This week in Orchard (22/04/2022)

This week you can read about making the Resources module always enabled, fixing HTML accessibility validation in the admin UI, using LinkGenerator instead of IUrlHelper in SignalMethodProvider, and a demo of the Content Preview module for Orchard Core! Are you interested in the details? Check out this post for more! Orchard Core updates Make Resources module always enabled Let's say you have the Resources module enabled on your site. The Resources module declares scripts and stylesheets that you can use across your tenants like you can have jQuery, jQuery UI, Bootstrap, and CodeMirror just by using the assets defined in this module. But you were able to disable the Resources module without any warning. If you disable that module, you will face an exception. From now you can see that the IsAlwaysEnabled property is set to true in the Manifest file of the module. IsAlwaysEnabled only means that you can't disable the feature once it is enabled, so you can still not use it if not defined from a setup recipe, from a configuration, or from the app with the helpers and so on. Fix HTML accessibility validation in the admin UI There were some UI warnings on the admin page if you run through these validators in the admin UI of Orchard Core: https://validator.w3.org/ https://html-validate.org/rules/prefer-native-element.html https://html-validate.org/rules/no-dup-id.html https://html-validate.org/rules/text-content.html Most of the warnings were found in the UserMenu.cshtml and the Layout. cshtml. For example: UserMenu: Attribute class duplicated. Attribute asp-route-returnurl should be lowercase. <button> is missing the required type attribute. Layout: <resources> must not be self-closed. <button> is missing the required type attribute. Anchor link must have a text describing its purpose. Now - as you can see - the button has the type attribute, there are no duplicated class attributes, and the returnurl is lowercased. Use LinkGenerator instead of IUrlHelper in SignalMethodProvider The signalUrl() JavaScript helper method stopped working, and you were faced with this error: The solution was to not use the IUrlHelper interface anymore but instead of that, use the LinkGenerator, which has a GetPathByAction method that can provide the URL for you. Demos Content Preview Module Hisham Bin Ateya has an organization on GitHub called OrchardCore Contrib with a couple of projects under it. The OrchardCoreContrib.Modules repository contains several modules. This demo is about checking how you can use the Content Preview Module. The Content preview feature of Orchard Core allows you to display the result that will be rendered on the front-end in a separate window while you are editing a content item in the admin. A Preview button is available in the action buttons when you create or edit a content item. And this module allows you to preview your page on different devices. So, if you add the OrchardCoreContrib.ContentPreview NuGet package to your Orchard Core host project and run your application, you will find a new feature if you search for the bar word in the Configuration -> Features screen. If you enable the Page Preview Bar feature, you will be able to preview the currently visited page on desktop, tablet, and mobile from within the top page preview bar. In our case, we hit the Preview button of the predefined About article of the Blog recipe. If you would like to know more, head to YouTube for a short demonstration of this module! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 247 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 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 around Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting!

Creating ContentPart_Edit Shape using ShapeResult to support placement, Swagger module - This week in Orchard (14/04/2022)

This week you can read about updating the Roles module documentation, creating ContentPart_Edit Shape using ShapeResult to support placement, fixing an NRE when trying to save an empty LinkField and a demo of a Swagger module for Orchard Core! Are you interested in the details? Check out this post for more! Orchard Core updates Update Roles module documentation Orchard doesn't actually "come with predefined roles". The roles themselves are actually not created anywhere by default. Permissions corresponding to them are but without roles, they don't do anything. The roles all just come from recipes. Szabolcs Deme updated the description of the documentation to reflect that. Create ContentPart_Edit Shape using ShapeResult to support the placement In the past, when the placement was defined for ContentPart_Edit none of the following applied. { "ContentPart_Edit": [ { "place": "-", "contentType": [ "Container" ] } ], "BackgroundColor_Edit": [ { "place": "-", "contentType": [ "Container" ] } ], "BootstrapColor_Edit": [ { "place": "-", "contentType": [ "Container" ] } ]} If you want to reproduce the behavior, you can follow these steps: Create part BootstrapColor with TextField with PredefinedList as editor. Select Reusable. Add BootstrapColor Part as named part to Container content type with name BackgroundColor. Add any of the following placement rules in placement.json to hide:"ContentPart_Edit": [ { "place": "-", "contentType": [ "Container"], "contentPart" : ["BootstrapColor"], "differentiator": "BackgroundColor" } ] OR"BootstrapColor_Edit": [ { "place": "-", "contentType": [ "Container"], "contentPart" : ["BootstrapColor"], "differentiator": "BackgroundColor" } ] OR"BootstrapColor": [ { "place": "-", "displayType": "Edit", "contentType": [ "Container"], "contentPart" : ["BootstrapColor"], "differentiator": "BackgroundColor" } ] See part is still visible while editing and placement rule is not applied, but the expected behavior is the placement should apply. So, this is about creating ContentPart Shape using ShapeResult to support placement and alternates. Now, placement can be applied to dynamic named parts as follows: { "ContentPart_Edit": [ { "place": "Parts#HTML Attributes", "differentiator": "Container-BackgroundColor", "contentType": ["Container"], "contentPart": ["BootstrapColor"] }]} and shape can be overridden using alternates, eg. ContentPart-Container-BackgroundColor.Edit.cshtml. Fix NRE when trying to save an empty LinkField Content items with optional Link Fields don't allow the Link Field URL to be cleared once saved due to a Null exception in the display driver. The expected behavior would be when a Link Field that is set to Optional has its values cleared, the Link Field should remain empty when saved. You could reproduce the behavior by following these steps: Create a content type with a Link Field and leave it Optional. Create a new instance of that type and fill in a URL and Link Text then save. Edit the previously created instance, clear the URL and Link Text, and then save again. Edit the previously saved instance, and the URL and Link Text will still be there. Check the Orchard logs - there will be a Null exception from the display driver. As you can see from the changes below, now we only validate the URL if it exists. Demos Swagger Module Hisham Bin Ateya has an organization on GitHub called OrchardCore Contrib with a couple of projects under it. The OrchardCoreContrib.Modules repository contains several modules. This demo is about checking how you can use the Swagger Module. Swagger is an Interface Description Language for describing RESTful APIs expressed using JSON. Swagger is used together with a set of open-source software tools to design, build, document, and use RESTful web services. Swagger includes automated documentation, code generation (into many programming languages), and test-case generation. The point here is that this module provides easy integration. So, if you add the OrchardCoreContrib.Apis.Swagger NuGet package to your Orchard Core host project and run your application, you will find two new features if you search for the swagger word in the Configuration -> Features screen. If you enable them then you get a Swagger JSON-based API documentation by visiting the Swagger end-point by append /swagger/v1.0.0/swagger.json to the URL. And the same thing is also available under the /swagger/index.html URL with a nice Swagger UI. This - just as Swagger does - automatically shows all registered API endpoints, so if you add documentation to them, those will show up here. And of course, you can play with them as you can do with Swagger in any context. If you would like to know more, head to YouTube for a short demonstration of this module! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 247 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 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 around Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting!

Option to disable SQLite connection pooling, tenant hostname duplicate check - This week in Orchard (08/04/2022)

Adding an AppSetting option to disable SQLite connection pooling, improving tenant hostname duplicate check, Monaco loader aware of the virtual folder, and a new tutorial sample project in the Lombiq Vue.js module for Orchard Core! Check out our current post to read about the details! Orchard Core updates Added an AppSettings option to disable SQLite connection pooling Most database configuration is handled automatically, but there are limited options that can affect the way the database works. By default in .NET 6, Microsoft.Data.Sqlite pools connections to the database. It achieves this by putting locking the database file and leaving connections open to be reused. If the lock is preventing tasks like backups, this functionality can be disabled. There may be a performance penalty associated with disabling connection pooling. See the Microsoft.Data.Sqlite documentation or the Orchard Core documentation for more details. As you can see in the screen below, you can configure the UseConnectionPooling by using the appsettings.json to turn on the pooling that will be used by the SqliteConnectionStringBuilder when using SQLite. Improving tenant hostname duplicate check There was an issue about the tenant's hostname was not checked for existence if the other tenant has multiple hostnames. You could reproduce this bug by following these simple steps: Create a tenant with the hostnames "example1.com, example2.com". Create a tenant with the hostname "example1.com". Observe that you can create the second tenant even though the hostname is duplicated. The expected behavior would be that you get the "A tenant with the same host and prefix already exists." validation error, and you can't save the tenant. Note that the validation error is raised if the first tenant has just a single hostname specified. In the following example, we created a tenant with the name Tenant4. We keep everything as is, and we just provided the hostname to be example1.com. After we added another tenant by using Tenant5 as the name. We kept the prefix empty and used example1.com as the hostname again. As you can see, we got the following validation error. Monaco loader is aware of the virtual folder We use the tenant prefix to set a data-tenant-prefix attribute that will be used by the monaco loader.js to load editor.main.js. But it doesn't take into account a possible virtual folder, so here we use the PathBase instead. Jean-Thierry Kéchichian kept the data-tenant-prefix attribute name to not break anything. Just for info, he tried to use tété as a tenant prefix, then in the HTML source code, we can see some attributes that are URL encoded t%C3%A9t%C3%A9, e.g., when .RouteUrl() is used, some are HTML encoded t&#xE9;t&#xE9; e.g., when @Url.Content(~/...) is used, and some that are not encoded tété, e.g., those provided by resources tag helpers. We know that the browser is able to do the right decoding/encoding (escaping is more important, e.g., on server-side redirections), so he let things as is to not break anything. But here it is an HTML data attribute used by a script, so here he opted to use the escaped PathBase by not using .Value so that the implicit .ToString() will encode it if needed. Don't forget that Url.Content("~/") doesn't encode URLs, so if you use href="@Url.Content("~/"), special chars that were not URL encoded will be HTML encoded by the rendering. News from the community New tutorial sample project in the Lombiq Vue.js module for Orchard Core The Lombiq Vue.js module for Orchard Core is an Orchard Core module that contains Vue.js and commonly used Vue.js components to be used in other Vue.js apps as dependencies. Provides extensibility to create Vue.js component templates as Orchard Core shapes making them able to override in themes or modules. We wrote about having Single File Components in the module a few weeks ago, and from now, this module contains this new, polished, detailed tutorial sample project about integrating Vue.Js into Orchard Core. The sample project has different top-level training sections, like: Writing Vue.js applications in Orchard Core modules Writing Vue.js Single File Components in Orchard Core modules If you want to know more about it, don't forget to check out the mentioned This week in Orchard post and this recording on YouTube! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 247 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 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 around Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting!