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

Show a badge if a user is locked out, Lombiq Orchard Visual Studio Extension v.1.8.1 - This week in Orchard (27/06/2025)

This week's topics include displaying a badge when a user is locked out, renaming the ResetIndexProfile and RebuildIndexProfile recipe steps, and enhancing documentation for the indexing module. And have we mentioned that we've released a new version of our Orchard Visual Studio Extension, which now includes support for Razor Pages to the Dependency Injector?

Latest tutorials

Featured tags

IIS
API
SMS
SEO
MCP
All tags >

Admin Layers, move admin branding to a distinct shape - This week in Orchard (31/05/2021)

A new demo about Admin Layers, several performance improvements, and a new AdminBranding shape is waiting for you in our upcoming post! Oh, and have we mentioned that Lombiq is now more than 8 years old? :) Orchard Core updates Move admin branding to a distinct shape Now you will find a brand new AdminBranding shape in the default admin theme of Orchard Core that is about containing the favicon, and the default, clickable Orchard Core logo that redirects the user to the home page of the admin UI (the admin dashboard). And now, because this whole stuff is a new shape, you can easily customize this one too! Check out the updated documentation to read some words about it! Fix drop widget to empty zone Someone reported an issue that it's not possible to drag and drop widgets to an empty zone. Now, this has been fixed. Remove some async-await It's not a recommendation anymore to remove async/await when it can be removed. In this case here the Task from _session.Query can be returned directly, it doesn't have to be awaited. There is a benefit in terms of allocations but at the same time if there is an exception you lose where it's coming from. And the impact in terms of perf is minimal. So, it's not a recommendation to do it every time. Adding spatial features to content (Lucene indexed) You could see a demo a few weeks ago about adding spatial features to content. This module provides a GeoPointField, which can be used to give a geographic position to content. And this has been merged to the dev branch of Orchard Core with nice detailed documentation also! Don't forget to check out the docs to read about Terms specifications, Geo Bounding Box, Geo Distance, and many more! Reduce string allocations in MediaTokenService and use pooled StringBuilder instances with StringWriter Now the code is using StringBuilder from the StringBuilderPool instead of using String.Concat(), which is about allocating one buffer. There are other improvements with the queryStringTokenKey, which is not recreating a new string every time, just using the existing one. StringWriter will create a StringBuilder by using the StringBuilderPool and passing that to the StringWriter. It's not creating a new one, it's just reusing the existing one. Demos Admin Layers People want to change shapes or styles for various things on the admin UI without having a custom admin theme. For example, currently, it is not possible to change the admin panel's logo and icon without a custom theme (set the base theme to Admin). The new Admin Layers feature is very similar to the Admin Templates one. This new one is about working with the layers of the admin theme, which means you can put different kinds of widgets to the zones of the admin theme using different kinds of layers rules. Sounds familiar? Yeah, that's the goal of this one! Let's say you set up your site using the Blog recipe. After go to the Configuration -> Settings -> Features and find the Admin Layers one which enables admin users to render widgets across pages of the admin based on conditions. Now, the first thing to do is to set up the available zones for widgets as you would do that in the case of the front-end widgets as well. You can do that under Design -> Settings -> Admin Zones. Let's say we would like to work with the HeadMeta, Footer, Header, and NavbarTop zones for now. And let's add some layers too! If you navigate to Design -> Admin Widgets, you could see a very-very familiar UI to manage zones and layers. Here we have just added a simple layer called Always that has one boolean condition rule, which is True. Meaning the widgets on this layer will always be rendered. Now, let's do some testing! Let's say we add a simple Raw Html widget to the NavbarTop zone that is just about containing some bold text. After we will create a new Liquid Widget and render it in the HeadMeta zone. The Liquid Widget is just about containing some styling for the theme: {% styleblock at:"Head"%} body { background-color: gray !important; }{% endstyleblock %} Now we have created two widgets that we have displayed on the Always layer of the admin theme. Let's see how our theme looks like! First, notice the Some text in the NavbarTop zone near the moon icon. This is the Raw HTML widget in the NavbarTop zone. And the new background color is coming from our Liquid Widget. If you would like to know more about this feature, don't forget to check out the following recording on YouTube! News from the community Lombiq is 8 years old! May 21, 2021, is the 8th anniversary of founding Lombiq! On this special occasion, we have gathered 8 important factors of our company's life. We are glad that we took these steps at that time otherwise we might not be able to celebrate with our strong community here today. Check out our post to see which important factors we gathered together! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 202 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!

Client-side validation of the form elements, fix content item shape usage in Liquid - This week in Orchard (26/05/2021)

Documentation updates, fixes for the content item shape when calling it using Liquid, a new extension method for the IContentManager, and a demo about client-side validation of the form elements. These are the main topics for our current blog post! Orchard Core updates Adding docs on the Recipes recipe step A recipe is a JSON file used to execute different import and configuration steps. You can add it in a Recipes folder with a name like this {RecipeName}.recipe.json, and it will be available in the Configuration > Recipes admin page. A recipe can execute multiple steps. In order to create a new Recipe step, you need to implement the IRecipeStepHandler interface and the ExecuteAsync method: public async Task ExecuteAsync(RecipeExecutionContext context). This page of the documentation mentions the available recipe steps, but the Recipes Step is missing from the list. Now you can read about what is the Recipes Step exactly and how you can add them to your recipe file! Fix content item shape usage in Liquid There was some confusion about the difference between alias and handle when using the content item shape in Liquid. The handle is the way you can reference content items with logical names and not physical IDs. In this case, you can reference a content item by its alias, which is the test here, or by its slug, which can be blogpost1. But if you type the alias here, it will still work because some code falls back to that. The Detail display type is the default one, so you don't have to specify it in the helper. But rendering the given display type here didn't work because there was an issue in the ShapeTag.cs code. As you can see, there was an argument.Name.ToPascalCaseDash() call for each argument. But the right method to use here is the ToPascalCaseUnderscore(), which takes display_type and converts it to DisplayType. Load items in Admin List Now you can find tons of new extension methods on the IContentManager to call LoadAsync. When you call this new ListAsync extension method, it will call the LoadAsync too, which will invoke the LoadingAsync and LoadedAsync events to acquire state or at least establish lazy loading callbacks. Don't allocate for page output writing in LiquidViewTemplate When we have the RazorPage class in ASP.NET Core, it has an Output property, which is about getting the TextWriter that the page is writing output to. We use that to render out our Liquid Templates. But when we do that, the output object is actually a buffered writer that will take whatever we write to it and buffer it and write it again to the actual results at some point. But what happens here is Liquid will write every snippet of data, every fragment to this writer, which will be duplicated in memory because it doesn't know that it can reuse it or who owns the data. Knowing that if we look at the implementation of ASP.NET, there is a class named ViewBufferTextWriter, that has a custom Write(IHtmlContent) implementation that would check if the object we pass is an HTML content. And if it's HTML content, then it won't try to allocate anything, it will just keep a reference to it. So, by doing page.Output.Write(content) it's now invoking ViewBufferTextWriter.Write(IHtmlContent) which doesn't allocate anything. And then, when the IHtmlContent is used, it should write directly to the response buffer. Demos Client-side validation of the form elements This demo is about form element validation. There is an in-progress pull request by Spike where you can find the complete form validation implementation using the Validator.js library, which is a library of string validators and sanitizers. We can use this to have validation for form elements with one rule both on the client-side and on the server-side in a user-configurable way. We set up our site using the Blog recipe and created a Page content item that contains a Form in its FlowPart and posts its input elements to a Workflow. The input elements are just about to demonstrate some validation rules. If you add a new Input, you can see some new fields, like the Validation Type, the Validation Options, and the Validation Message. As you will see from the Readme.md file of the Forms module, there is a high variety of functions that are implemented and can be used as the Validation Type. Now let's try out the Contains Validation Type! Let's say we have a rule that the textbox should contain the 'think' word. To do that, we simply write the 'think' word in the Validation Options textbox and also added a nice error message. But as you can see, there are lot more options that you can choose from to validate the inputs of your form, which works the same way. And here comes the workflow that we are using to submit the form. The FormRequest one is just a simple HTTP Request event followed by the Validate Form one, which checks whether the submitted form contains any validation errors. And if there were no validation errors, we redirect the user to the /Success URL, otherwise, the user will be navigated to the /Error URL. But that's not all of it! Head to YouTube now to check out the recording about this very useful upcoming feature! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 199 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!

YesSql 3, Liquid Widget guide - This week in Orchard (17/05/2021)

YesSql 3 is here! Check out our current post to see what's new in YesSql, but first, read the new Liquid Widget guide and get to know why do the community needed to delete the Liquid Page and the Liquid Widget from the Blog and Agency recipes! Orchard Core updates Remove liquid type from recipes This is from a security report that if you have access to the admin, you can use and write in the LiquidPart. By using LiquidPart you can write HTML and JavaScript. It sounds obvious, but some sites don't expect users to be able to edit JavaScript on their pages, and it might have an issue. Because if you can write JavaScript, you can write XSS. The solution here is to remove the Liquid Page content type and Liquid Widget from the Blog and the Agency recipe. But the part is still there, and you can use it. And the Edit content types permission is marked as Security Critical. Meaning that, if you allow this permission to users, you let them be able to also use the LiquidPart and create some custom types that are about to render JavaScript in the frontend. Liquid widget guide As we mentioned previously, the Liquid Widgets from the default recipes were just removed. But that content type served as a very good example of how you can work with Liquid in Orchard Core. To have an example for working with Liquid, you will now find a new guide in the documentation about how to build a new Liquid Widget. Sometimes not having a feature but documenting how to use something is better than having a feature and no documentation about it. Did you know that our Helpful Extensions module for Orchard Core contains a Liquid Widget too, that adds Liquid code editing and rendering capabilities? Check out that repository for more goodies like the content definition code generation or the flows helpful extensions and many more! Use nameof for action name whenever it's possible Any controller action name that doesn't change can be called by using the nameof expression of C#. Now you won't break anything if you change the name of a method during some refactoring. Contents GetAsync: Recall published items Calls to IContentManager.GetAsync(string contentItemId, VersionOptions options) use IContentManagerSession.RecallPublishedItemId() to retrieve an already loaded content item if the request is to get a published item. The same could be used in GetAsync(IEnumerable<string> contentItemIds, bool latest = false) (i.e., the overload accepting multiple IDs). And the fix is here! When you do some loads with the content manager and if the content items are already have been loaded previously in the same request, there is no query that needs to be issued or just for the items that are missing. Demos YesSql 3 In the previous version of YesSql, every session created a new transaction automatically by default. Every session means even if your session is only doing reads. But when you are doing reads, you don't need a transaction because every read will be using the same transaction resolution. When you start a session in YesSql 3 and it's just about doing reads (like SELECTs) then it won't create a transaction. But the first time when you do a change on an object, the transaction will be created automatically (like when you would like to update a content item). Now it lazily creates a transaction if there are UPDATE, DELETE or INSERT statements. The second change is that if you really want to decide when the transaction should be created and not to wait for it to be automatically created. You can now call BeginTransaction and that will create a transaction or return the existing one if one is still open. And then there is another property (CurrentTransaction) that gives you either the existing transaction or NULL if there is no transaction. Everything has been renamed from CommitAsync to SaveChangesAsync. It's like in Entity Framework and now it's more obvious to know what it does (saves the changes). And what it means is that at that point if there is a transaction it will be committed and then released. If there is no transaction, it's just do nothing. And there is still the AutoFlush, meaning if you do some updates and then do a query to get some data, it will flush the changes from the database without committing a transaction, but your next request will be able to read the values that aren't in the database. Something that you can't do with YesSql before is let's say you start creating a session and there is an exception in the middle. If you didn't do a try-catch, and call CANCEL on the catch, it would commit the transaction because disposing of the session was committing the changes. In ASP.NET we don't have this issue because there is a rule that catches any exception that happens anywhere in the pipeline. But in some other apps, if you forget a try-catch, it would commit the changes even if it didn't go over the full list of commands that you want to execute. That was a big issue in YesSql. So, now that's actually changed. Meaning that if you don't call SaveChangesAsync now, it won't save anything. You have to call SaveChangesAsync at some point to commit the transaction. And if you disposing the session before calling SaveChangesAsync, it will cancel the transaction if it exists and closes the connection. So, SaveChangesAsync is now mandatory to mimic the EF behavior. So, if you have modules that use the session, you need now to call SaveChangesAsync, otherwise, nothing will be saved. But you should not have any module that calls SaveChangesAsync. And that's not all! If you would like to know every new feature and performance improvement included in YesSql 3, don't forget to check out the following recording on YouTube! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 199 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!

Search filters to the contents list, Admin breadcrumbs - This week in Orchard (10/05/2021)

Two new demos are coming this week! One is about extending the search capabilities on the contents list page, the second one is about adding admin breadcrumbs to your site. But first, let's check out some other great additions to Orchard Core! Orchard Core updates Add shortcut to change password from admin Let's say you have an Orchard Core site and you are logged in as a user who has access to the admin panel. If you click on the user icon at the top-right corner of the admin theme (near the Visit Site one), you will see a pop-up window that displays the content of the UserMenu shape. This shape shows you the user name of the currently logged-in user, you can have the option to edit the user profile of that user and you can log off. Now this list has a new option, called Change password. If you click on that, you will be navigated to the page where you can change your password. Monaco editor Monaco Editor is a new editor mode, available for the Html Field. The Monaco Editor is the code editor that powers VS Code. A good page describing the code editor's features is here. You could see a nice demo about adding Monaco editor to Orchard Core a few weeks ago and now the Monaco editor is merged to the dev branch, which means you can have it right away if you are using the preview packages of Orchard Core! And that's not all! There was a bug in (it didn't trigger preview updates) when you did a live preview of your content item that has an HTML Field with a Monaco editor that is now also fixed! Prevent Razor compilation in production The community continuously testing Orchard Core in .NET 6 as well and doing some performance stuff if needed. This fix is about to not use Razor compilation in production. Of course, it's still enabled in development to be able to change the files dynamically. Performance optimizations And if we are talking about optimizations, let's see another one: the Roles are now cached. Every time you check for dynamic content type authorization (like for each type we generate the content type localization dynamically), it would re-instantiate the dynamic type. Check out how the code uses the new OwnerPermissionsByName dictionary to know more! Demos Search filters to the Contents list If you navigate to the admin UI of your Orchard Core site and find Content -> Content Items in the menu, you will get a list of all listable content items on your site. Here you can find a search text box on the top, that is used to find content items based on their display text values. If you type explore here, the logic will return you the blog post content item with the display text Man must explore, and this is exploration at its greatest (which is the predefined blog post that comes with the Blog recipe). But what about having a way to provide more complex queries here? For example, we want to return every content item where the display text contains a man or woman. In that case, you can write the following query in the search box: man OR woman. Or you can have other more complex queries like: man AND woman: list all content items where the display text contains man and woman at the same time. man NOT woman: list all content items where the display text contains man but not contains woman. man woman: same as man OR woman. But you can do a lot more by using the new filters like you can sort the content items by the created date! And that's not all of the additions that sit in this PR and just wait to be merged to the dev branch of Orchard Core! If you would like to know more with some implementation details as well, head to YouTube now for a recording! Admin Breadcrumbs This demo is about a feature that is in progress right now. You can find the code in this pull request. The goal of this feature is to have breadcrumbs in the admin. Let's check that out! Let's say you have the Workflows module enabled and have at least one workflow created. If you check out the following screen, you could see that the breadcrumb will be displayed in the top bar. Breadcrumbs can be useful when you have a details page, and you want to see the parent page also. Currently there are not so many pages that have breadcrumbs, but this could be changed in the future of course. If you would like to know more about the current progress of this feature, don't forget to head to YouTube to check out this recording! News from the community Consultant needed for scalable TeamCity+Azure setup Do you have a lot of experience in configuring and operating TeamCity, hosting apps in Azure, and building a scalable Continous Integration environment? We're looking for you! Check the details here! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 197 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 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!

Spatial Search, 5000+ Stargazers - This week in Orchard (02/05/2021)

This week you could see a demo about an upcoming Spatial Search feature for Orchard Core! Do you know that Orchard Core's repository now has more than 5000+ stargazers? Check out our post for more! Orchard Core updates Map Shape's public properties You could not do stuff like Shape.Classes, Shape.TagName, etc. in your Liquid templates. It was broken by the upgrade to Fluid 2.0. In Fluid, Shape, and ZoneHoldings uses ShapeAccessor which didn't map all properties (ie: Id, TagName, HasItems, Attributes, and Classes). Now it's fixed. Workflow CommitTransaction in a separate Workflow Feature Head to the admin UI of Orchard Core then navigate to Configuration -> Features. If you type the Workflows word in the search bar, you will get all the features that are related to Workflows. Now you will find a new one here called Session Workflows Activities. But there isn't anything new here really, it's just about having the Commit Transaction task in a new feature, because for some security reasons and usually, we don't need to use it quite often. If you miss that activity, now you will know where you can find it. :) Fix notification locale when the site is restarted There could be scenarios where there are multiple notifications in the same controller. But if we are restarting the shell meanwhile in the controller, we could face some issues. This fixes an old localization bug, especially when the default culture is set, some of the notifications are localized with the culture before the new culture is taking a place. Demos Spatial Search Let's set up a site using the Blog recipe. Now go to the admin UI of Orchard Core and first, enable the feature called Spatial. This feature provides the ability to add spatial locations to content items. Let's try that out now! For the sake of demonstration, we will create a new content type called Venue. Let's say that our goal, for now, is to be able to query nearby venues. The Venue content type will have a Title Part and an Html Body Part. But that doesn't really matter right now. Apart from that, we will add a new field to our content type, which will be a Geo Point Field. The Geo Point field can have a Leaflet editor type. Let's keep the other content type settings as default. Now let's see what kind of editor we will have if we open up the editor of our content type. As you can see, you can use a nice editor for the Geo Point Field to set up the Latitude and Latitude coordinates. This means you can simply enter them in the text boxes with these labels or you can just click on the map which will place a marker there with the given coordinates. Of course, you can zoom in and out using the plus or minus icons on the top-left of the map or just by simply scrolling. When you persist this content item, the position will be indexed in Lucene. Lucene now has some spatial search features which this PR implements. Now let's navigate to Search -> Queries -> All queries and add a new query. Select Lucene from the available query types. In the following example, we have just created a query that returns Venue content items based on a given location. You can see a geo_bounding_box filter here, which is about to return Venues where the location is within the boundaries of the given box. You can set the top, left, bottom, and right parameters of the box by using a JSON object. And that object contains parameter values for this query, which will be the parameters of the box in this case. But we are just scratching the surface of the upcoming Spatial Search feature of Orchard Core here. If you would like to know more, check out this recording on YouTube! News from the community Orchard Core repository: 5000+ stargazers and almost 200 contributors If you have visited the Orchard Core repository nowadays, you may notice that Orchard Core has almost gained 200 contributors! Right now the project has 197 contributors! Users on the GitHub website are able to "star" other people's repositories, thereby saving them in their list of Starred Repos. Some people use "stars" to indicate that they like a project, other people use them as bookmarks so they can follow what's going on with the repo later. And if you check out the number of Stargazers you will see that Orchard Core now has more than 5000 stargazers! Decoupled CMS Orchard Core tutorial for the Dojo Course After a long wait, last December we released the new Orchard Core version of our legendary Dojo Course tutorial series, the Dojo Course 3! Are you a newcomer and want to learn Orchard Core from the ground up, both from a user's and a developer's perspective? Are you somewhat familiar with Orchard Core but would like to get up to speed and become an Orchard pro? Look no further, check out Dojo Course 3! Dojo Course 3 guides you from the very basics of Orchard Core all up to be able to write your own themes and modules, utilizing various APIs of Orchard. Here you can check out the Dojo Course 3 YouTube playlist. All the video tutorials are here, in the recommended viewing order. Note that the video descriptions contain links if any were mentioned in the video. And now we are thinking about making a decoupled CMS Orchard Core tutorial for the Dojo Course to extend it a little bit. Orchard for the admin and content store, Razor Pages for the frontend. What do you think about this one? Are you interested? If yes, please tell us your opinion under this Tweet to be able to create that kind of tutorial in the future that you would love to see! Consultant needed for scalable TeamCity+Azure setup Do you have a lot of experience in configuring and operating TeamCity, hosting apps in Azure, and building a scalable Continous Integration environment? We're looking for you! Check the details here! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 197 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 published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who you think would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news around Orchard and the details of the topics above, don't forget to check out the recording of this week's Orchard meeting!

Orchard Core Rebranding, new filters on the Users page - This week in Orchard (25/04/2021)

It's time to rebrand Orchard Core for the upcoming 1.0 release! Share your ideas in a visual survey, then check out the newest features of Orchard Core, like the new filters on the Users page or the upcoming sticky toolbar! Check out our post for more! Orchard Core updates Update branding There was a discussion last month about updating the branding of Orchard Core and we also wrote about that in this post. So why do we want to start rebranding Orchard? Branding is super important to make Orchard a widely known, competitive product, to truly make it an industry sensation. And now you can fill out a visual survey to help the community choosing the logo you would like to see! If you haven't voted, please choose the logo, the color, and the type of font that you are like the most. Thanks for voting, it means a lot to the community! And don't forget to follow this issue on GitHub where you can freely add your opinion about the new logo to make Orchard Core even better! Expose BackgroundTask Events Currently, if you want to know from code when a background task is executed and how long it takes there's no easy way to do it, you can't easily tap into background task execution. It's probably a problem unique to application performance monitoring (and otherwise necessary if you want to collect telemetry on background tasks). ModularBackgroundService could raise events when the execution of a background task starts and when it ends (perhaps separately when it completes successfully and with an error). Basically, raise events when there's logging currently. Now you have the availability to see when a given background task starts for example to be able to create diagnostics. The only thing you have to do is to implement the IBackgroundTaskEventHandler. The ExecutingAsync method will be invoked before executing the background task and the ExecutedAsync gets called just after the execution of a background task. The Lombiq Hosting - Azure Application Insights Orchard Core module enables easy integration of Azure Application Insights telemetry into Orchard. Just install the module, configure the instrumentation key from a configuration source (like the appsettings.json file) as normally for AI, and collected data will start appearing in the Azure Portal. The module will utilize these events there to make background task telemetry collection better. If you haven't heard about that module yet, take a look at this post! Support for SQL window functions Now Orchard Core has support for SQL window functions! Window functions are not part of SQL92 syntax, but they are quite useful and available in all modern database engines. They are part of SQL:2003 standard. lampersky extended SQL Parser and SQL Grammar to support OVER clause with PARTITION BY and ORDER BY so now you should be able to perform queries like: SELECT COUNT(1) OVER () as col1, COUNT(1) OVER (PARTITION BY Type) as col2, COUNT(1) OVER (PARTITION BY Type ORDER BY Type) as col3, COUNT(1) OVER (PARTITION BY Type, Id ORDER BY Type, Id DESC) as col4FROM Document; Now you are able to use other window functions (argumentless) like: ROW_NUMBER() RANK() DENSE_RANK() and more... Demos New filters on the Users page Head to the admin UI of Orchard Core then navigate to Security -> Users. If you check out that page closely you will see some new additions here. We already have a search feature here and now we have new filters too! You can sort users by user name and email address. You can say that you want to display only enabled/disabled users or all of them. But the most useful feature we think is the option that you can filter users by role. This is very useful if you have a lot of front-end users and you just want to see the authenticated ones. Head to YouTube now to see the new filters in action! Sticky action buttons Let's say you are on the admin UI of Orchard Core and you editing your content item. And that content item contains several parts/fields, which makes the editor page more complex and you need to scroll to be able to see every editor because it's now not fit on your screen. If you have just added a FlowPart or a BagPart to your content type, these will definitely make your editor longer. This makes publishing, saving, or previewing your content item a little harder. That would be great to have a sticky toolbar that stays in place if you scroll the page and you can see them all the time. This means a toolbar with the title of the current page on the left, and with the action buttons on the right. You can meet with the sticky toolbar on the create/edit content and on the Design -> Templates page because these are the longest ones where you may need this feature the most. This feature is still under development and might change in the future. If you are interested in a recording of this demo, head to YouTube now! News from the community Decoupled CMS Orchard Core tutorial for the Dojo Course After a long wait, last December we released the new Orchard Core version of our legendary Dojo Course tutorial series, the Dojo Course 3! Are you a newcomer and want to learn Orchard Core from the ground up, both from a user's and a developer's perspective? Are you somewhat familiar with Orchard Core but would like to get up to speed and become an Orchard pro? Look no further, check out Dojo Course 3! Dojo Course 3 guides you from the very basics of Orchard Core all up to be able to write your own themes and modules, utilizing various APIs of Orchard. Here you can check out the Dojo Course 3 YouTube playlist. All the video tutorials are here, in the recommended viewing order. Note that the video descriptions contain links if any were mentioned in the video. And now we are thinking about making a decoupled CMS Orchard Core tutorial for the Dojo Course to extend it a little bit. Orchard for the admin and content store, Razor Pages for the frontend. What do you think about this one? Are you interested? If yes, please tell us your opinion under this Tweet to be able to create that kind of tutorial in the future that you would love to see! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 196 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 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!

Code Generation Templates for .NET 5, Fluid 2 breaking changes - This week in Orchard (18/04/2021)

This week we will do some deep dives and take a look at the latest changes of Fluid 2. After, you can see how you can register your custom resources in Orchard Core and how to use the updated code generation templates with .NET 5! Check out our post for more! Orchard Core updates Fluid 2 breaking changes and fixes Let's say you had an expression something like foo != null and foo != "*" in your Liquid code. There are two things here: the null doesn't exist in Liquid. There is no such thing as null in Liquid. When you write null, it's like typing bread, there's nothing like bread in Liquid. Typing foo != null in this case is just about making sure that foo does really exists. Is it set to something? If you would like to check for null, you have to use nil because in Liquid that's how we check for null values. And let's say you write foo != "*" and foo =! null, that means you change the order here. Or let's say you have a code in Liquid like a or b and c or d and e. If you do it in C#, if you have an and and the first part of the expression is false, it won't check the value of the other parts, it will return with false. In Liquid, this is the opposite. In C#, the evaluation of this expression will happen from left to right but in Liquid it will happen from right to left. Let's see an example with this expression: 1 == 2 or b == 3 Liquid will start the evaluation of this expression in the following way: 1 == 2 or (b == 3) 1 == (2 or (b == 3)) (1 == (2 or (b == 3))) So, it will never check that when 1 will be equals to 2 because the evaluation will start from the right. This has been fixed in this version and Fluid now supports the following processing of the evaluation: (1 == 2) or (b == 3) So if you wrote foo != "*" and foo != null it was first checks if the foo is not equal to null. Then it will go to foo != ("*" and (foo != null)). Let's say you do something in your templates like: {% assign foo = 1 + 2 %} This is not valid in Liquid. In Liquid, there are no such operators like +, -, *, /. They are don't exist. They are supported in the first version of Fluid but now it has been removed to be close to the specification, so it's now not supported anymore. What you need to do actually is to change your operators in a way like {% assign foo = 1 |plus: 2 %}. The goal of doing that from the Liquid templating language is to be able to distinguish how to behave in terms of numeric operators and string operators. So if you have the following line of code in Liquid, the result you will get will be 12, not 3. {% assign foo = 1 |append: 2 %} If you have operators in your code, don't forget to rewrite them in the mentioned way. ResourceManifest breaking changes A resource used to be declared by implementing the IResourceManifestProvider interface that was resolved all the time on every page rendering and this change is about to redefine that. Now it's not using IResourceManifestProvider anymore, there is no such interface. You need to create an IConfigureOptions<ResourceManagementOptions> of a ResourceManagementOptions. The ResourceManagementOptions is just a class that can be resolved everywhere. It can be configured in the startup. And in this case, what we do is that is a static constructor of this class is instantiating one manifest instance, and then when the option is configured for every tenant, it's adding this instance (which is immutable) to the list of resource manifests that is in the ResourceManagementOptions class. Your own configuration can even remove existing manifests from the resource manifest or replace them with something else or add new ones. So, the two things here are that now we use the Options pattern from ASP.NET which is more standard. It's also better in terms of performance because it's a singleton for all the tenants. And here we are initializing the ResourceManifest instance in a static property. It's done once for all the tenants, even if you have one thousand tenants, there will be one instance of the ResourceManifest. Modifying the Lucene API To accept Post Form Data Now you can invoke Lucene queries with POST and GET requests too. And there are two methods: a route called content to get the content items and a route called documents to get the full JSON document. Add support for collections to OpenID Tokens Today all the documents are stored in a table called Documents. YesSql supports the notion of collections, which is a way to store some specific types or classes in different document tables to isolate them. So, instead of having everything in the same Documents table, you can have different document tables. When the content of this table can be isolated from the rest, you should do that. This is the case for the OpenId module. There are different levels of isolation. You could say every class should have its own document table. You could say also that every module can have its own document table. And then you can say that everything will go to the same document table. In this case, everything related to OpenId will go to the OpenId document table, which means everything in the collection named OpenId. This configuration tells YesSql there is a collection named OpenId. But how can you use that collection when you do queries? In this case, you have to say to query a class in a collection named OpenId. It will request that document table and get all the indexes that all related to this document table. We also do that when one of the classes has lots of items so it can scale better than putting everything in the same table. Like if you have one million content items it will be slow. In that case, it should be in their own custom collection. Demos Code generation templates for .NET 5 If you install the project templates pointing to the preview source, you are able to use new command line commands when generating an Orchard CMS Web Application to use the .NET 5 framework. You can find every information more detailed on this page of the Orchard core documentation. Right now we will just focus on the new stuff. So, don't forget to install the Orchard CMS templates for creating web applications. You will need to use the latest dev branch of Orchard Core to be able to use .NET 5, so this will be your command: dotnet new -i OrchardCore.ProjectTemplates::1.0.0-rc2-* --nuget-source https://nuget.cloudsmith.io/orchardcore/preview/v3/index.json If you do that, you can head to the folder where you would like to create your new solution. The only thing you have to do is to type the following line: dotnet new occms --framework net5.0 This means the .NET framework 5.0 will be used. If you don't use the --framework or the --fm options, your web application will be using the .NET Core framework 3.1. A number of predefined projects and item templates are installed with Visual Studio. These templates, such as the ASP.NET Web Application and Class Library templates, are available to choose from when you create a new project. Item templates, such as code files, XML files, HTML pages, and Style Sheets, appear in the Add New Item window. These templates provide a starting point for users to begin creating projects, or to expand existing projects. Project templates provide the files that are required for a particular project type, include standard assembly references, and set default project properties and compiler options. Item templates can range in complexity from a single empty file that has a certain file extension to multiple source code files with stub code, designer information files, and embedded resources. You may know that we have some Visual Studio Project Templates for Orchard Core too (we wrote about them in this post). It's still a preview feature in Visual Studio, so, you need to navigate to Tools -> Options -> Environment -> Preview Features and put a tick in the Show all .NET Core templates in the New Project dialog (requires restart) checkbox. After you can just say I want to create a new project File -> New -> Project and you will be able to select the Orchard Core one as the project type. Let's select the Orchard Core Cms Web App (Orchard Project) one for example. After you can set the name of the project, the location, and the name of your solution. The next, Additional information window will contain the property that we are focusing on right now. As you see on the screen, you can select which kind of framework you would like to use for your web application. It can be .NET Core 3.1 and .NET 5.0 as well. The default is .NET Core 3.1 in this case too. Here we are just creating our new solution using the name Test. And if we open up the Test.csproj file, we will see the following content here, where the value of the TargetFramework will be set to net5.0. If you would like to know more don't forget to check out a previous This week in Orchard post, where we first wrote about this topic. And as always, here comes the recording of this demo! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 196 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 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!

Application Insights Module, HeadMeta zone alternate - This week in Orchard (11/04/2021)

The Application Insight module is now available for Orchard Core too! Check out our current post for tons of updates like the new HeadMeta zone alternate, the now() helper function in SQL Queries and many more! Orchard Core updates Support for now() helper function in SQL Queries If you do a query like this in the generic SQL language we support, this will be mapped to whatever database are you using. As you can see, if you are using the new now() helper function, you can get the current date and time. Check out the where condition of the query below: where the PublishedUtc value of the published BlogPost content types is bigger than the current date and time. Add HeadMeta zone alternate for layer widget wrapper When rendering resources using Layers in the HeadMeta zone the widget wrapper is applied, which makes for illegal HTML code inside the <head> of the webpage. Of course, you can render resources in the Content zone, but then you just end up with an empty widget wrapper. Which also makes no sense. The solution is to in the list of layer zones, also include a list of Zones which do not wrap with the widget wrapper. This is useful for other scenarios where the extra divs added by the widget wrapper are not wanted. Here you can see the two now Liquid templates for the Agency and the Blog theme, and the Razor one for the default TheTheme. Fix migrations from RC2 to the latest dev Dean Marcussen did some tests to validate that we can migrate easily without any issue from the RC2 release to the 1.0 release. The idea being is if you are using the RC2 release of Orchard Core and you want to migrate to 1.0, then there won't be any exception or database conflicts or whatever. This mainly means new or updated migration steps for the modules, or move something to a feature, or the migration dependencies are not ordered correctly. BackgroundTask Atomicity You could see a demo in this This week in Orchard post about workflows atomicity. Now here comes a continuation of that feature, the BackgroundTask Atomicity. In a nutshell, it means some additional settings like: Configurable per IBackgroundTask through a LockTimeout and an auto LockExpiration in milliseconds, by default, there are equal to 0 and in that case, it works as before without any locking. Configurable by code through the background task attribute. Or through the admin UI by enabling the existing OrchardCore.BackgroundTasks feature. Right now we have just implemented the IBackgroundTask interface and navigated to Configuration -> Tasks -> Background Tasks and hit the Edit button near the new background task that appears in the list. And in the Advanced tab of that background task, you can set the lock timeout and lock expiration values. Note that you need to enable the BackgroundTasks feature. Arrows for collapsible panels It's a minor change but fixes like this one make the admin UI of Orchard Core more consistent for the users who can access the admin panel. We have different collapsible panels in Orchard Core and the arrows were not consistent in any cases. Now, if you have a Bag Part attached to your content item, the arrow near the collapsible section will be directed to the right by default. And if you open that section, the arrow will be head to down. So now we use the same kind of arrows (Right if collapsed, Down if expanded) for all collapsible panels in the admin. And this also supports Arabic and RTL languages, where we need to direct the arrow left if the panel is closed. Demos Azure Application Insights module This Lombiq Hosting - Azure Application Insights Orchard Core module enables easy integration of Azure Application Insights telemetry into Orchard. Just install the module, configure the instrumentation key from a configuration source (like the appsettings.json file) as normally for AI, and collected data will start appearing in the Azure Portal. Application Insights is an application performance monitoring tool. Withing Azure you can create such Application Insight resources and it will give you nice metrics and other data about your app that is running or production or staging or something. This is not for local but rather for seeing what happens in an application that is actually deployed somewhere. The Readme.md file in the repository shows you how you can set up the module and do the basic configuration just by editing your appsettings.json file. Let's say we have a site installed with the Blog recipe. If you add the module to your solution and enable it (Configuration -> Features -> Lombiq Hosting - Azure Application Insights) you can go to the configured corresponding Application Insights account and for example, check out the live metrics. Or you can see what happened in a given request. You can see all the details correlated: the request, the page views, the dependency calls, everything. For example, you can see that there was a server-side request. The Item/Display action was called which actually returned you the content item that is the homepage. It happened on the development environment on the Default shell with the user named admin. If you would like to know more about this module, don't forget to head to the repository of the module and try out it now! And as always, here is a recording that you can check out anytime! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 194 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 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!

SEO Module, Drag and Drop Dashboard Widgets - This week in Orchard (04/04/2021)

A huge new module has been added to Orchard Core; the SEO Module! Let us write some lines about this module and the added drag and drop capabilities to the Dashboard Widgets. Check out our post for more! Orchard Core updates Rule Benchmark A few weeks ago you could see a demo about the Rules module, which allows you to build rules for the layers without using JavaScript. If you remember we mentioned that if you use the Rules module instead of JavaScript, the performance of the layers is much better. And now we can prove that we are right! If you open up the RuleBenchmark.cs file in the OrchardCore.Benchmarks project you can see some comments with exact numbers. The EvaluateIsHomepageWithJavascript is the one that uses JavaScript to evaluate the rule that is about the check if the currently opened page is the homepage or not. And the EvaluateIsHomepageWithRule is the same, but this time we did that with the Rules module. The first table showing you the results when you are using .NET Core 3.1 and the second table is showing you the results when you are using .NET 5. As you can see, there is not much difference between the two EvaluateIsHomepageWithJavascript methods (.NET 5 is a little slower but we can safely say that it's the same), but if you are using the Rules module and .NET 5, you will get the best performance at all. But the goal here is not to optimize Orchard Core for .NET, it's about showing the fact that if you are using the Rules module instead of the JavaScript expression, you can get better rule evaluations on your site. Add fieldTypeName to Query Schema for GraphQL If you create a query and you want to expose it as a GraphQL, you can create a custom GraphQL schema to define the metadata such that clients know what they can query. And now there is a custom property called Name that will contain the name of the query itself. Such that when we use GraphQL to do to run some dynamic queries like SQL queries or Lucene queries we can now access them through a custom name and not the generic name, which is the name of the query in the system. Because there could be conflicts between different query providers in GraphQL. For instance, the default name we use for Lucene and SQL queries is the custom name we pass. For the content types, we also use the name of the content type. So, if you have a query that has the same name as the content type then GraphQL won't know what to query. The content type or the custom query? So, by using this custom Name property, you can add a custom name if there is a conflict. You can read more about queries in the docs. Demos Resize, Drag and Drop Dashboard Widgets You could see and read about a great feature of Orchard Core a few weeks ago that is about to add cards to the homepage of the dashboard, which is about to represent a piece of functionality of a given feature or module. In the meantime, several other great features had been added to the Admin Dashboard feature, so, let's check out them quickly! The first thing you have to do is to go to Configuration -> Features and enable the Admin Dashboard feature. And now just simply need to navigate back to the homepage of your admin UI to see the admin dashboard that has just changed because of the newly enabled feature. You can see one predefined card here with the title Orchard Core, and the HTML Body of that widget. This content item has the Html Dashboard Widget content type and the DashboardWidget as the stereotype. Don't forget that if you would like your content type to act as a dashboard widget, you have to set the stereotype to DashboardWidget. So, back to the admin homepage. At the top-right of your screen, you will see a Manage Dashboard button. By hitting that button you will have the option to edit, delete or add new widgets to your dashboard. Every dashboard widget has a DashboardPart attached by default that contains three properties: Position, Width, and Height. These can be used to set the size and the position of the given widget. But from now you can also use drag and drop to move or resize your widget. The best way to represent the improvements of the dashboard widgets is a GIF that shows you how you can use the improved UI. And as always, if you would like to know more about Dashboard Widgets, head to YouTube for a recording! SEO Module Buzz Interactive developed a SEO module for Orchard Core and thanks to Dean Marcussen (who is working at this company) offered that the module can be integrated into Orchard Core as a contribution. And Antoine Griffard already did the integration. A huge thanks to them! Let's see this module in action! Set up your site using the Blog recipe, then head to the admin UI. Find Configuration -> Features where you will see the new module that you need to enable, called Seo, that provides SEO Meta features. If you enable it you are able to use an SEOMetaPart that you can attach to the content types that you want to be able to support SEO features. Let's attach this one to the Article content type for example. Now let's open the predefined About Article content item to see what's changed in the editor. The first thing that you may notice that now there is a new SEO tab that you can use to set up those SEO options that are specific only for this content item, like the page title, meta description, canonical URL, meta robots, and so on. But before doing more digging here let's go back to the modified content definition of the Article content type (Content -> Content Definition -> Content Types -> Article) and hit Edit near the SeoMeta part. Here you can see some additional editor settings. You can select that if you want to display the keywords or not, display the Open Graph or not, and so on. So, if you check all of these and navigate back to edit the Article content item, the SEO tab now will have more cards. You can easily open or collapse each of these cards and you can set the relevant settings under the given card. For example, if you collapse the Twitter one you can set the SEO settings related to Twitter. You may notice the little [/] icon in every editor of the SEO tab. That means you can inject Shortcodes to these input fields. Let's just add a simple [display_text] Shortcode to the site (you can see the values that you will need here) and use that in some places just for an example. Now to check how SEO works, navigate to the front end of your site and open our About article. If you view the page source, you will see the meta tags in the head of your site. If you would like to know 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 192 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 published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who you think would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news around Orchard and the details of the topics above, don't forget to check out the recording of this week's Orchard meeting!

Orchard branding, Assign Role permissions - This week in Orchard (28/03/2021)

Check out our current post for many interesting topics and demos like updating the branding of Orchard; introducing Noayo, a new Orchard Core hosting platform; a new Orchard Core site, and many more! Orchard Core updates Update branding The issue is that we don't really have concise branding guidelines or even proper branding assets, just what's left over from a long time ago: https://docs.orchardcore.net/projects/O1/en/latest/Documentation/Walkthroughs/#orchard-branding The goal would be to possibly retouch the existing design a bit: E.g. the current logo's outer circle is strangely uneven, and to use a different branding color than the green there or just use those but then we should settle with the same main brand colors everywhere. Let us introduce you Paris Noble, brand strategist and co-founder of Elevate Strategy & Design. For the past 2 years, they've been working closely together with us on many Orchard-related projects that either needed something to do with strategy and/or design. So why do we want to start rebranding Orchard? Branding is super important to make Orchard a widely known, competitive product, to truly make it an industry sensation. And now you can see some logo proposals with a poll on Twitter too! If you haven't voted, please choose the logo that you are like the most. And don't forget to follow this issue on GitHub where you can freely add your opinion about the new logo to make Orchard Core even better! Add .NET 5.0 and netcoreapp3.1 target framework multi-targeting This is about changing all of the target frameworks, all the props files, and targets files to support .NET 5.0 as default. So, now every module is compiled on both, and right now the only target is 5.0, but anyone can define 3.1 because it will work with that. If you want 3.1 by default you can set it. Now you have all the new features of 5.0, but for now, we only used it for performance improvements. When we publish, we need to define what we want to publish for, so again, the Docker files are by default deployed with 5.0 and it's not breaking your existing site. It will still work, there is no breaking change here. Demos Dynamic user permissions - Assign Role We had a demo a few weeks ago where you could see how you can use the new Manage Users in Role permissions which means you can restrict which users you can manage by the name of the role. That means you can delete them, disable them, change their email address, and so on. The new permissions here are the Assign Role permissions in the OrchardCore.Roles feature. Let's see this new addition in a simple example! Let's say we have a user with the Editor role assigned. And we say that users in this role will have the permission named Assign Role - Author. You can set that in the admin UI under Security -> Roles. What does it mean in practice? To see that let's log in with that user who has the Editor role assigned. Navigate to the admin UI of Orchard Core and head to Security -> Users. Here let's hit the Edit button near the admin user for example. As you can see, the Roles list contains every role in the system and you can see that this user has the Administrator role. But all of the checkboxes here are disabled, except the Author one. This user can only assign the Author role to this user because we said that the users with the Editor role can only assign the Author role to users. Head to YouTube to see a short demonstration about this feature! Noayo Noayo is a fictional word that comes from noyau, which is a French word that means core in English. Noayo is an Orchard Core hosting platform and it allows you to create your own Orchard Core instance online. You can use a Bootstrap template for that site. You have two plans: the first one is 5$/month, you have 14 trial days, you will get 300Mb storage, you can have a maximum of 300 content items and 1$ is redistributed to contributors. The 10$ plan has more storage, you can have more content items and that also allows you to use your custom domain. If you would like to request a new account, just hit the Request an account button. In the following demo, you could see the Site management feature of Noayo and a presentation of a given site that runs on Noayo. Head to YouTube now to learn more about Noayo! News from the community A new website using Orchard Core Musica Pristina's purpose is to connect people with a breathtaking musical experience in their home. One where selecting what to play is nearly as enjoyable as listening to it. 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 192 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 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!