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

Featured tags

IIS
API
SMS
SEO
All tags >

Orchard Core 1.2 release, Background Jobs - This week in Orchard (14/01/2022)

We are thrilled to announce that Orchard Core 1.2 is now available! Check out this post to know the latest features of this release of Orchard Core and see a demo about an upcoming feature to have a jobs queue for scheduling! Let's get started! Orchard Core updates Support data annotations PO localization This feature is about to be able to localize data annotations. Let's say you have a required field and you would like to save your form without providing any value for that field. In this case, you will get a validation error of course something like: The {fieldname} field is required. And from now you can easily translate the default error messages for data annotations attributes. If you open up the DataAnnotationsDefaultErrorMessages sealed class, you will find the default error messages that you can translate. But how can you translate these? In your PO file, you have to target the DataAnnotationsDefaultErrorMessages marker class, provide the value of the variable that you want to translate (msgid), and provide the translated text after the msgstr keyword, which is the Arabic version in this case. In the following GIF, Hisham Bin Ateya shows you the given scenario mentioned above by using the Arabic translation for a required field. Code cleanup For C# code files, Visual Studio 2022 has a Code Cleanup button at the bottom of the editor (keyboard: Ctrl+K, Ctrl+E) to apply code styles from an EditorConfig file or the Code Style options page. If a .editorconfig file exists for the project, those are the settings that take precedence. After you've configured code cleanup, you can either click on the broom icon or press Ctrl+K, Ctrl+E to run code cleanup. You can also run code cleanup across your entire project or solution. Right-click on the project or solution name in Solution Explorer, select Analyze and Code Cleanup, and then select Run Code Cleanup. For more information about code style, check out this page. The codebase of Orchard Core got this cleanup, which means 312 file changes in this PR. And if you would like your code to be nicer, check out the Lombiq.NET Analyzers repository. Our Lombiq .NET Analyzers repository contains .NET code analyzers and code convention settings for Lombiq projects. We also had a demo about the analyzers in This week in Orchard post! Fix index cursors management When there are hundreds of thousands of rows the results returned by QueryIndex() may not be ordered by Id by default. In that case, services as AutorouteEntries using an index cursor on the Id column are not working properly, the _lastIndexId being not well managed. In this case when first publishing an item having an Autoroute, in place of only adding one Autoroute entry, it was trying to add thousands of them in an unordered way and was taking a very long time. Jean-Thierry Kéchichian also enhances the lookup of Autoroute entries to evict, the ones related to contained items of a given container. Demos Background Jobs Orchard Core has a background task infrastructure that runs tasks on a minute-by-minute schedule on a CRON job. But it doesn't actually allow us to have a queue where we can put jobs into a queue. This demo is about an upcoming feature to have a jobs queue for scheduling. In this demo (to show you this feature), Dean Marcussen used the Publish Later feature of Orchard Core to keep track of the background jobs, and by running a scheduler, you can run the Publish Later Job immediately without the need of waiting for the given time to be elapsed. Watch this recording on YouTube to know more about this upcoming feature! News from the community Orchard Core 1.2 release Orchard Core 1.2 is released! 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! Upgrade your solution to 1.2 now! If you head to the repository of Orchard Core and head to releases, you will find the 1.2.0 release with the list of changes and the contributors. Feel free to drop on the dedicated Gitter chat or use the Discussions on GitHub and ask questions! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 236 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!

Fluid updates, Better NRE handling for Widget and MenuItem stereotypes - This week in Orchard (07/01/2022)

Topics for this week are the Fluid updates; better NRE handling for Widget and MenuItem stereotypes; allowing sending emails without "To" if "Cc" or "Bcc" is provided. Do you want to know more? Then check out our post now! Orchard Core updates Allow sending emails without "To" if "CC" or "BCC" is provided Let's say you have a system to send emails to many recipients at once and want the recipients to be in the BCC header instead of the To one. The email module of Orchard Core was required to have at least one recipient in the To header, so, the scenario described above cannot be implemented in Orchard Core. The solution for this is that now you can send an email without a recipient in the To header. The mail message should have at least one of these headers: To, CC or BCC. Here you can see the editor of the Send Email task where we provided an email address for the BCC header but kept the To and the CC headers empty. Fluid v2.2.8 In Liquid, you can have an identifier that starts with a number like: {% assign 1st = "first" %} {{ 1st }} It was not easy to parse, but now Fluid supports this one with version 2.2.8. And just a note here. If you navigate to the Liquid Sandbox of Jumpseller, you can find a sandbox that is using Liquid but in Ruby, which is the actual implementation of Liquid. You can use LiquidJs to test, but that is a custom implementation in JavaScript, so it might not be as true as the Ruby implementation. Better NRE handling for Widget and MenuItem stereotypes As you may guess, the NRE handling is about catching the null reference exceptions and showing proper error messages instead of displaying the "An error occurred while executing this request.". What were those errors? For example, follow these steps: Create a new content type with stereotype = MenuItem. Add a menu item of that type to a menu. Delete the content type created in step 1. Go back to the menu you created in step 2. Observe a Null Reference Exception. Here we created a new content type with the MenuItem stereotype called NewContentType. The site that we are using was set up by using the Blog recipe, so we have the Main Menu admin menu where we can easily add menu items by just clicking on the Add Menu Item button. And if we delete the NewContentType and navigate back to the Main Menu, we will see the following messages instead. News from the community Lombiq's Open-Source Orchard Core Extensions now updated to Orchard Core v1.1 Looking for some useful Orchard Core extensions? Here's a bundle solution of all of Lombiq's open-source Orchard Core extensions (modules and themes). Clone and try them out! 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. Please keep in mind that only those extensions are included which use the latest released version of Orchard (i.e. the very cutting-edge ones depending on a nightly build are not yet here). And this project, with all of our Orchard-related projects, is now updated to Orchard Core v1.1! Check it out here! 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!

Statically typed URL creation, fix CSS intermittent encoding issue - This week in Orchard (22/12/2021)

Updating the Correlate Task, fixing CSS intermittent encoding issue and a demo about statically typed URL creation! Do you want to know more? Then check out our last post of this year! Orchard Core updates Fix Correlate Task If you have Workflows enabled in your solution, you have the option to add a Correlate Task to it. The hint is saying that it supports Liquid, but the truth is the parser here supports JavaScript, not Liquid. So, the solution here is to update the wording of the hint. And from now, if you would like to provide the value for your Correlate Task, you can use a Monaco editor here. Fix CSS intermittent encoding issue The cache on the browser was serving the CSS files using differently than UTF-8. When you disabled the cache on the browser it was fine. So, the cache is storing it as ASCII and not UTF-8. If you check out the picture below, you can see some weird characters on the screen. So, the problem here was a charset issue because browsers can handle different charsets if you put the information at the top of the file. But some of the stylesheets of Orchard Core were started with some comments and not with the line which is saying the given charset. And it looks like browsers only include the charset if it's in the first line of the stylesheet. So, the headers for the stylesheets are not injected anymore. Demos Statically typed URL creation The Lombiq Helpful Libraries for Orchard Core contains various libraries that can be handy when developing for Orchard Core CMS, to be used from your own Orchard modules. The Helpful Libraries now has a new class called TypedRoute which provides a strongly typed way to generate local URLs for Orchard Core MVC actions. It uses lambda expressions to select the action and provide arguments. Use TypedRoute.CreateFromExpression<TClass>(...).ToString() or the provided OrchardHelper.Action() and HttpContext.Action() extensions. Let's see this in action! 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 with a nice sample. 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 Lombiq Helpful Libraries for Orchard Core - Samples feature. Now, head to the /Lombiq.HelpfulLibraries.Samples/TypedRoute/Index URL to see the content of the following Razor file. As you can see, we constructed the first URL by using the anchor tag helper from ASP.NET Core. Here we needed to pass the area, the name of the controller, and the action and put the names of the accepted properties by the controller action by using the asp-route- prefix. If you use the extension, you can statically enter the controller name (TypedRouteController in this case) and using lambda you can select the TypedRouteSample action by passing the values you want. In this way, you can safely rename the controller or the action without breaking any functionality in your Razor file, because Visual Studio and Rider will also be able to find the references in your Razor files too. Do you want to know more and look under the hood of this feature? Well, you just need to check out this short presentation on YouTube! News from the community Christmas in Lombiq Sometimes we do stuff. Together. Not (just) in front of computer screens. These are some usual events in Lombiq that are all announced and arranged in advance. We periodically have an event called RnDay: this is a few hours long event where we share with each other what we recently worked on and what we plan to do. E.g. if we recently finished a project then the project's team members demo what they've done. This week we had our last RnDay for this year but this time (again), we have to make it online. We also named this event The 14th RnDay - Pandemic Edition 2! We also tried to do our best to make a nice group photo, you can see the result down below. :) We would like to thank you all for reading our posts and making the Orchard community stronger together with us! We hope that we could give you valuable news and demos about the happenings around Orchard and Orchard Core from time to time by reading our posts and of course the This week in Orchard newsletter. We would like to wish everyone a Merry Christmas and a Happy New Year! See you next year! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 234 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!

Updates on Fluid, Antebellum, a new site using Orchard Core - This week in Orchard (16/12/2021)

This time we will do a deep dive and will check out some important updates on Fluid. But before doing that, let's see some important changes of Orchard Core like preserving contained content items IDs or using async write/read of the Request.Body. Oh, and did we mention the brand new Orchard Core site, Antebellum? Orchard Core updates Preserve contained content items IDs Orchard Core has a feature to have content item IDs on Bag Parts be persistent (i.e., not change), which was implemented in this pull request. However, there was a bug. The "Bag Part Content Item ID" isn't persisted. And it was easy to reproduce. You just need to make a parent content type with a child content type like so: Then you just need to add in a Parent with a couple of children and publish it to get this result (it is outputting the child content item IDs): But every time you published the Parent Content Item, the child content item IDs changed: The fix was to use a dedicated Content Items array to hold the IDs. It prevents conflicts when removing (or moving to another container), and then adding an item, by computing indexes differently when adding an item, was based on the number of items + 1, now based on the existing max value + 1. And Jean-Thierry Kéchichian also fixes other little issues when dragging between containers more than one level up/down. Async write/read of the Request.Body is mandatory There was an issue in Orchard Core when you are using ReadToEnd() in the Request.Body. Using an async method is mandatory even if we use it synchronously by using GetAwaiter(). This is a behavior from ASP.NET which is toggleable, but we use the default in this case. Updates on Fluid Let's say you have an array and you would like to do a reverse. The following code is not a valid Liquid, that's just to present the given logic. Doing reverse in an array like: [1,2,3] | reverse => [3,2,1] will reverse the array. If you use reverse with a string like "1,2,3" you would expect to get "3,2,1". But what it was giving you is a string, but it should give you an array with ["3", "2", "1"]. So, the reverse has been fixed in two ways. First, fixing the behavior on strings and then also returning an array instead of a string. So, it's not obvious, not expected from that. If you want to suggest Liquid features, you can use LiquidJS.com, and then you can try something like that. The retuning value here 3,2,1 is an array actually (the site serializes it and displays it as a string). Another good tool is .NET Fiddle, where you can reference a NuGet package and can work with Liquid. It requires some more work, so using LiquidJS to try out Liquid is an easier way. Another improvement is there is a new render tag. Usually, you can use the input tag to load an external Liquid file. This input tag has been obsoleted by the Shopify team because it has security issues in a way that when you run a partial template from this input tag, it can access all the variables from the calling templates. The new render tag in Fluid now doesn't have this issue. It works exactly the same as input with the same parameters, but you can only access the properties, that have been set on the tag itself, or the variables that are defined in the global scope. There are actually some interesting ways to use that. You can write {% include 'foo' %}, and it will try to render the foo.liquid file. And when you do that, inside the foo.liquid, the foo property is the global scope. You can also do {% include 'foo' a:1, b:2 %} and than in this case foo.a, foo.b will have the values. You can also write {% include 'foo' as model %} and then the properties will be available under the modal property. Fluid v.2.2.4 is fixing first, last, and size. It means you can do the following that can be seen on the screen below. In Fluid, these properties were implemented specifically in all the values, but you can also use pipes to do the same thing. The issue is there were two different invertations ,but the standard says this should be the same thing. So, calling | first now is equivalent to do .first. This means any of your objects can implement these filters by just intercepting the property name. Fluid v2.2.5 contains the new liquid and echo tags. The echo tag can be used in this way: {% echo "foo" %}. The idea of the echo tag is that it's equivalent to the injection tag like this: {{ "foo" }}. The liquid tag is just to execute liquid. What you can do with that is you can run liquid like: {% liquid for x in 1..10 echo x endfor%} which is equivalent to {% for x in 1..10 %} {{ x }}{% endfor %} but as you can see, the first one is less verbose, you don't have to add all the curly braces and the percentage sign everywhere. It's just one block, and you can also nest them. Demos A new website using Orchard Core: Antebellum Antebellum provides a way for the everyday person to mine crypto, without the need of buying expensive hardware, consuming high electricity, high cost in cooling, maintenance of hardware, and sudden downtime. The site contains several custom pages, like the Sign Up page, which is actually using a workflow to do the user registration that also has an integration with Stripe.js. Stripe.js is a JavaScript library that you can wire into your checkout form to handle the credit card information. When a user signs up using the checkout form, it sends the credit card information directly from the user's browser to Stripe's servers. Just head to YouTube to see how the Sign Up page was built or how can you make a nice custom admin UI like that you can see in the video one in Orchard Core! If you are interested in more websites using Orchard and Orchard Core, don't forget to visit Show Orchard. Show Orchard is a website for showing representative Orchard CMS (and now Orchard Core) websites all around the internet. It was started by Ryan Drew Burnett, but since he doesn't work with Orchard anymore, as announced earlier it is now maintained by our team at Lombiq Technologies. News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 234 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!

Cache Failover and Shared options, YesSql updates - This week in Orchard (26/11/2021)

Huge YesSql updates, new cache failover and shared options, Media Library improvements, and a new site running on Orchard Core! Do you want to know more? Then don't forget to check out our current post! Orchard Core updates YesSql updates YesSql has updates for the following drivers: MySqlConnector 2.0, Npgsql 6.0, Microsoft.Data.Sqlite 6.0. The Npgsql 6.0 has breaking changes in terms of date and time serialization. The breaking change is in the way it handles time stamps and date-time storage and the type of column that it stores them into. The Microsoft.Data.Sqlite is on 6.0, which contains the SQLite Connection Pooling, so it's pooling SQLite connections now. If we check out the benchmarks for MVC, where Orchard is one of them, and it's running the About page on SQLite, and you can see that on both Windows and Linux it goes up from around 5000 requests per second to 16000 requests per second and also the latency went down. Removed beforeFolderAdded to stop multiple calls to fetch folders When you click OK on the new Media Folder name dialog, the first thing it does after creating the new folder emits beforeFolderAdded which loads the folder we are currently on. Then it emits the folderAdded, which selects the new folder (triggering a load of the new folder through the watcher). It appears that both requests are in flight at the same time, and we are seeing that occasionally the beforeFolderAdded request comes in last and then makes it appear as if the new folder has all the contents of the previously selected folder. bus.$on('addFolder', function (target, folder) { if (self.model == target) {bus.$emit('beforeFolderAdded', self.model); if (self.children !== null) { self.children.push(folder); } folder.parent = self.model; bus.$emit('folderAdded', folder); }}); So, when we create a folder, we fire the beforeFolderAdded then folderAdded both of which load contents of a folder, but there is no guarantee on the order these calls will resolve in. Occasionally, we are seeing the first call to the original folder come in second, and the new folder appears to be populated with images already. Cache Failover and Shared options Sometimes the Redis server is not available because there could be timeouts for example. What do you serve when Redis is down, and it's part of your system. Do you serve something or just wait and try again? You could say that if the cache fails then go to the database and return something from there. But at the same time, it can also be dangerous because you could expose yourself to put your site down. If you expect not to do a lot of database stuff because you have a caching layer, you can put your site down. The DefaultDynamicCacheService uses the IMemoryCache to at least prevent something if Redis is down. For example, cache the id of a requested document locally so that the memory cache is used during the FailoverRetryLatency, which is a configuration value that has a 30 seconds value by default. News from the community Dixin's Blog is running on Orchard Core If you navigate to https://weblogs.asp.net/dixin, you will find a blog that contains several interesting posts about .NET, Windows, and many more. The site is using Orchard Core, and as you may notice, it's very fast, no matter how much content it has on it. Lombiq Gulp Extensions with Stylelint Our Gulp Extensions project now also provides Sass SCSS linting with Stylelint! To use it in your Gulp JS SCSS build pipeline, just configure the corresponding SCSS targets Gulp task. Read more about how you can do that here! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 232 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!

Feature profiles deployment plans and recipes, Support ordering in list_items Liquid filter - This week in Orchard (13/11/2021)

Feature profiles deployment plans and recipes, Audit Trail updates, support ordering in list_items Liquid filter, and many more coming this week! Do you want to know more? Then don't forget to check out our current post! Orchard Core updates Feature profiles deployment steps and recipes The Feature Profiles is about adding the ability to restrict the features and/or themes that are available to either a tenant and/or all tenants or a mix of both. If you haven't heard about that feature yet, check out this post with a great demo! This time you will see that now you can export and import your existing Feature Profiles. Let's assume that we have already created two Tenant Feature Profiles. To do that, you have to enable the Tenants and the Tenant Feature Profiles feature under Configuration -> Features and add Feature Profiles under Configuration -> Tenant Feature Profiles. Now you can go to Configuration -> Import/Export and add a new deployment plan. If you click on the Add Step button and search for the feature keyword, you will find a new one, called All Feature Profiles. Choose this one and execute the plan by downloading the given zip file to the computer. If you check out the Recipe.json file inside the zip, you will see a step called FeatureProfiles which contains the available feature profiles that we have already created: restricted profile and restricted agency theme. Fix Audit Trail date parsing The Audit Trail module has a huge update this summer where the UI had been totally changed, and the feature had some new stuff too, like the improved search filters. In this post, we had a detailed description of everything you may need to know about the improvements of the Audit Trail module. When you open up the Audit Trail module, you can find a funnel icon. If you click on the funnel icon before the search box and select the Filter Syntax one, you will see a modal window that shows you the available filters. This modal describes all the registered filters that you can use with the given properties. It also shows you the current values of the given filters and a little bit of information about the syntax. And then down the bottom, you just get the current filter and the normalized version of it which describes how it's being constructed. When working with dates, you have several options, like date:>2021-11-08, which means give me all of the events that happened after the 8th of November this year. Or you can say date:>=2021-11-08 to get all of the events that happened after the 7th of November this year. There was a minor bug in the DateTimeParser when it splits the operators. The OneOf() method builds a parser that returns either of the first success of the specified parsers. And the first one was the > operator, which means if you wrote >= for example, the parser used the > operator because it was defined earlier than the >=. The same goes for < and <=. Fix ambiguity in search form settings If you go to Search -> Settings -> Search on the admin UI of Orchard Core, you will see that the Default search index drop-down has a value to use for the search page. But this doesn't mean that the given index is the default one. Here you see a value, but it's not set it's just the first item in the drop-down. Now there is a new Select a search index option in the drop-down that will alert the user about there is no default index to use for the search page. Demos Support ordering in list_items Liquid filter We have a list_items Liquid filter which loads published content items for a given content item object or explicit Content Item id given as a string in a list. You can see a nice demo about how to make lists sortable with ordering setting here. This time this demo is just about showing you that now if you use the list_items Liquid filter with a ListPart where the ordering is enabled, the filter returns the list items in the expected order. The code changes are in the ListItemsFilter class (which is the implementation of the list_items Liquid filter), where you can see that we get the ListPartSettings by using the IContentDefinitionManager. If the ordering is enabled for that ListPart we pass the bool value to the QueryListItemsAsync method. That method is just containing a query that returns the content items of the given list. The change here is to order the content items by the ListContentItemId if the partPredicate value is true, which will be true if the ordering of the given ListPart is set to true. You can find the code in the following PR and as always, if you would like to know more, head to YouTube for a recording! News from the community A new website using Orchard Core: eRED Real estate and development The eRED Real estate and development site has been developed by one of the contributors of Orchard Core, Sotiris Roussos. Check out this brand new Orchard Core site here! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 232 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!

Sitemap deployment plans and recipes, Device Preview module - This week in Orchard (04/11/2021)

Sitemap deployment plans and recipes, improve reset password email experience, a new Device Preview module, and many more coming this week! Do you want to know more? Then don't forget to check out our current post! Orchard Core updates Sitemap deployment plans and recipes A sitemap is a file where you provide information about the pages, videos, and other files on your site, and the relationships between them. Search engines like Google read this file to more intelligently crawl your site. A sitemap tells the crawler which files you think are important in your site, and also provides valuable information about these files: for example, for pages, when the page was last updated, how often the page is changed, and any alternate language versions of a page. You can learn more about that module in this post where you can also see a demo of the feature. Let's assume that we have already created a sitemap that contains the blog posts of the site. Now let's navigate to Configuration -> Import/Export -> Deployment Plans and create a new deployment plan. If you add a new deployment step to your plan you will see a new plan, called All Sitemaps. Choose this one and execute the plan by downloading the given zip file to the computer. If you check out the Recipe.json file inside the zip, you will see a step called Sitemaps which contains the sitemap and the sitemap index itself. Improve reset password email experience You can allow users to reset their passwords. If they do that, they will get an email with a link that allows resetting the password. To prevent any misusage, the wording of that email has been changed like "Someone recently requested a password reset" instead of "Dear user" and "if you did not request a password reset, please ignore this email." Fix user picker field ordering We have a field in Orchard Core called the user picker field, which field allows you to connect users with a content item. If you haven't heard about that field yet, check out this post with a nice demo. If you edit the content definition of the user picker field, you can allow multiple elements to be selected and allow the picker to display users from multiple roles. There was an issue when the user picker resets the order of selected users when saving because it comes back in database order. Now, if you add multiple users to the user picker field and hit save, the system will keep the ordering of the users. News from the community Device Preview module This repository contains premium modules for the Orchard Core CMS. The Device Preview module in this repository adds a live preview to your production-ready pages on different devices. It previews your content in various form factors and tests without leaving the content editor screen. The Device Preview module enables live content preview on Smartphones, Tablets, Laptops, and Desktops.The Readme.MD file of the module contains some lines on how you can add this module to your solution and how to include it in your recipe to enable the feature by default. New Lombiq team member: Bálint Aracsi Please welcome our new Orchard Core developer colleague, Bálint Aracsi! See his full bio here, where you can find out which part of IT he likes most, and the color of his toothbrush :)! You can check out his full bio here! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 232 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!