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

Add Recipe Roles permission behavior, how to add media management to an ASP.NET Core app? - This week in Orchard (24/01/2025)

This week's topics are migrating the OpenID module to OpenIddict 6, adding Recipe Roles permission behavior, and we will mention our latest Orchard Nuggets post, where you can learn how to add media management to an ASP.NET Core app. Without further ado, let's dive in!

Featured tags

IIS
API
SMS
SEO
All tags >

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été 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!

Orchard Core 1.3.0, fix missing permission checks and encoding - This week in Orchard (24/03/2022)

We are thrilled to announce that Orchard Core 1.3.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 Fix missing permission checks and encoding These are security fixes that are fixed with Orchard Core 1.3.0. In this case, the fix targets two major issues. The first is that some authorization checks were not done correctly for some controllers. Here you can see the changes of the AdminController of the Features module. The second change is in the SEO module. There were XSS issues in the module. They were not very critical issues because you have to reach the admin editor to do that, and when you define SEO things for the front-end, you might want to render an HTML. But now it's sanitized for XSS reasons. The properties in the SeoPart are now encoded, in a way that you can use the Shortcodes, but you can't type anything else. You can't write any HTML you want, just the ones that make sense. And there is one special case when you set up the Google Schema: now it's not outputting anything, it's just validating the JSON format that you have provided. And when you create custom Shortcodes now the usage of the Shortcode (which is just some documentation) is now also sanitized, such that you can't inject custom JavaScript code in the description of the Shortcodes and try to hack people on the same admin page. Update full-text search index documentation Orchard Core provides a Lucene module/feature that allows you to do a full-text search on your websites. It is possible to configure which text/data you want to index in the Content Type configuration by using Liquid. And the following guide is helping you with how to implement a website full-text search step by step. And now the page has been updated with the following section: if your content item is also a set of content items, then you need to call the full_text_aspect helper to include the content of the content item inside the full-text search index. Fix NRE with TaxonomyIndex The index runs while cloning a content item, right after an empty content item was created (so before the actual cloning). The fields are there, but all are null. Casting this to JObject fails, as null is a JValue. The solution is that you have to do the casting in another way by using the as keyword. News from the community Orchard Core 1.3.0 Orchard Core 1.3.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.3.0 now! Feel free to drop on the dedicated Gitter chat and ask questions! And don't forget: this release is removing support for netcoreapp3.1 and net5.0. Only net6.0 is supported. Updated Lombiq's Open-Source Orchard Core Extensions Lombiq's Open-Source Orchard Core Extensions is an Orchard Core CMS Visual Studio solution. It contains most of Lombiq's open-source Orchard modules and themes, as well as related utilities and libraries, like the Lombiq UI Testing Toolbox or the Training Demo module that guides you to become an Orchard Core developer. And from now, this solution with all the extensions inside is updated to Orchard Core v1.3.0 and .NET 6! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 241 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!

Support Mail Proxy, open-source Lombiq projects published on NuGet - This week in Orchard (10/03/2022)

Topics for the week are the new mail proxy support, documentation about how to use a local copy of Orchard Core source code as NuGet packages, and the published Lombiq projects on NuGet! Do you want to know more? Then check out our post now! Orchard Core updates Support Mail Proxy Let's say that your web hosting provider doesn't allow outbound connections by default (IONOS Windows Shared). In this case, all outbound connections should be sent through a proxy on this platform. You can configure it for HTTP(S) by adding this in the Startup.cs of the Orchard Core web app: HttpClient.DefaultProxy = new WebProxy("http://winproxy.server.lan:3128"); However, there was no way to configure this for SMTP connections. So there was an issue about not being able to send a mail with Orchard on this hosting provider. But from now you can configure the proxy server and the proxy port number by enabling the OrchardCore.Email module and using the SMTP Settings. The documentation is also updated with these new settings. Using a local copy of Orchard Core source code as NuGet packages There is a new page in the Orchard Core Documentation about how to use a local copy of Orchard Core source code as NuGet packages. In this new article, you can see how to create your own local NuGet feed from your local source code, how to publish to your NuGet feed, and how to update your project to use the newly created feed. News from the community Configure portable object localization in ASP.NET Core There was an ASP.NET Community Standup about localizing the .NET website. There was a topic on how the .NET websites have been localized using the Orchard Core localization package with PO files. Sébastien Ros did a demo about the package, explained how the localizer works, how to inject it, how to use the module, how to create a PO file, how to use pluralization, etc. If you would like to know more about localization and haven't seen that demo yet, check out the recording of that standup meeting here! And in the meantime, now there is a new article on the Microsoft Technical Documentation where you can read more about what is a PO file, how to configure PO file support in ASP.NET Core, or how to create a PO file with several useful examples. Open-source Lombiq projects now published on NuGet We have more than 160 open-source repositories under our GitHub organization, out of which more than 140 are somehow related to Orchard (including Orchard Core and 1.x). Up until now, if you wanted to utilize our projects in your own ones, you could only reference them as Git submodules or copy over the source files. Now, however, all the Orchard Core-related projects of ours, as well as several others, are available as NuGet packages! Check out our blog post to know more about our NuGet packages! Do you want to easily publish your projects to NuGet as well? You can build on what we've created for that: Take a look at our new GitHub Actions project that we developed with the help of Orchard community member Dean Marcussen. Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 238 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!

Monaco editor supports preview, Vue.js Single File Components in Lombiq Vue.js module - This week in Orchard (25/02/2022)

This week you can read about updating the Monaco editor to support preview, improving the documentation of Orchard Core, search form improvements, and a demo about using Vue.js Single File Components in Lombiq Vue.js module for Orchard Core! Are you interested in the details? Check out this post for more! Orchard Core updates Make the Monaco editor Field support preview Now the Monaco editor Field correctly supports the content preview feature on every change. To test this out, you just need to have a content type with a Text Field attached. Don't forget to set the editor type to Monaco editor for that field. Documentation improvements The documentation of Orchard Core has been improved. Documentation for the Audit Trail, SEO Meta, Deployment, Remote Deployment, Redis modules have been added, and there were some missing Orchard Core Demo YouTube videos that are now embedded into the corresponding page of the documentation. Search Form: allow to override Index used Let's say you have a content type, called Blog. Inside that, there are a lot of blog posts, and there is a need to search inside of that content type of Blog. The question is, how can you limit the full-text search based on that content type? Well, from now there is a new feature that allows passing a QueryString param in the search form page to override the current default Index used for displaying results. This can also be set as a hidden form input fixed value if used from a different form. These Indices are protected by permissions, so it should be fine to allow to do this, instead of needing to create a different controller per index required to be searched from. You can use this in the following way: /search?Terms=moon&Index=BlogIndex Demos Vue.js Single File Components in 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. And from now, you have the option to use Vue.js Single File Components! The module identifies Single File Components in the Assets/Scripts/VueComponents directory and harvests them as shapes. They have a custom .vue file renderer that displays the content of the <template> element after applying localization for the custom [[ ... ]] expression that calls IStringLocalizer. Besides that, it's pure Vue, yet you can still make use of shape overriding if needed. You can read more about it in the module's readme file. Now it's time to see it in action! You will find a Lombiq.VueJs.Samples project in the repository that contains some Vue files. The module now supports these special files (where you can put the template and the script in the same file) and harvest these as shapes. If you open up the demo-sfc.vue file, you can see one unique solution for localization. As we mentioned, by using the [[ ... ]] syntax, you can perform localization via IStringLocalizer at runtime. Let's run the Vue.js Single File Component sample in the Lombiq.VueJs.Samples module! As you can see, this sample is about providing a table with some data and a pager that you can use to navigate between the pages of the table with the help of the Single File Components. And we are just scratching the surface here! If you would like to know more about using Vue.js Single File Components with the help of the Lombiq Vue.js module, check out this recording on YouTube! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 237 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 week's Orchard meeting!

Fix route ChangePasswordConfirmation, Fluid 2.2.14 - This week in Orchard (09/02/2022)

New custom path for the ChangePasswordConfirmation, Fluid 2.2.14 with several fixes and improvements, Orchard Core on the ASP.NET Community Standup are the topics of this week. Check out this post for the details! Orchard Core updates Fix route ChangePasswordConfirmation The idea is that now there is a custom route for the ChangePasswordConfirmation instead of using the generic one. So, the action OrchardCore.Users.Controllers.ChangePasswordConfirmation() is now mapped to /ChangePasswordConfirmation, because that action was mapped to /OrchardCore.Users/ChangePasswordConfirmation. And the documentation of Orchard Core has been also updated with this new custom path. Fluid 2.2.14 Fluid 2.2.14 has been released with several fixes and improvements. Let's see some of the changes here! The first one is about displaying the source of an error message. Now, if there is a parser error, it will tell you the location of the error (line and column) but it will also show the line with the error. And this way it's easier to understand where the issue is. And if you have multiple templates, for instance, then you don't have to guess what template contains the error because you can see the error directly. Now FluidParserOptions can be configured by using Fluid.MvcViewEngine. This introduces a small set of further changes to support the recent work allowing for FunctionValues. Update to FluidViewParser constructor to pass FluidParserOptions argument. Update to sample projects to use the new constructor. The next improvement is to fix some keyword conflicts. Someone finds an issue in Orchard is that if you have a variable that is named emptyThing, the parser would find that you mean the empty keyword and will fail saying what is this Thing after the empty? And it's the same for blank, true and false. So, if you have variable names starting with empty, you can have them now, this is what this PR is fixing. And another one is to implement offset continue. Now you can assign a range directly to a variable with this version. Before you could not. The second thing is that you can do offset with the keyword continue. So, in this case, continue is a keyword and what happens is that it will do another loop starting from where the previous loop stopped. So here, if you say limit: 2, it will start from the 4th item. And you can also pass another limit if you want. So, here the idea is that we loop for three items in the array, and then we loop again for the rest and display all the items. News from the community ASP.NET Community Standup - PO (portable object) localization with Orchard Core There was an ASP.NET Community Standup about localizing the .NET website. The topics were how the .NET websites have been localized using the Orchard Core localization package with PO files. Sébastien Ros did a demo about the package, explained how the localizer works, how to inject it, how to use the module, how to create a PO file, how to use pluralization, etc. If you would like to know more about localization, check out the recording of that standup meeting here! DotNest Core is on Orchard Core 1.2.2 DotNest Core is a complete redevelopment of the DotNest platform, all on the latest version of Orchard Core. We've been running it with a couple of select few customers for a while now, and it's time to open it up a bit more. While you can't yet simply create an Orchard Core-based DotNest site, you can sign up for our limited beta here. You'll soon be able to get a fully functional, reliably hosted Orchard Core site on DotNest where you can build your personal website or something to showcase your Orchard skills with. And now the DotNest Core sites run on Orchard Core 1.2.2! Do you want to have a hassle-free Orchard site running in the cloud? Then sign up for the beta here! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 239 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 week's Orchard meeting!

Orchard Core 1.2.2 release, Media search indexing - This week in Orchard (26/01/2022)

Orchard Core 1.2.2 is now available that addresses some other security issues. Check out this post to know the content of this release of Orchard Core and to see the latest features of the framework! Orchard Core updates Media search indexing The idea here was to allow to search for content in files. Last summer, you could see a demo in this This week in Orchard post that shows a feature that provides a simple implementation to index media for search. More precisely, it indexes media files related to content items, so said content items will turn up in search when one of their media files matches the search query. And now this feature is merged to the main branch of Orchard Core! Check out the updated documentation to know more! Remove multiple compilation paths on MediaTokenService From the next minor version, Orchard Core will only build with .NET 6.0, so we can remove all the things from the code that do not target .NET 6.0 specifically. This time the ParseQuery method of the MediaTokenService got simpler because now we don't need to use the slower version, we can use the fast version with structs now. Add response to SmtpResult When you send an SMTP request, the response can be read, and now you can do whatever you want with the response. We already know if it failed or not from the SmtpResult, but now there is even more information in the Response. News from the community Orchard Core 1.2.2 release Orchard Core 1.2.1 has been released a few days after the 1.2.0 one, and here comes 1.2.2 to address some other security issues. If you open up nuget.org and search for the OrchardCore.Application.Cms.Targets package, you will find the newest released version of Orchard Core! Don't forget that 1.2.x is the latest minor version of Orchard Core that can be built by .NET Core 3.1 and .NET 5. If you take the main branch, it will only build with .NET 6.0, and the upcoming versions will be only shipped with .NET 6.0. .NET 6.0 is an LTS and shipped for many months now with some security updates already. It will also make the local builds with Visual Studio faster, the CI is faster because it doesn't have to build everything three times and run the tests three times. Now let's see the fix that is in this release! If you have a Link Field, you can provide a URL to that field, and the URL is now sanitized. Before this change, you could pass some JavaScript in the URL. With that what we are doing is checking the link that we are generating is sanitized. This issue was also in the Menu Item Link Field and also in the HTML Menu Item Link Field, so everywhere where we pass a link. Another fix was in the AuditTrailContentController.cs to be consistent with the other fixes. Error messages can't contain HTML and the issue that the _notifier.WarningAsync is asking for a LocalizedHtmlString. Why is it asking for a LocalizedHtmlString? It's because WarningAsync expects a LocalizedString using H[""]. In this case, the goal was to render an error message as a notification. But the error message is a string. So the developer decided to wrap the error message into a LocalizedHtmlString and pass it. And by doing that we say this is a safe string, this is already encoded, so it can be used in a view. This is what the H[""] does. So, everything here is safe. So, it can be passed as a LocalizedHtmlString. We are lucky that the error message is safe because internally it's a static string. But we don't do that, because it could be like some other developers will copy this code without understanding that this is safe or not. So, let's assume that it's not safe, and you shouldn't pass it as a LocalizedHtmlString, because that will prevent the notifier from encoding the result. The fix here is to pass the error message as an argument and because it's passed as an argument it will be encoded. So, this is how we pass a LocalizedHtmlString to a notifier from an unknown string safely. We can just pass it as an argument. And if you would like to know more about the fixed security issues, don't forget to check out this recording on YouTube! Looking for some useful Orchard Core extensions that can help improve your Orchard Core 1.2.2 application faster and easier? Here's a bundle solution of all of Lombiq's open-source Orchard Core extensions (modules and themes). Clone and try them out now! This is an Orchard Core CMS Visual Studio solution that contains most of Lombiq's open-source Orchard modules and themes, as well as related utilities and libraries. And we have also updated the solution to use Orchard Core 1.2.2! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 240 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 week's Orchard meeting!

Lombiq UI Testing Toolbox - Orchard Core Features tests, disable File Content Definition feature by default - This week in Orchard (10/12/2021)

The HTTP Response Task now supports the text/html content type, disables the File Content Definition feature by default, prevents confusing usage of IRunningShellTable.Match(HttpContext) and demo about the Orchard Core Features tests in the Lombiq UI Testing Toolbox. Do you want to know more? Then don't forget to check out our current post! Orchard Core updates HTTP Response Task supports "text/html" content type If you are using Workflows in your solution, you have the option to use the HTTP Response task, which writes an HTTP response (to use that task, you need to enable the HTTP Workflows Activities feature). If you are in the editor of your Workflow, you just need to click on the Add Task button and select the HTTP Response from the HTTP category. From now, you will see a new text/html content-type option of the response body, which allows workflow submissions to return web content directly. Don't enable the File Content Definition feature by default in the built-in themes From now the File Content Definition feature will not be enabled by default. This feature is replacing the default behavior to store content type definitions in the database with one that stores the content type definitions in a file in the App_Data folder. Most users prefer to store the content type definitions in the database by default. You can still enable this feature if you prefer your content definitions to be file-based, for instance, if you want them in your source control management. But by default, they will be in the database from now. If you have a distributed theme or site, then you might want it to be in the database by default. And the change is just to remove the feature from the recipes. The corresponding page on the Orchard Core documentation is also updated to inform everybody about the changes. Prevent confusing usage of IRunningShellTable.Match(HttpContext) You could use this extension method with an HttpContext, but it didn't actually work anywhere where you can do it from a module. So, from now this RunningShellTableExtensions is an internal class, because as you can see from the comment there: not public because it wouldn't match tenants with an URL prefix later in the request pipeline. Mostly to be used from ModularTenantContainerMiddleware. Demos Lombiq UI Testing Toolbox - Orchard Core Features tests The Lombiq UI Testing Toolbox is a web UI testing toolbox mostly for Orchard Core applications. Everything you need to do UI testing with Selenium for an Orchard app is here. UI Testing here is an automation that clicks through the web application in a browser. One of the most popular frameworks for that is Selenium, which does exactly that. You get an API to instruct a browser, and every major browser is supported. This UI Testing Toolbox provides a lot of features on top of Selenium for Orchard Core. Basically, allowing you to UI test an Orchard Core application in a safe and parallelized way providing a lot of helpers, a lot of higher-level APIs allowing you to test your application with SQLite, with SQL Server with local media storage, or with Azure Blob Storage. And you can have a test e-mail sending with a local SMTP server too. Everything just works. Check out the highlights of the Readme.md file of this repository to see all of the features and this older This week in Orchard post where you could see a demo about the Toolbox. This time we will focus on the Orchard Core Features tests. The idea here is that you have an Orchard Core application, and you want to do some basic smoke testing, like trial the application whether it works at its very basics. Now, for that, we have created a TestBasicOrchardFeatures extension method, which will run through a couple of tests that you can run individually. For example, testing whether the setup works, testing whether the registration works, testing whether the login works, and so on. All of these are features of Orchard Core itself, so not your custom application, but these are also all things that you can break from your custom code. So, we figured that it's useful to check whether these basic Orchard features work all the time. And for example, if you manage to break set up with your recipe or if you manage to break the login or the registration features from your code like even implementing an event handler that throws an exception, well then these tests should catch them. Do you want to see these tests in action? Well, in that case, you just have to click on the following recording on YouTube! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 235 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 week's Orchard meeting!

Fix Liquid QueryCollection access, renaming page route parameter - This week in Orchard (04/12/2021)

Fixed Liquid QueryCollection access, an interesting bug when using the page route in Razor Pages, and updated libraries used in Orchard Core. Check out our current post to read about the details! Orchard Core updates Pager used the reserved "page" route parameter The bug only happens if you are using Razor Pages at least one razor @page. In that case when you list the items of a given content type e.g. /Admin/Contents/ContentItems/Article?admin=674211458, the Pager links, in place of using our custom pattern /Admin/Contents/ContentItems/Article?admin=674211458&page=2, they use the default pattern where the content type is a query string parameter /Admin/OC.Contents/Admin/List?contentTypeId=Article&admin=...&page=2. At this point, you can still go to a given Pager page. But then if you select a new filter option it removes the above query string contentTypeId parameter e.g. /Admin/Contents/ContentItems?q=status%3APublished. So in place of still listing the items of a specific content type, you go to the list of all content types in place of staying in the list of a specific type. Removing the contentTypeId parameter is another issue filtering should preserve the existing parameters, but here we're only talking about the fact that the Pager links don't use the right custom pattern if at least a Razor @page is defined. This is because the Pager uses a page route parameter to generate link URLs, but this is a reserved ASP .NET Core routing name. The solution is to remove this route value in the ActionLink shape before generating an URL and then explicitly add it as a query string parameter. Currently, as a workaround, there is a custom IShapeTableProvider. So in one sentence, you are not allowed to use page in routes because it's a reserved word because of Razor Pages. And now it has been changed to pagenum everywhere. Fixed Liquid QueryCollection access Let's set up your site using the Agency recipe. That recipe contains a template for the Landing Page content type where we can test the Request.Query Liquid filter easily. If you check out line 19 of this template, you can see that we are using the Request.Query Liquid filter to say, give me the value of the test field from the query string. But how can you use this one? The helper is just about to print the value of the query string by the given field. So, if we open up the predefined Landing Page content item and put something in the query string using the test, you will see the printed value on the page. It's an IQueryCollection whose underlying type is a QueryCollectionInternal, but we only allow access to QueryCollection. Jean-Thierry Kéchichian fixed it by creating a QueryCollection. Updated libraries We have this Libraries page in the Orchard Core documentation that lists the different .NET libraries, the different Client-side libraries, and the different Tests libraries used in Orchard Core. In Orchard Core, the community always tries to use the latest versions of these libraries to make sure you will always get the latest bug fixes and the latest features provided by these libraries. News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 233 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 week's Orchard meeting!

Lombiq Privacy for Orchard Core, Target .NET 6 by default - This week in Orchard (19/11/2021)

New guide to the document, new asset_url Shortcode, targeting .NET 6 by default, and demo about the Lombiq Privacy module for Orchard Core. Do you want to know more? Then don't forget to check out our current post! Orchard Core updates Add [asset_url] shortcode The new asset_url Shortcode can be used to render the image URL only. Let's see a short example for this one. We have a site set up with the Blog recipe, and we decided to create a new blog post. The blog post content type has a MarkDownPart attached that supports using Shortcodes. You can type the [asset_url][/asset_url] by yourself, or just easily click on the Insert Shortcode icon and find the asset_url one in the Media category. Make sure you have some content in your Media Library and enter the file name of the asset. We have an Orchard Core logo at the root of the Media Library with the file name orchard-core-symbol-logo-color.png, so let's use that one.As you can see, if we provide the file name, the asset_url returns the relative URL from the site's media library. You can see we have a tenant here with the name blog1 and the file is in the root folder of the media library. If you would like to know more, head to this page of the Orchard Core documentation, where you can read about the parameters that you can use with this Shortcode. New how-to guide: creating the pieces needed to query content based on assigned taxonomies If you head to this page on the Orchard Core documentation, you will find a new guide for creating a query that allows searching across multiple assigned taxonomies. At the end of the guide, you will have the pieces needed to search through blogs to find only the ones with specific tags assigned. Target .NET 6 by default .NET 6 was released on the 8th of November and the community already updated Orchard Core to use .NET 6 by default. So, the main branch targets .NET 6 by default which means if you clone that branch, you will need to have the .NET 6 SDK. If you go to dotnet.microsoft.com, you can easily download the latest SDK. Orchard Core now also builds and runs the tests using .NET 6. The targets are defined in the CommonTargetFrameworks of the Dependencies.AspNetCore.props file, where you will see .NET 6, .NET 5 and .NET Core 3.1. By default, if you open Visual Studio, it will target .NET 6, but when you build on the command line, you can define which target you want. So, if you want to publish a self-contained, you can do --framework and provide the framework you want or change the value of the DefaultTargetFramework property. The same applies to the Docker deployments. And one reminder: if you are using Visual Studio and want to use .NET 6, you will need to download Visual Studio 2022 because Visual Studio 2019 has no support for .NET 6. Demos Lombiq Privacy for Orchard Core The Lombiq Privacy for Orchard Core is an Orchard Core module containing features related to data protection/privacy and the EU law on it, the General Data Protection Regulation (GDPR). In this demo, we will go with the quicker way and use our Open-Source Orchard Core Extensions full Orchard Core solution that contains that module. If you clone that repository and set up your site using any setup recipe, let's just navigate to the admin UI of Orchard Core, and under Configuration -> Features, enable the following features: Lombiq Privacy - Consent banner that adds the ability to show a privacy consent banner. Lombiq Privacy - Form consent that provides the Privacy Consent Checkbox widget that can be used on any form. Lombiq Privacy - Registration consent that adds a privacy consent checkbox to the registration form. Now, if you navigate to Configuration -> Settings, you will find three new options there: Privacy Consent Banner Settings, Privacy Consent Checkbox Settings, and Privacy Registration Consent Settings. If you click on the Privacy Consent Banner Settings, you will find a simple editor with Liquid support, where you can set the content of the consent banner. By using the consent banner feature, users can accept the privacy policy. If the user is unauthenticated, they can use the banner to accept or reject the privacy statement, their decision will be stored in a cookie by the browser. If the user is authenticated, their only option is to accept the privacy policy via the banner. This is so because it is assumed that during registration, they already accepted a suitable privacy policy, it's just that the Lombiq Privacy module or something similar wasn't used at the time. Another new option here is the Privacy Registration Consent Checkbox Settings. The Registration Consent Feature shows a privacy consent checkbox on the registration form that needs to be checked by the users to be able to register. After registration, the user's consent is stored in the PrivacyConsent section of the user's properties. Here you can define the label of the checkbox. And the last one is the Form Consent Feature which adds a new Privacy Consent Checkbox widget content type that can be added to forms with the Forms module. In this case, users must accept the privacy policy before they can post content to the site. You can validate the consent with the Validate Privacy Consent Checkbox workflow activity. The way of how to do it can be seen in this Contact Form submitted workflow. When we get an incoming POST request, we check the validity of the Privacy Consent Checkbox, and based on the result, we redirect the user to different URLs. And if you check out the editor of the Page content type which has a Flow Part attached, you can see we added a Form widget there, and inside the Form, we placed our Privacy Consent Checkbox widget. And as usual, if you would like to know more about this new module, head to YouTube for a recording! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 231 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 week's Orchard meeting!