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

Featured tags

IIS
API
All tags >

Orchard Core 1.8, add a way to provide a custom Elasticsearch query - This week in Orchard (12/01/2024)

We are thrilled to announce that Orchard Core 1.8 is now available! Check out this post to know everything about the latest release of Orchard Core. In the upcoming weeks, we will check out the newest features and additions of Orchard Core 1.8. Let's get started! Orchard Core updates Fix an exception when creating content type without any content part Let's assume the scenario where you create a new content type with a name but you are not adding any content parts to it. If you hit Save without any added content parts, you will get a NullReferenceException. The fix here is to check if the partNames array is null. The same check applies to the fieldNames array as well. Add a way to provide a custom Elasticsearch query In the search module, the only available option to conduct a search is using query-string or multi-match query by providing a list of default fields to search. What if we want to customize the query, for example, by using fuzziness or other options? Currently, there is no simple way to configure the default search to use advanced search options. This is a new feature such that you can define what is sent to Elasticsearch when you type some terms in the search box. As you can see in the following screencast; you can define the following custom query to perform advanced operations like fuzziness. { "query": { "match": { "Content.ContentItem.FullText": { "query": "{{ term }}", "fuzziness": "AUTO", "analyzer": "whitespace" } } }} The documentation page of the Elasticsearch module has also been updated, and the example for setting the default search settings accepts a SearchType option where you can use 'custom' for a custom query in DefaultQuery and 'query_string' for a Query String Query search. Leave it blank for the default, which is a Multi-Match Query search. News from the community Orchard Core 1.8 and Orchard Core 1.8.1 The community recently released the latest 1.8 version of Orchard Core with several new features and additions! In this update, we've introduced several significant changes that may require your attention before upgrading. Additionally, performance-related enhancements have been implemented to optimize your app's scalability, especially when dealing with a large number of tenants. The Admin Theme was upgraded to Bootstrap 5, and from now on, the theme mode is set to auto, which allows us to use the default device color preference, which could be dark or light. A new option for restarting a specific Workflow instance has been incorporated, involving adjustments to both the IActivity and IWorkflowManager interfaces, and the HTTP error views are now in the form of shapes. The upper navigation bar has been transformed into a customizable shape (Navbar shape), allowing for easy integration of items. As an enhancement for the Elasticssearch feature, we introduced a new option that permits the definition of a custom query for the default search. And we have a lot more to cover! Here are all the details of the release. Note that this release removes support for net6.0 and net7.0. Only net8.0 is supported. Orchard Core 1.8.1 was released a few days after the 1.8 one to address some issues of the 1.8 release. 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.8.1 now! Feel free to drop on the dedicated Gitter chat or use the Discussions on GitHub and ask questions! As we mentioned, Orchard Core is available as a NuGet package which you can easily add to your ASP.NET Core solution. Here's how you can get started with Orchard Core. Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 480 subscribers! We have started this newsletter to inform the community around Orchard of the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post is published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news about Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting!

Google Service improvements, Lombiq Content Editors for Orchard Core - This week in Orchard (07/07/2023)

Fix Google Service dependencies and include Google Analytics and Tag Manager when the user consents. This week's demo is about the new Lombiq Content Editors for the Orchard Core module! Check out our post for the details! Orchard Core updates Fix Google Service dependencies Google Tag Manager (GTM) is a bridge/middle-man service, that would allow you to enable other services like Google Analytics on your website. So, if you have GTM installed on your website, you can use the GTM portal to enable Google Analytics using the Measurement ID. You can also enable Google Analytics without the use of GMT if you want. The two features OrchardCore.Google.TagManager and OrchardCore.Google.Analytics should not depend on each other as one should enable either. If you enable the Google Tag Manager feature by navigating to Configuration -> Features, you will find a new option under Configuration -> Settings. It is called Google Tag Manager, where you can specify the container ID defined in your Google Tag Manager account. Include Google Analytics and Tag Manager when the user consents And while we are talking about Google-related services, let's check out another improvement regarding Google-related services! The Google Analytics feature always includes the Google Analytics tracking script in GoogleAnalyticsFilter. Instead, it should only include this if the user gave consent to tracking otherwise, it's a legal risk under GDPR for EU companies. Potentially something similar for websites run by other entities around the world too. Fortunately, the built-in ASP.NET Core feature can be used for this, just by adding the below check to GoogleAnalyticsFilter. Demos Lombiq Content Editors for Orchard Core This time we will check out the Lombiq Content Editors for Orchard Core module. This feature was originally built for Orchard 1 a couple of years ago, and it contained a lot of interesting features for advanced content editing, including async editors, which we will focus on today. It was a closed-source module of Lombiq, and this is the rewritten version of that for Orchard Core. As we mentioned, the primary feature of this module is the Async Editor feature, which we already used when we built the License Request form for Smithsonian Folkways Recordings. We wrote a blog post about how we upgraded that site to Orchard Core, and you can also check out a demo video of the app and our experiences developing it here. So, the Async Editor feature of this module provides an infrastructure for creating editors that can load and save content asynchronously. The editor can optionally render multiple pages where each page can load and save data independently. To demonstrate this feature, we will utilize our Open-Source Orchard Core Extensions solution that contains most of Lombiq's open-source Orchard modules and themes, as well as related utilities and libraries. Last week we mentioned that this solution has been updated to the latest and greatest 1.6 Orchard Core version. If you clone this repository and set up your site using the TEST: Lombiq's Open-Source Orchard Core Extensions recipe, the Lombiq Content Editors - Samples feature will be enabled by default which - of course - contains samples for Lombiq Content Editors. Meaning that if you click on the Employee (admin) option from the Content Editors Samples drop-down menu after your site has been set up, you will be redirected to the admin UI of Orchard Core, where you will see an editor of the Employee content item. To be more precise, this is the first editor group (PersonalDetails) of this content item. If you fill out the first group and click Save and Next, it will post the form to the API and won't reload the page. The backend will validate the form, and then if everything goes right, it will show you the HTML code of the next editor group and load it to the editor. Once you click on the Submit button on the second editor group, the editor will publish the content item. You can see the editor groups with a nice name (Personal Details, Employment Details), which provides some pagination to you as well, so you can go back and forth by clicking on these. And of course, you can utilize the async editors on the front end as well, and a good example of that is the License Request form for Smithsonian Folkways Recordings that we have just mentioned. If you would like to know more about this feature, check out this video on YouTube where you can see some code as well. And don't forget to check out the samples module too, where you can find the code of the previously mentioned editor with tons of comments about how you can utilize this async editor in your own Orchard Core site! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 471 subscribers! We have started this newsletter to inform the community around Orchard of the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post is published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news about Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting!

Add AlterAsync for a named part, Transliteration Feature - This week in Orchard (14/04/2023)

Add AlterAsync for a named part, updating documentation to use Program.cs instead of Startup.cs, and a demo about the Transliteration Feature! Check out our post for the details! Orchard Core updates Updating documentation to use Program.cs instead of Startup.cs Within .NET 6, Startup.cs has been sunsetted. In the new world, it is still possible to use a Startup.cs, however, it is not a mandatory class anymore. This means when upgrading, you do not need to do anything if you wish so. However, if you want your code to use some of the latest framework features, you will need to perform some refactoring by munging the two files together. And now, the documentation for Orchard Core has been updated with new code samples to show you how to register Orchard CMS service in your Program.cs file when creating a new ASP.NET Core Web Application using Visual Studio. Add AlterAsync for a named part There is an Alter extension method in Orchard Core that you can use to modify a new or existing content element by name. But the awaitable AlterAsync was missing from ContentExtensions. Now you will find an AlterAsync extension method that supports named parts like Alter. Demos Transliteration Feature Transliteration helps us to pronounce words in another language whereas translation gives us the meaning of words. Transliteration changes the words from one language or alphabet into another corresponding, with similar-sounding letters with different characters. So, for this demo, we will clone the following GitHub repository, which contains a set of modules for Orchard Core CMS that is driven by community members who love Orchard Core. This will encourage all the passionate developers to build modules that aren't included in Orchard Core. Such modules may be necessary for the community or essential for any sort of CMS. The module that enables transliteration using the default implementation of the ITransliterationService service is called the Transliteration feature. If you run this solution and enter the admin site using the admin username and admin@OCC123 password, you can navigate to Configuration -> Features. Search for the "transliteration" word to enable the Transliteration feature. Now you can inject the ITransliterationService, then use Transliterate() method to transliterate from one script to another. Here you can see we injected the ITransliterationService and passed the script and the text itself which we wanted to transliterate. There is a DefaultTransliterateRuleProvider that supports converting Cyrillic and Arabic letters to Latin. Meaning that in our example, we wanted to convert a Cyrillic text to Latin. Let's run the solution and check out the content of this page! And as you can see, we wrote "Welcome to Orchard Core" and "Feel free to browse the menu and discover all its possibilities" two times here. For the first time, we used Latin letters, and for the second time, we used Cyrillic letters. And by using the TransliterationService, the Cyrillic letters were converted to Latin. And as always, if you would like to learn more about this module, don't forget to check out this recording on YouTube! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 435 subscribers! We have started this newsletter to inform the community around Orchard of the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post is published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news about Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting!

Add new permission to allow editing content owner, add new GetAsync extension - This week in Orchard (17/03/2023)

Updating Workflows documentation, adding new permission to allow editing content owner, and adding new GetAsync extension. Interested in the details? Well, then check out our post for the details! Orchard Core updates Update Workflows docs Let's say you have a workflow event (implemented EventActivity), and you want to print a property value using Liquid when using a for loop like this: <h4>Here is the responses</h4><ul> {% for item in Workflow.Input["ThresholdSummaries"] %} <li>The response to '{{ item.Title }}' was '{{ item.Respond }}' while threshold is '{{ item.Threshold }}'</li> {% endfor %}</ul> However, the notification replaces {{ item.Title }}, {{ item.Respond }}, and {{ item.Threshold }} by empty string instead of the actual value. The reason for that is from memory, you need to define a Liquid MemberAccessStrategy for this custom type to allow its properties to be accessed. The Orchard Core documentation has been updated to describe how you can trigger a custom event activity and register a member access strategy if you are looking to use Liquid to access the member of a custom object. Add new permission to allow editing content owner Currently, SiteOwner permission is required to be able to see/edit the Common Part info like the owner. Let's say you want to allow a moderator to change the owner of a specific content type. Currently, there is no way to do that without granting moderators SiteOwner which isn't acceptable. From now on, we have EditContentOwner and EditContentOwner_{} permission to control who can edit the owner of a content item when Common Part is attached. Let's see this quickly in action! Here we assume that you set up your site using the Blog recipe. First of all, we have to make sure that we are logged in with a user who has permission "Edit the owner of a content item permission". If you check out the permissions of the Administrator role, you will see that users within this role have this permission by default. Now, we will modify the content definition of the Blog Post content type a little bit, and attach the Common Part to it. We can do it under Content -> Content Definition -> Content Types where we need to hit the Edit button near the Blog Post. After that, we can simply add the Common Part to the Blog Post. Before finalizing editing the content definition, don't forget to edit the Common Part settings and put a tick into the "Display owner editor" checkbox. It's time to see the result of our work! We have one predefined blog post on the site, so we will edit that one. And as you can see, the first textbox here is the one called Owner (we can move this textbox anywhere of course) with the value "admin". That's because the username of our super user is "admin" and we set up the site with this user. And of course, now you can modify the owner user of this content item. But don't forget, here you have to provide the user's name of an existing user. In the following screen, we tried to change the owner to "admin2" but we faced an error because we don't have a user with that user name in our system. Add new GetAsync extension Currently, we have GetAsync(IEnumerable<string> contentItemIds, bool latest = false) and GetAsync(string contentItemId, VersionOptions options) but not GetAsync(IEnumerable<string> contentItemIds, VersionOptions options). When doing a bulk update, it is much more helpful to use GetAsync(IEnumerable<string> contentItemIds, VersionOptions options) than GetAsync(IEnumerable<string> contentItemIds, bool latest = false) if we want to get multiple VersionOptions.DraftRequired, not just the latest. And here you can see the new GetAsync method, which accepts the contentItemIds and the VersionOptions! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 412 subscribers! We have started this newsletter to inform the community around Orchard of the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post is published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who you think would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news about Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting!

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

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

Add a way to retrieve a UTC now DateTime in Liquid, Responsive Admin Theme - This week in Orchard (04/11/2022)

Add a way to retrieve a UTC now DateTime in Liquid, change the Query Schema editor to Monaco Editor, allowing multiple INavigationManager, and a demo about the responsive Admin Theme! Let's get started! Orchard Core updates Add a way to retrieve a UTC now DateTime in Liquid Orchard Core has a new Liquid helper called utc, which converts a local date and time to the UTC date and time based on the site settings. Let's say we type in the following expressions: utc: {{ "utc" | local | date: "%c" }}local : {{ "now" | local | date: "%c" }}local is the default : {{ "now" | date: "%c" }} This will appear as follows. You can see the current date time in UTC and in the site time zone as well. This new helper is also added to the documentation of Orchard Core. Change the Query Schema editor to Monaco Editor If you have a site set up with the Blog recipe, you have one predefined query, called RecentBlogPosts. You can edit this query under Search -> Queries -> All queries. And as you may notice, the schema editor now uses the Monaco Editor that powers VS Code too. Allowing multiple INavigationManager In the past, if you were trying to have multiple INavigationManagers, you could not do that because the TryAddScoped is replacing the existing implementations. So, to be able to have multiple INavigationManager implementations, you have to use TryAddEnumerable, which adds a ServiceDescriptor if an existing descriptor with the same ServiceType and an implementation that does not already exist in services. And here, you can see that the NavigationShapes class can now handle multiple INavigationManager implementations. Demos Responsive Admin Theme This demo is about a feature that you can see in this pull request to make the Admin Theme responsive. First of all, you can see that fields are listed with the title being at the start point, in this case on the left. So, if you have an RTL text direction, it will be on the right. The cool thing about this is that you utilize more of the width of the screen when the screen is large and you reduce the scrolling if unnecessary. But if you have a smaller screen, the labels go back to the top as what you used to see. We have the same thing for content parts as well. Here you can see how everything appears if you have a wide or a narrow screen. But not everybody may like to see the labels on the left like this, it means this is optional, and by default, nothing will change unless you explicitly change it. This one was done by adding a new StyeSettings section under the TheAdminTheme section to the appseetings.json where you can define classes. If you chose to utilize this, you can add a setting per tenant, and you can customize the look and feel of the Admin Theme for every tenant. And how does this work is the classes are placed by helpers. Let's check out the TitlePart.Edit.cshtml for example. As you can see, the GetLabelCssClasses() and GetEndCssClasses() Orchard helpers read the settings and apply the class names that you have provided in the appsettings.json file. This means that if you want to use this feature, your custom views have to be updated to utilize these helpers. And all the new built-in views of the source code of Orchard Core have to use these helpers in the future. If you would like to know more about this feature, don't forget to check out this recording on YouTube! News from the community Orchard Harvest 2023 For those who are too young to remember, we had Orchard conferences, called Orchard Harvest. And the conference website was available under orchardharvest.org, but unfortunately, it's not anymore. The last one was in 2017 in New York. So, having another get-together is very much overdue. If you would like to see or get a feeling of how this looked like before, we have a couple of mood videos on the Orchard YouTube channel, like this one from the first conference. The point is that we should really think about organizing the next one, and we at Lombiq can take part in that or provide an organizing role with anybody who wants to take part. If you have any feedback or you are looking forward to having a Harvest again, please share your opinion with us by filling out this survey about the upcoming Orchard Harvest! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 386 subscribers! We have started this newsletter to inform the community around Orchard of the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post is published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who you think would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news around Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting!

Extend user permissions, add Contained Stereotypes Bag Part Settings - This week in Orchard (30/09/2022)

Add Contained Stereotypes Bag Part Settings to allow a user to include content types by stereotype, add Displayed Stereotypes property to Content Picker Field Settings, demo about extending the user permissions, and many more waiting for you in our current post! Orchard Core updates Add Contained Stereotypes Bag Part Settings to allow a user to include content types by stereotype When attaching Bag Part to a content type, the user must explicitly set Contained Content Types with an array of content types to be included in the Bag Part. This is good for most cases; however, it would be great to allow for setting the contained content types using Stereotype. The stereotype would be in addition to not in place of Contained Content Types. For example, we want to group all Contact Methods (phone number, address, email address, etc.) by a stereotype type called ContactMethod. All of these content types share a similar functionality which is a way to contact a person. Now we created a Person content type and attached a Bag Part to it. In this case, we had to explicitly specify each content type in the Contained Content Types. But if a new content type was added later from other feature/module, the user would have manually to edit the Bag Part settings every time/everywhere ContactMethods are used to add the new content type which isn't efficient. So now the Bag Part is more flexible. And as you can see here, now we have two radio buttons under the Contained Content Types option where the user can select Content Types or Stereotype. Add Displayed Stereotypes property to Content Picker Field Settings And this one is quite the same as the previous feature but for the Content Picker Field. For example, we want to group all to-do items (appointments, meetings) by a stereotype type called ToDoTask. All of these content types share similar functionality which is a to-do task. Now we want to use Content Picker Field in a different content type to allow the user to select a to-do-task of any kind. In this case, we have to explicitly specify each content type in the DisplayedContentTypes. But if a new content type was added later from another feature/module, the user would have to manually edit the Content Picker Field settings all time. Everywhere to-do tasks are used to add the new content type which isn't efficient. So, let's say we navigate to the editor of a Content Picker Field. And here you can say that you can select the Contained Content Types to: Display All Content Types Content Types Stereotype Add settings to form widgets There was a bug in OC. The option editor wasn't loaded when trying to add Select Input while creating a form. Also, the edit button did not open the modal that would allow you to populate the options using JSON. If the content is saved, and the page is loaded again then the modal and the options editor work just fine. Another form-related improvement is validation. When creating a form using the Form input widgets like (Input, Select, and Text Area) there is no easy way to add a label and validation elements to the input. The current approach is to add a label widget and then a validation widget which is not always ideal. We can make this process much simpler by adding settings to the Input, Select, and Text Area widgets with the following properties: LabelOption an enum value with the following values (None, Standard, ScreenReaders). By default, None is selected to keep it backward compatible. ValidationOptions an enum value with the following values (None, Standard). By default, None is selected to keep it backward compatible. Now, if the user selects an option other than None in the settings, we’ll create the label in the same widget block. The same applies to ValidationOptions. This will make things like dragging/dropping widgets during edit and controlling the size much easier. At the same time, we output less HTML code. And if we add the validation rules, we’ll have more validation logic which makes the widgets more useful. And now, the editor of the Select Input looks like the following with the additional options. And of course, the same applies to all of the built-in form inputs. Demos Extend user permissions A couple of months back there was a need reported to have some roles to be able to edit a user and some not. And there is a conclusion that the user interface is not very flexible at the moment with the permissions. So, it kind of makes it hard if you have a unique case where you need some specific users to be able to do stuff. And also, to set up who can see what users, when you are listing the users. To be able to test out this feature with us, you have to check out this PR on GitHub. The first thing that you will notice is the new permissions regarding Users. In this case, we navigated to Security -> Roles and edited the Moderator role. There are new permissions, for example, Assign any role, Delete any user or Delete users in role - Administrator, List all users, etc. So, you can say you can list all the users, but it doesn't mean you will be able to edit all the users. If you try to edit a given user, you will notice something new here. As you can see, the user name of the user is not editable, but you can edit the email address of the given user. This is controlled by settings that you can reach under Configuration -> Settings -> User Profile Settings. As you can see, here you can allow or deny changing the user names or email addresses of the users. But now back to the users' list. Let's say we have some predefined users and made some changes regarding the permissions of the Moderator role. Now, we logged in with a user who has the Moderator role. After that, the user with the Moderator role will see something like this. First of all, you can notice that there is a little badge under every user that shows the roles the user has. You can also see that this user has permission to see users in the Editor role, but they can't edit or delete the editor user. Now let's edit the author user! Here you can see that this user can edit the settings of this user but can't fully manage the roles of the author user. They have the option to add or remove the Author role but that's it, nothing more. And we are just showing you some simple scenarios about what you can achieve and how you can customize the user permissions. If you want to see more complex scenarios, head to YouTube for a recording! News from the community Helping Global Health build an Advanced Form Builder using Form.io When Global Health from Australia approached us with the request to build an advanced form builder using Form.io, it promised to be an interesting project. They were looking to integrate this new form builder deeply into MasterCare+, their Multi-Tenanted SaaS-based platform for Health Care which is built on Orchard CMS. It would allow creating custom forms for a wide range of scenarios in the health care domain, using the advanced editing capabilities of Form.io. The solution built by Lombiq was an important step in bridging the gap between paper forms and electronic health care management. Check out the full post here! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 354 subscribers! We have started this newsletter to inform the community around Orchard of the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post is published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who you think would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news around Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting!

Preserve browser Autofill for Bag, Flow, and WidgetList Parts, Lombiq UI Testing Toolbox - This week in Orchard (06/10/2021)

Preserve browser Autofill for Bag, Flow, and WidgetList Parts, remove unnecessary role attributes, Lombiq UI Testing Toolbox demo, 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 Preserve browser Autofill for Bag, Flow, and WidgetList Parts Currently, while editing a Flow/Bag/WidgetList Part, the HTML input IDs are based on the related embedded item IDs that always have different values. So we lose the browser autofill based on these HTML input IDs when editing another parent. So, here the idea is to generate IDs that are still unique while editing in the context of a given parent item, but that is the same while editing another parent content item of the same type. This is by generating IDs using a prefix composed of the part name of a given unique/named part, a delimiter, then a number equals the number of the current item. For the WidgetList Part, we also use the related zone name in the prefix. If you set up a site using the Agency recipe, you can check out the content of the Agency Landing Page content item, that has Bag Parts attached with prefilled data. Remove unnecessary role attributes Some HTML5 elements have implied WAI-ARIA roles so setting the implied roles on them explicitly is invalid HTML. Check out this link for more information: https://html-validate.org/rules/no-redundant-role.html. In the following screen, you can see some removals of the role attribute. Demos Lombiq UI Testing Toolbox 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 providing 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! How it works is also demonstrated in an example project which is part of our Open-Source Orchard Core Extensions full Orchard Core solution. Just clone that repository and find the solution folder called test in it. There is a Lombiq.Tests.UI.Samples project that contains several sample UI tests where you can see how to test your application. Let's check out the LoginShouldWork test in the BasicTests.cs file! As you can see, here we say that first, let's navigate to the /Login relative URL. Then find the UserName and Password form fields by their IDs and fill their content with the default username and password. After the test will find the submit button of the form and click on it. And if the retrieved user name of the currently authenticated user is the default user name, our test will pass! If you check the BrowserConfiguration file, you can see it can be used to provide some useful configuration values that can be used by the browser. For example, the value of the Headless property indicating whether the test will use the given browser in headless mode, provided that there's support for it. If you set it to false and run a given UI test by using the Test Explorer of Visual Studio, for example, you will see that the test will open up a browser where you can see the given test running. And we are just stretching the surface of the several features that you can have using the Lombiq UI Toolbox module! Don't forget to check out this recording on YouTube to see what else the toolbox can provide! News from the community Orchard Core Facebook Page Did you know that Orchard Core has its own Facebook Page? By following the Facebook Page, you can meet with new posts when a new Orchard Podcast or Orchard Demo has been uploaded to YouTube or when there is a new This week in Orchard post or any other important news or happenings around Orchard Core. The posts created on this page will also be shared in the Orchard Core User Group. Don't forget to follow the Orchard Core Page and join the Orchard Core User Group to be notified about the latest news around Orchard Core! New Lombiq team member: Viktória Magyar Viktória Magyar, our newest team member arrived! She is a developer but not Orchard Core this time, rather of our business! You can check out her full bio here! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 227 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!

Migrate INotifier to support async implementations, Lombiq Hosting - Tenants - This week in Orchard (28/09/2021)

Migrate INotifier to support async implementations, messaging when getting Part InvalidCastException, Lombiq Hosting - Tenants demo, 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 Migrate INotifier to support async implementations This new feature is about replacing the INotifier on the front end with a SignalR version, which works asynchronously. INotifier has been updated to use ValueTask when adding notifications. Prefer not to do a custom implementation, as using INotifier allows the front end to also receive messaging notifications from code in the Orchard Core codebase, which is very convenient for us. If you check out the INotifier interface, you will notice that the Add method is now marked as obsolete, and the new one that you can use from now is the AddAsync one. And of course the Information, Warning, Error, Success extension methods are also marked as obsolete and have their async methods, which are used across the whole solution of Orchard Core. Messaging when getting Part InvalidCastException Sometimes if you forget to register your part, you might have some cast errors, and you don't know why. This addition is just about displaying an error message saying you are trying to cast to this part, but please do a double check to make sure you registered this part. So, don't forget: every time you create a new content part from your module, you have to register it in the ConfigureServices method of your Startup class by using the AddContentPart extension method. You can find several examples about how to do that like, here you can find the registration of the FlowPart and the BagPart. DisplayText value of a cloned item is set before calling CreateAsync When cloning a content item, two audit log events are recorded: An initial create event for the newly cloned item. A subsequent save event updating the new item with the cloned content data. The create event in the audit log does not show the DisplayText of the original item but instead repeats the content type. The save event in the audit log displays correctly. Steps to reproduce the behavior: Set up a Blog site. Ensure the Audit Trail feature is enabled and configured to log all content items. Go to the Manage Content page and clone the About article. View the Audit Trail and see that the Create event states that Version 1 of the Article Article was created. The audit log for the created event should state that Version 1 of Article About was created. The fix was pretty straightforward for this one. As you can see here, the solution was to set the DisplayText of the cloned content item before calling the CreateAsync method of the DefaultContentManager, because the CreateAsync invokes the event handlers used by the Audit Trail module. Demos Lombiq Hosting - Tenants The Lombiq Hosting - Tenants repository contains various features that help you build a multi-tenant web application in Orchard Core. With the help of the Tenants Management module, you can set restrictions on tenant creation, while using the Tenants Admin Login module you can log in from the Default tenant's admin dashboard to any other tenants as an administrator user. In this demo, we will go with the quicker way and use our Open-Source Orchard Core Extensions full Orchard Core solution that contains both of these modules. 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 Hosting - Tenants Admin Login module that adds the ability to log in as a tenant's admin user. Make sure that you have also enabled the Tenants module to be able to test the tenant management. :) Now create a new tenant and enable the Lombiq Hosting - Tenants Admin Login - Sub-tenant feature there that adds the ability to log in to the tenant from the Default tenant. That will mean that admin users from the Default tenant can log in to this tenant as an admin user. In our example, we have created a tenant called Blog, and if you Edit that tenant, you will see a new Login as an admin user button, which can be used to login to this tenant as an admin user. Now let's see what you can do by using the other module of the Lombiq Hosting - Tenants repository, called Lombiq Hosting - Tenants Management which manages restrictions on tenant creation. The Readme.md file of the Tenants Management module shows how you can specify a list of hostnames that cannot be used to create a tenant. You can write the list of forbidden hostnames as a JSON array in the appsettings.json as follows. Now let's go back to the Tenants page of the admin UI and try to create a tenant with a forbidden hostname like forbidden.hostname1.net. If you hit Create, you will get a validation error: forbidden.hostname1.net is a forbidden hostname. And of course, changing the hostname of an already running tenant to a forbidden one will also cause a validation error. And as always, if you would like to see more, don't forget to check out this recording on YouTube! News from the community A new website using Orchard Core: ICAgile ICAgile envision a world in which organizations enable and inspire everyone in them to create a better future for those around them. Check out this brand new Orchard Core site here! 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. Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 226 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!

New Content-Language HTTP header feature, LINQ to DB - This week in Orchard (21/09/2021)

Add Content-Language HTTP header feature, new Health Check option, LINQ to DB demo, 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 Add Content-Language HTTP header feature While the Accept-Language header is useful for the request, Content-Language is very useful too for the response, there's no support for this yet. But that was the past! Now if you head to the admin UI of your Orchard Core and navigate to Configuration -> Features, you will find a new feature called Content-Language header that adds the Content-Language HTTP header, which describes the language(s) intended for the audience. Let's enable this module and see it in action! In this case, we just open up the DevTools of Google Chrome, click on the Network tab and check the content of the Headers tab after loading a page with a content item. In our case, we opened the home page of the tenant called blog1. As you can see, the Content-Language header is there containing the language of the given content, which is en-US in our case. Add Health Check options The option here is to be able to change the default URL of the Health Check. The health/live is the default one provided by ASP.NET. If you enable the Health Check feature and navigate to an URL like https://localhost:44300/health/live you will see the status of your site. And now, you can easily change the value of this URL by just updating the value of the URL of the OrchardCore_HealthChecks section in the appsettings.json file. Allow custom editors for Bag/Flow/WidgetsList Parts If you checked the drivers of the BagPart, FlowPart, or the WidgetsListPart, you would notice that these drivers were using hard-coded shapes, and now you can have custom editors based on the editor name, and you can select it. The default editor for these drivers is called Standard. Demos LINQ to DB - Lombiq Helpful Libraries for Orchard Core The LINQ to DB subproject is part of our Helpful Libraries project that contains various libraries that can be handy when developing for Orchard Core CMS, to be used from your Orchard modules. The use-case is that sometimes you just have to go to SQL. Although we have YesSql, we have all the abstractions, but of course, the SQL connection is still there if you want to go low level. Sometimes you have to write some funky query there, or otherwise, you just want to store something in the database which is not a content item, not necessarily an entity, just a simple table with some simple rows. And in that case, you may not want to write like SQL queries as strings. But still, you don't want to use a full-blown ORM like Entity Framework because that would be a bit of an overkill for use-cases where you don't need a full-blown application built on it. And for such cases, there is a library called LINQ to DB, which is a third-party library. LINQ to DB is the fastest LINQ database access library offering a simple, light, fast, and type-safe layer between your POCO objects and your database. What we have implemented in our project is that by just hooking into ISession (which is the standard YesSql ISession), you will get to write queries like this: There is a helper method, and in there you can pretty much write LINQ against tables. In this case, we are using the AutoroutePartIndex as the example, and as you can see it's LINQ as usual but since you are wrapped into this LingQueryAsync, the inside of it is executed as SQL directly. And as always, if you would like to know more about the LINQ to DB subproject, head to YouTube for a recording! News from the community A new website using Orchard Core: Planters Products Inc Planters Products, Inc. was established in 1963 as one of the leading Agricultural Chemical Companies in the Philippines. In 1970 it was purchased by the Sugar Producers Cooperative Marketing Association, the country's largest cooperative of sugar planters, and renamed Planters Products, Incorporated (PPI). Check out this brand new Orchard Core site here! 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. Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 224 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!