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.
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.
News from the community
A new website using Orchard Core: eRED Real estate and development
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!