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

Gábor Domonkos's avatar
This week in Orchard, Liquid, Audit Trail module UI improvements

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.

The new All Feature Profiles deployment step

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.

Executing the Feature Profiles deployment step

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.

The date filter in Audit Trail

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 <=.

The DateTimeParser fix of the Audit Trail module

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.

Selecting the default search index

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.

The updated list_items Liquid Filter

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.

The updated QueryListItemsAsync method

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!

The eRED Real estate and development Orchard Core site

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!

No Comments

Add a Comment