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 Harvest 2024 Program, Liquid syntax support for Correlate Task - This week in Orchard (19/07/2024)

Add target attribute to Menu, and Liquid syntax support for Correlate Task are the topics for this week. The full program of our Orchard Harvest conference, with all the speaker and talk details, is now out! Without further ado, let's dive in! Orchard Core updates Add target attribute to Menu In some cases, you may need to always open external links in new pages by adding optional target='_blank' to the Menus and AdminMenus. This change allows the user to specify the target property on both the Menus and the AdminMenus. Let's see how you can do that! Here, we have a site set up with the Blog recipe that adds a Main Menu option to the admin UI of Orchard Core. If you click on that and edit one of the Link Menu Items, you will find a new Target textbox, where you can specify the target attribute of the A tag. To be able to check out this for the Admin Menus as well, we need to head to Configuration -> Admin Menus and edit the nodes of the predefined admin menu called Admin menus. Just click Edit near any Link Admin Node and click inside the Target textbox. A context menu will appear that helps you to provide a valid value for the target. Liquid syntax support for Correlate Task The Correlate Task now uses the Monaco editor but only supports Script parsing. It would be nice to have an option to parse Liquid by selecting the syntax of the Correlate Task. This should default to Script parsing to be backward compatible. To check it out in action, we have to make sure that the Workflows feature is enabled under Configuration -> Features. We also enabled the HTTP Workflows Activities feature to be able to demonstrate this new addition to the Correlate Task more easily. After that, we can navigate to the Workflows option and create a new workflow. First of all, the startup event of our workflow will be an HTTP Request Event, which means if we invoke the generated URL, we can easily trigger our workflow. This is followed by a Set Property Task, where we set the value of the test property to "Hello Orchard Core!". And here comes the Correlate Task, where we set the Syntax to Liquid and the Value to {{ Workflow.Properties['test'] }}. And we close our workflow with the HTTP Response Task where we print the value of the CorrelationId in the following way: { "CorrelationId": "{{ Workflow.CorrelationId }}" }. Now it's time to trigger the workflow and see what will happen. As you can see, the CorrelationId property contains the value of our test property which we defined in our Correlate Task using Liquid syntax. News from the community Orchard Harvest 2024 Program The full Orchard Harvest program has finally arrived. This year’s program is packed with insightful sessions, engaging panels, and ample opportunities to connect with the Orchard community and to make Orchard Harvest the biggest Orchard Core event of the year. All sessions will be recorded and published on the Orchard YouTube channel after the event, so even if you can't make it live, you can see the sessions. However, being there live will allow you to ask the speakers, meet other community members, and have a lot of fun! All indicated times are local time in Las Vegas. After each session, you'll have a chance to ask questions, and we'll have a short break too. Here is a detailed schedule to help you prepare for the conference. Can't wait until September? Check out recordings from last year's special online Orchard Harvest on this YouTube channel here. Ready to be a part of something extraordinary? Reserve your spot today and take advantage of early-bird pricing at Orchard Harvest Conference 2024. Secure your spot today and get ready to level up your skills at Orchard Harvest Conference 2024! See you there! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 468 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!

FeatureEventHandler base class, settings to create robots.txt file from site settings - This week in Orchard (23/06/2023)

Checking ListContent permission instead of IsListable in the Admin Menu, new FeatureEventHandler base class, demo about new settings to create robots.txt file from site settings, and announcing our brand new Lombiq.com site! Check out our post for the details! Orchard Core updates Check ListContent permission instead of IsListable in the Admin Menu Currently, if you want to add a content type to an admin menu, the content type would have to be listable in order to be visible. Sometimes, we want to show a content type item on the admin menu even when it is not listable. The Admin UI does not care if the content type is listable or not. All it checks for is whether the user has permission to ListContent. The logic in the admin menu should be the same as the UI. And you can easily try this out if the Admin Menu feature is enabled on your site under Configuration -> Features. But if you set up your site using the Blog recipe, you will get a predefined admin menu which you can configure from under Configuration -> Admin Menus. Here, click the Edit Nodes button near the predefined admin menu and select the Add Node button after. This will show you a modal window with the available Admin Nodes. Let's select the Content Types one, which will add a link for each one of the selected content types. And this Create Node page now will list all of the content types defined by the Blog recipe (because we logged in with the admin user), not just the ones, which are listable. FeatureEventHandler base class This addition is about adding a new FeatureEventHandler base class which implements the IFeatureEventHandler interface. The goal here was to not have to define all methods when implementing IFeatureEventHandler as we already have with ModularTenantEvents and IModularTenantEvents. This PR also applies this change to the current implementations, like for the MediaTokenSettingsUpdater and for the RoleUpdater. Demos Settings to create robots.txt file from site settings One of the challenges that we had was that the only way we can expose the robots.txt for the tenants is by placing the robots.txt file on the file system of each site or globally. There was no easy way to modify that file per tenant. This feature is about adding an ability to drive the content of the robots.txt file through settings by using a middleware allowing website owners to easily define the directives for search engine crawlers and other web robots accessing their site. Now it's time to try this one out! Let's use the nightly build packages of Orchard Core and set up your site using the Blog recipe, for example. Now, head to Configuration -> Features and enable the SEO module, which provides SEO meta-features. After that, you will see a new option under Configuration -> Settings, called SEO. If you navigate to this page, you will see some things set by default, which is to add a rule to allow web robots and then add a rule to disallow web robots to the admin routes. And those are on by default if you do not have a robots.txt file. In the Additional rules editor, you can specify your custom rules. If you have special rules, you can define them here. Now if we check out the content of the robots.txt file, we can simply navigate to https://localhost:44300/robots.txt, because we only have the default tenant right now. But of course, if we would create a tenant called the agency, you will be able to check out the content of the robots.txt file for that tenant as well under https://localhost:44300/agency/robots.txt, for example. And as you can see, the file is generated based on our settings. However, people might already be using the robots.txt file. So, we can't really override what they have. So, if they have this file in the file system and the Static File Provider feature is enabled, we're going to take that file and ignore our settings. Because otherwise, this would be a breaking change. Another thing is the added rules for the sitemaps. If you go to the Features page, enable the Sitemaps feature, and navigate back to the SEO settings page, you will see a checkbox here called Include all sitemaps. What this does is it checks all the sitemaps that you might have; if any exist, it will automatically include them. And that's not all of it! If you would like to know more about this feature, check out the documentation and head to YouTube for a recording! News from the community Renewed Lombiq.com website We launched our website when we started Lombiq, no less than 10 years ago. It was simple, clean, and functional, but it didn’t age well with upcoming trends and looks of modern websites. But now we can showcase our expertise and services in a more modern and user-friendly way. To reach our goal, we migrated from our old Orchard 1 website to Orchard Core and modernized our site's look. Our new site turned out great, and we are very happy with it. It represents who we are and what we do as a company. We hope you like it too! For our case study on building the renewed Lombiq.com, including migrating it from Orchard 1, check out "How We Renewed and Migrated lombiq.com from Orchard 1 to Orchard Core" in the Lombiq blog. And we also added our site to Show Orchard, which is an Orchard CMS showcase, displaying Orchard CMS (including Orchard 1 and Orchard Core) powered sites from around the web. 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. Ryan Drew Burnett started it, 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 467 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!

Orchard Core is in the Red Hat Ecosystem Catalog, Top-level Multi-Tenancy menu - This week in Orchard (09/06/2023)

New top-level Multi-Tenancy menu; adding docs about Common Part; and Orchard Core is now listed in the Red Hat Ecosystem Catalog. Check out our post for the details! Orchard Core updates Add top-level Multi-Tenancy menu Let's say you have an Orchard Core site where you already enabled the Tenants and the Tenant Feature Profiles features. By doing that you will have a set of functionalities that provides you with a way to manage tenants and their available features from the admin. These features are all related to multi-tenancy, related to tenants, and not to the other settings of the site where you can execute recipes, manage features or admin menus, and so on. So, this addition is about adding a new top-level menu called Multi-Tenancy and moving Tenants and Feature Profiles under the Multi-Tenancy menu. Add Common Part docs If you are not a newcomer to Orchard Core, you may know that the Common Part gives you the basics, like the owner and date-created fields. But in the past few days, someone asked a question on Twitter about how to do something, and the solution for the problem is to use the Common Part, which has some options that you can set to display the owner and the creation time, and so on. From now on, the Orchard Core Documentation site will contain a few lines about the Common Part. Orchard Core is in the Red Hat Ecosystem Catalog The Red Hat Ecosystem Catalog was built on Red Hat platforms and technologies with certified, enterprise-grade products you need to achieve your business outcomes. The developers of this catalog make it easy for you to explore and find certified products from this ample and robust ecosystem of enterprise hardware, software, and cloud and service providers. So, this is a catalog of software that is placed along their platforms. If you go there, you will find a lot of stuff here, but for .NET developers, there isn't much familiar here. These are like lower-level hosting/cloud/server-management applications mostly. There are some blogs and CMS systems, and the goal was to include Orchard Core in this catalog. Orchard should be compatible with Red Hat Enterprise Linux at least, and well, if we have it here, that's one more channel people can find Orchard. And that was the purpose of this GitHub issue, to improve Orchard's visibility in a circle where it's probably unknown, outside of the .NET community. And now we have Orchard Core listed in this catalog! And we also have a new page on the Orchard Core Documentation site about how you can manage the Orchard Core Red Hat Ecosystem Catalog certification! And if you would like to know more about this topic, check out this part of the community meeting! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 465 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 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!

Orchard Harvest Program, Tenant Clusters - This week in Orchard (19/05/2023)

Allow displaying an icon for Custom Settings, add Admin Culture Picker docs, demo about Tenant Clusters, and most importantly, the program of the Orchard Harvest is now available! Let's get started! Orchard Core updates Allow displaying an icon for Custom Settings You can create a setting using Custom Settings and set the item icon in the menu that came with it. It wasn't really possible before this change because the .Id(type.Name.HtmlClassify()) and .AddClass(type.Name.HtmlClassify()) weren't applied in the AdminMenu of the CustomSettings module meaning it was not possible to override this menu item with a shape named NavigationItemText-NAME_OF_SETTINGS.Id. From now on, the CustomSettings module allows us to set the icon of the newly added menu item. Add Admin Culture Picker docs A few weeks ago, we mentioned that you have the option to add an admin culture picker for the admin site and have a dropdown in the admin panel header to switch languages. And of course, when adding new features to Orchard Core, we always keep in mind the flexibility and the reusability that Orchard Core can provide to the developers. Meaning, you can override and customize the shapes which are responsible to display the admin culture picker. Now we have some lines in the documentation about the two shapes that are responsible for displaying the admin culture. Demos Tenant Clusters This demo is about a work-in-progress feature for Orchard Core that distributes requests across tenant clusters using Microsoft Yarp.ReverseProxy. If you check out the following recording, you can easily get up to speed with the current state of this upcoming feature. Here we want to highlight some of the more exciting parts of this addition: We first use the Yarp Configuration to define Routes and Clusters with many options. Each Route is tied to a Cluster composed of Destination(s) on which load balancing can be applied. We only need one catch-all RouteTemplate and multiple Clusters on which we can configure a custom SlotRange[min, max] property (up to 16384 slots). Each tenant has a unique slot hash, so a unique Slot then belongs to the Cluster having the slot in its SlotRange. The Cluster can have multiple Destination(s). We could have used a Cluster having Nodes, but we follow the Yarp Config having a Clusters list of Cluster type. The same application can run as a proxy or behind it (we check the headers), the advantage with our distributed services is when as a proxy we are still aware of all tenant's data. So, on a request, we can use the same RunningShellTable to know the tenant, then select the right Cluster based on the tenant slot hash (in a custom middleware), and let Yarp selects one of its Destination(s). To compute a tenant slot hash, we use the CRC-16/XMODEM algorithm (same as Redis uses for clustering keys) applied on the new TenantId property, which allows us to automatically spread out new tenants on the slots and then on the configured Clusters. This knowing that the CRC-16 is fast to compute and always returns the same number for the same TenantId, so a tenant stays on the same Cluster. News from the community Orchard Harvest Online Program As many of you know, we have been working hard over the past months to organize the next Orchard Harvest in Las Vegas after the last Harvest in 2017. Unfortunately, based on the current economic situation and personal feedback, Las Vegas won’t work this year. Not to mention that unfortunately Microsoft Build, announced after we decided on our dates, also falls in line with the original dates we chose. So, a date change was also necessary. However, we did not want to let go of this opportunity to meet completely. Therefore, we are pleased to inform you that we will be holding our first online Orchard Harvest starting on the 31st of May at 13:00 UTC. You can start your registration for the event right now. And in the meantime, the program of the conference is available on the official site of Orchard Core! Please welcome the below selection of awesome talks by community members! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 458 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!

Content items Excel file import/export, add admin relative URL for admin menu nodes - This week in Orchard (16/12/2022)

Add Admin relative URL for admin menu nodes, add Alias to ValidationResult, and a demo about content items Excel file import/export. Check out our post for the details! Orchard Core updates Add /Admin relative URL for admin menu nodes If you enable the Admin Menu feature, you will be able to create custom admin menus. You can manage admin menus under Configuration -> Admin Menus. The admin menu consists of different kinds of Admin Nodes, where a Node can be a link for each one of the selected content types or a menu item that acts as a container for others. You can also add a Link Admin Node which adds a link with text and a URL. But of course, you can also add an admin menu from the code by implementing the INavigationProvider interface or using our MainMenuNavigationProviderBase. And as you can see from the screen, this change is about handling the case where the URL is an admin URL in the menu navigation. Add Alias to ValidationResult This minor change is about adding the Alias to ValidationResult to be able to find which one is faulty faster. Also, it contains fixes for validation message styles globally. To test it, you can add the Alias Part to the predefined Blog Post content type. Set the value Alias of the predefined Blog Post content item to "myalias", then try to create another Blog Post content item with the same Alias value. As you can see, the validation error now contains the "myalias" at the end of the error message. Demos Content items Excel file import/export There is a need to export data to an Excel file and also to import data from an Excel file. Currently, we can do that using JSON, but JSON isn't really a business-friendly format. This is a new module that allows us to do such a thing. It's not really 100% ready, but it does the job right now, and it is worth mentioning it here as well. Let's check out how this module may work in the future! We have two custom content types here, called Product and Product Category, just for the sake of this demo. If we edit the definition of the Product content type, you may notice two new checkboxes here: Allow bulk excel file import Allow bulk excel file export If you want to import only but not export the data you can, or if you want to allow both, you can do that as well. In this case, we said we allow the Product content type to be exported and imported. This feature adds two new menu items under Content: Imports, and Export. And under Imports, you can find an Import Product option because the Product was marked as importable. If you look at this screen, everything here is generated based on the definition of the Product content type. The Columns Requirements table tells you the requirement of what the import file needs to look like in order for the system to understand it. For example, the Price field is a required field that contains a numeric value for Price. And these are all derived from the schema of the Product content type. You can actually download a template that gives you a file with the header name and also the description of what each one really means. Similarly, we can export by clicking on the Export option. You can select which content type you want to export and because Product is the only exportable content type, we can say to export this by clicking on the Export Data button. If you would like to know more about this feature, don't forget to check out this recording on YouTube! News from the community Updated Lombiq's Open-Source Orchard Core Extensions This is an Orchard Core Visual Studio solution that contains most of Lombiq's open-source Orchard modules and themes, as well as related utilities and libraries. Please keep in mind that only those extensions included that use the latest released version of Orchard (i.e. the very cutting-edge ones depending on a nightly build are not yet here). And now, this solution has been updated to the latest and greatest 1.5 Orchard Core version. Check them out here, and install them from NuGet or from the source! Orchard Harvest 2023 For those 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 are looking forward to having a Harvest again, please share your opinion by filling out this survey about the upcoming Orchard Harvest! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 379 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!

Culture settings deployment step, Display New menu option - This week in Orchard (21/02/2021)

New culture settings deployment step, display new menu option, sample recipes in Try Orchard Core, and many more await in our upcoming post! Orchard Core updates Disable CDN by default A lot of people were saying that there was no way to disable the CDN easily. There were issues when you are in China and you have to disable the CDN because in that case, you don't have access to the scripts that are required. And we had some required assets on the setup screen too. After some discussion, the fix is to not use CDN by default, use the locally served assets by default even in the setup screen. If you want to use CDN resources then you have to go to the settings and enable it. To do that, just navigate to the admin UI of your site and head to Configuration -> Settings -> General. And in the Resources tab, you will find the Use framework CDN (Content Delivery Network) option to enable or disable the CDN support. You can find some lines about the disabled CDN in the docs. Add deployment step for culture settings Set up your site using the Blog recipe then navigate to Configuration -> Features under the admin UI. Here enable the Deployment and the Localization features. Now you can add multiple supported cultures to your site. To do that, head to Configuration -> Settings -> Cultures and add some cultures. Now we can easily try out the new Culture settings deployment step. All you have to do is to create a new deployment plan under Configuration -> Import/Export -> Deployment Plans and add the new Culture settings to it. If you execute the plan and open the Recipe.json file inside it, you will see the supported cultures of the site. Fix NRE when clearing out all zones Let's navigate to Design -> Settings -> Zones to manage the supported zones. Remove all zones from Available zones for Layer and hit the Save button. This means the zones do not clear but instead remaining the same. The cause is an NRE in the LayerSiteSettingsDisplayDriver when attempting to split model.Zones when null. If you happen to go edit the layer zones and you make it blank, the model.Zones here will be null. You can see the fix in the LayerSiteSettingsDisplayDriver.cs. Move tags to own ViewModel Let's say you have several taxonomy terms, multiple fields with the same taxonomy terms on the editor of your content item. And if you would like to save or publish your content item you got the Form value count limit 1024 exceeded error message. The solution is to use one JSON document containing all the Tag Term entries to update and then just send what needs to be updated instead of sending everything when you are modifying your content item. Check out the Edit and UpdateAsync methods of the TaxonomyFieldTagsDisplayDriver. Demos Display New menu option If you log in to the admin UI of Orchard Core, the first option in the admin menu called New that you can use to create Creatable content items. It can happen that you don't want to be that option in the menu because you don't need that all, you never use it. Well, here comes the good news for you! If you navigate to Configuration -> Settings -> Admin, you will find a new one here called Display New menu. If you remove the tick from the checkbox, the New option will not be available from the admin menu. You can also find a short recording on YouTube about this setting! Try Orchard Core sample recipes You may hear about the Try Orchard Core website that is a showcase for the Orchard Core content management framework: you can try how Orchard Core feels by checking out an already running demo site where you can play with Orchard as you wish. This site operates with the RC2 version of Orchard Core but if you want to go ahead with a more recent dev build of the CMS, you can do that under the https://try.orchardcore.fr URL. And there is more difference between these two sites. Let's meet with the sample recipes! First, navigate to https://try.orchardcore.fr and set up a site with the Blank recipe (the third option from the recipes). If you set up your site by following the instructions from the email, you will see that the site doesn't have any home page. Now let's navigate to the admin UI of your site and head to Configuration -> Recipes. Here you will see several recipes under the Try Orchard Core category. Let's try to run them in the given order. The first one will enable the theming engine and The Default Theme for your site and make it the current one. The second recipe (called Homepage) will create a Page content type and a page content item that will be the homepage of your site. The first one (Menu) will add a new menu item to the Main Menu that targets the homepage of your site. The Layers recipe will add an Always and a Homepage layer to your site with the Content and Footer zones. The Widget recipe will create a RawHtml content type and add a Widget in the Footer zone. You will see something like this for now: the homepage has the page content type as the homepage, a menu with one item, and a RawHTML widget in the footer. Check out the following recording on YouTube to see what can you can get if you run the rest of the recipes! News from the community Work with us! You've completed the Dojo Course, congratulations! You’re now officially an Orchard Core developer. Would you like to work on a variety of challenging Orchard Core projects with the biggest Orchard team in the world? Work with us! Just send us an e-mail to crew at lombiq.com. Please include what you’re most interested in professionally and attach around 100 lines of any kind of code that you’re especially proud of or just link to the favorite open-source project of your own on GitHub or else. Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 191 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!

VueForms module, Obsolete IContentAliasManager - This week in Orchard (22/10/2020)

We prepared with a huge demo about showing you how you can use the custom VueForms module for Orchard Core! But first, let's check out the latest news around Orchard Core. Read our current post to find out an obsolete interface! Orchard Core updates Fix sizing of HTML/MarkdownEditor settings to be consistent in the correct zones There were some inconsistencies with the sizing of some field elements settings and other views. Some hints were full-width, some were restricted to col-md-6, other col-sm-6. Hint boxes should also align together with the rest of the fields.And one more thing here: the general settings/common to all editors should be in the Content zone and editor modes should be in the Editor zone. The issues had been fixed, they all look like this now, without uneven padding, and shapes are consistently ordered. Obsolete IContentAliasManager The IContentAliasProvider was renamed to IContentHandleProvider. The idea behind that is the alias was a bad name because it was in conflict with the AliasPart and they are two different things. They are related somehow because a handle now can come from an alias, but a handle is a generic term to say you can get a content item from different ways, like using a content item ID or a slug or alias. Whatever kind of identifier you want to give to your content item and then when you load a content item by its handle, you provide a prefix. In the past, the IContentAliasManager was just marked as obsolete and make it backward compatible, but the backward compatibility code didn't work. So, don't forget, if you injected the IContentAliasManager in the past and you update your Orchard Core solution to the latest, you will need to use the IContentHandleManager instead. Ensures shell terminating and disposing When e.g. we enable a feature for a given shell through the admin, the shell is released in the context of a shell scope, and at the end of this scope (if it is the last one for this shell) the terminate events are called and then the shell is disposed. But when e.g. we reload a tenant through the admin or when a shell releases its dependents, a shell may be released without having any current scope on it, so it is disposed immediately but without calling the shell terminate events. So here, in that case, we create a new scope (without using it) and dispose it to let it manage the shell state as usual. Note: In that case, the terminate events are called synchronously, we would need a shell ReleaseAsync(), but at least there are called. Another suggestion would be to get rid of the terminate events that are not used in the current code. So, in summary Here we ensure that the shell terminating/terminated events are called, even if the shell is not terminated by the last shell scope, e.g when the shell is released by dependency or when changed through the tenant's admin UI. So, right now we kept the terminate events. Here we also call the shell terminating/terminated events before the BeforeDispose callbacks that we use to call the session commit asynchronously, which is better if a terminate event uses an ISession. Demos VueForms module The StatCan Orchard Core repository houses a collection of custom Orchard Core resources, modules, and themes that support various web applications and software-as-a-service (SaaS) products. Built on top of Orchard Core CMS, developers have a suite of web application features out of the box (e.g. content management, authentication, forms, themes, etc) by customizing the selection and configuration of components. The extensibility of the framework allows new features and components to be added easily. One of the custom modules called VueForms, which aims to simplify the creation of client-side forms in OrchardCore. Let's see that module in action! Clone this repository and set up your site. Now go to Configuration -> Features and enable the VueForms and the VueForms Localized modules. The first is about provide a Form content type that simplifies using VueJs forms in the frontend and the second one is about to weld the LocalizedText part to the VueForms. The difference between the built-in Forms module and this one is that it's using client-side validation using Vue.js, Vuelidate, and Vuetify. Now if you navigate to the Content menu option, you will find a new one called Vue Forms. Here you can manage your Vue Form content types. Let's create a new one called Contact us! You have the option to disable or enable your form. If you disable the form, you can set an HTML, that is displayed when someone tries to render a disabled form. This feature is about creating the form on the back-end and no one can access it on the front end. If the server-side validation passes you will get the message that you can provide in the Success Message text box. Or it's doesn't, you can display the text that you can type in the Error Message textbox. Next one is the client init script. This is actually a client-side JavaScript, where you can set client-side actions. Right now here we set the required fields and in this case, we use it to localize the VeeValidate field validations. The required messages are coming from our localize liquid filter. The OnValidation is a server-side script, this is using Jint. Here you can get the form data and then you can perform validation here. This is not complete yet, the end goal would be to have widgets and the validation would be placed inside the widgets. The widgets would generate the client-side and server-side validation together. The addError() method allows you to add an error and map that input into the client-side. Here comes the OnSubmitted section. This is where you would perform actions after validation. Let's say the validation passes, there are no errors added, that means this script is called. In this case, we are creating a new predefined ContactRequest content item. And in the Localized Text section, you can create localizations with a key-culture pair. Here you can add as many as you want by clicking on the Add button, you can delete them by clicking on the trash bin icon, and reorder them with the little hamburger icon. The getLocalizedTextValues() function in the OnValidation section is used to get the localized text for the current culture that you defined here. This content type has a Form Part too that you can use to add a new Vue Component widget. Using that you can set the VueJS Component template. It's basically code, you are writing your Vue.js component here. You provide the template and you also have the script that is a typical Vue.js component script. The template is using the ValidationProvider component that wraps your inputs and provides a validation state using scoped slots. Now let's publish this new content item and view it in the front-end! Here you can see we have already filled out this form with some data but the email address is wrong. If we click on send, we will get the Your email is invalid error message, which is a client-side validation error. But that's not all! Enable the Workflows module and create a new workflow type called VueForm submitted. Click on the Add Event button and you will find a new category in the modal window called VueForm. And there is a new VueForm Submitted event that is fired when a VueForm passed validation and is submitted. Here you can also select the forms for which this workflow runs. We have only the Contact Us right now, so select this one. And using that event you can say send an email to the site admins if the form submission was successful. The whole repository and this module have great documentation where you can read more about these scripts and how to customize your VueForm content items. And don't forget to check out the recording of this demo on YouTube! News from the community Using the OrchardCore OpenID management feature with an existing OpenIddict deployment Kévin Chalet is one of the main contributors of Orchard Core. He developed the OpenID management feature for Orchard Core. In his blog post, he writes about how you can use the GUI of Orchard Core with an existing OpenIddict server, that is typically located in another project. Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 163 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!

Distributed cache, YesSql improvements - This week in Orchard (09/10/2020)

Get ready for the upcoming additions of Orchard Core! This week you can see demos about adding distributed cache to Orchard Core and the latest improvements of YesSql! Orchard Core updates Restrict Content Types Admin Node to only create the specified content type Let's say you have a site set up with the Blog recipe and your goal is to add a new admin menu that is about to list all the existing Article content items. To do that you have to navigate to Configuration -> Admin Menu and click on the Add Node button. Here you will need to select the Content Types Admin Node because you would like to add a link for each one of the selected content types from the list. And yes, you will only select the Article content type in the next screen. And that's it, you have created a new admin menu that lists all of the Article content items from the system. If you click on that you will see the list of the Article content items. Note that from now you will not see a filter here to filter by content types because that really doesn't make much sense. You created this Content Types Admin Node to list only the Article content items. If you would like to filter by content type, use the filter in the Content -> Content Items page as you would do it before. Remove ManageOwnMedia permission The ManageOwnMedia permission isn't handled today and we can replace it with the ManageMedia permission. So, now there is no separate permission to manage their own media or manage the media. It will be added back to the system again if the authorization logic is to be able to separate the user's media and the media uploaded by others. Right now, if you head to Security -> Roles and hit the Edit button near one of the Roles, you will see the missing Manage Own Media permission. Use a dropdown menu on the admin top navbar for the user menu The user menu on the admin theme is just about listing the user name of the currently logged-in user with a little icon near it. And there was a Log off link at the right side of the user name. It was just a piece of HTML code in the Layout.cshtml file of the default admin theme. From now the whole user menu gets its own shape, called UserMenu.cshtml. If you would like to override the user menu, you don't need to create a Layout.cshtml file in your admin theme, you just need to override the UserMenu.cshtml file. And if you check out this GIF, you will see that now the content of the user menu is placed in a dropdown instead of having it's content inline. Document release procedure Orchard Core is open-source that means you can check out and request changes to the source code, tell your opinion about it, and update the relevant documentation for that piece of code. Now there is a new page in the Orchard Core Documentation about how to publish a new Orchard Core release. These notes are primarily for Orchard's core contributors to guide them on how to prepare a new release, but if you just take a look at these you can now see what are the steps that need to be done to be able to ship a new release of Orchard Core. Add option to allow Lucene query syntax in the search There is a setting in the Lucene module that you can turn on and whatever you type in the search box won't be parsed as 'these are the words that I need to search on', but parsed as this is a Lucene query. You can use the Lucene query syntax in search forms, like the quotes, plus signs and things like this. But by default, it will still be like today, which is type words and it looks for these words. If you type stuff that has weird characters, they would be ignored. But how can I turn on that feature? Just navigate to the admin UI of Orchard Core, then find the settings in Search -> Settings -> Search (make sure you have enabled the Lucene module). Demos YesSql: Adding support for multi filters on the same table index There is a new method on .IQuery called .Or(), which starts a filter on a distinct table. This can be used for instance when the same index needs to be queried for multiple sets. It will actually add many filters on the same record of the index. With .Or() you can do now filters on different inner joins of the same index. Which means it will do unions of result with the filters. Let's check out the following unit test. [Fact]public async Task ShouldQueryMultipleIndexes(){ // We should be able to query documents on multiple rows in an index. // This mean the same Index table needs to be JOINed. _store.RegisterIndexes<PersonIdentitiesIndexProvider>(); using (var session = _store.CreateSession()) { var hanselman = new Person { Firstname = "Scott", Lastname = "Hanselman" }; var guthrie = new Person { Firstname = "Scott", Lastname = "Guthrie" }; session.Save(hanselman); session.Save(guthrie); } using (var session = _store.CreateSession()) { Assert.Equal(2, await session.Query<Person>() .With<PersonIdentity>(x => x.Identity == "Hanselman") .Or() .With<PersonIdentity>(x => x.Identity == "Guthrie")) .CountAsync()); }} This PersonIdentitiesIndexProvider will just map the first name and the last name of each person. We created two persons here that means the provider will be creating four PersonIdentity records. Two to store the first name and last name for Scott Hanselman and two to store the first name and the last name of Scott Guthrie. If without using the .Or() it will issue a query where the Identity == "Hanselman" AND Identity == "Guthrie", which will return nothing. With the .Or(), it will do an inner join on PersonIdentity with a filter on Identity == "Hanselman" and another inner join on PersonIdentity with a filter on Identity == "Guthrie". In this case, we will get both the two persons. It's like give me any person who's PersonIdentity has a record like Hanselman OR where the PersonIdentity equals Guthrie. Let's see another example! // Creating articles.using (var session = store.CreateSession()){ session.Save(new Article { Content = "This is a green fox" }); session.Save(new Article { Content = "This is a yellow cat" }); session.Save(new Article { Content = "This is a pink elephant" }); session.Save(new Article { Content = "This is a green tiger" });}using (var session = store.CreateSession()){ Console.WriteLine("Boolean query: 'pink or tiger'"); var boolQuery = await session.Query<Article>() .Where(x => x.Word.IsIn(new[] { "pink" })) .Or() .Where(x => x.Word.IsIn(new[] { "tiger" })) .ListAsync();} This is a full-text sample where in this case we can query documents by their content, by their words. If we have the documents as you could see in the code, we are creating an index for all the words pointing to the document, like green and fox points to the first Article. Now the query is about to give me all the documents that have pink in it OR all the documents that have tiger in it. The goal is to get the last two articles in this case. Let's check out this query: var boolQuery = await session.Query<Article, ArticleByWord>().Where(a => a.Word.IsIn(new[] { "white", "fox", "pink" })).ListAsync(); This query will return all the articles that have white AND fox AND pink in it and there is none in this case. You can find the recording of this improvement on YouTube! But wait a minute! Could this syntax be better? When you have a query, you can say .Any() and every predicate will be done in a different table. .Any() being an OR, and .All() being an AND. In this case, we're querying on the same index (ArticleByWord) but each of the calls on .With() will be a different projection, a different inner join in this case. Here we are looking for an article that has the word pink OR the words green AND fox. await session.Query<Article>() .Any( x => x.With<ArticleByWord>(a => a.Word == "pink"), x => x.All( x => x.With<ArticleByWord>(a => a.Word == "green"), x => x.With<ArticleByWord>(a => a.Word == "fox"))).ListAsync(); SELECT DISTINCT Document.* FROM DocumentINNER JOIN ArticleByWord_Document AS [ArticleByWord_Document_a1] ON ArticleByWord_Document_a1.DocumentId = Document.IdINNER JOIN ArticleByWord AS [ArticleByWord_a1] ON [ArticleByWord_a1].Id = ArticleByWord_Document_a1.ArticleByWordIdINNER JOIN ArticleByWord_Document AS [ArticleByWord_Document_a2] ON ArticleByWord_Document_a2.DocumentId = Document.IdINNER JOIN ArticleByWord AS [ArticleByWord_a2] ON [ArticleByWord_a2].Id = ArticleByWord_Document_a2.ArticleByWordIdINNER JOIN ArticleByWord_Document AS [ArticleByWord_Document_a3] ON ArticleByWord_Document_a3.DocumentId = Document.IdINNER JOIN ArticleByWord AS [ArticleByWord_a3] ON [ArticleByWord_a3].Id = ArticleByWord_Document_a3.ArticleByWordIdWHERE ArticleByWord_a1.Word = 'pink' OR ( ArticleByWord_a2.Word = 'green' AND ArticleByWord_a3.Word = 'fox') Here you can also see how does the query look like. That's the current syntax right now. And it's not breaking change because if you had .query.With().With(), it will still behave the same as before. It will be a single projection with two .With(). If you project on the same table it will be an AND on the same table, the same projection.If you would like to know more about the current syntax and the latest features, this is the YouTube video that you are looking for! Distributed Redis Cache There is a huge PR with a great addition to Orchard Core about having Distributed Cache in Orchard Core. In fact, this PR is related to all modules services using cached data that need to be in sync with a shared database, e.g. site settings and other admin settings, templates, queries, layers, and so on. Currently, in the dev branch, this is already the case for most of them but by using local memory cache entries that are invalidated through a distributed signal. This PR has changed this pattern by using a multi-level cache including a distributed cache. And Jean-Thierry Kéchichian made more services to be distributed aware, there are remaining things but could be done in other PRs. And recently he added the ability through a separate feature to also keep in sync tenant states, when you enable/disable/create/setup a tenant. To summarize: All services that were using the memory cache are now using a multi-level cache including a distributed cache, this cache is kept in sync with the database without using a message bus but document identifiers. We have concrete implementations of distributed services based on Redis, Redis cache, Redis data protection, Redis message bus, and Redis lock. In the current code, we never use a message bus/distributed lock. When enabling a concrete distributed cache in the default tenant, we automatically keep all tenants in sync through a hosted service, here also without using a message bus but identifiers. Here a stateless configuration is needed. There is a separate feature (DefaultTenantOnly) to keep tenants in sync. Don't forget to head to YouTube and watch the recording of this upcoming feature! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 160 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!

New custom filters in Fluid, Media options admin page - This week in Orchard (02/10/2020)

We prepared two interesting demos for this week: The first one is about having new useful custom filters in Liquid to make formatting numbers and string easier. The other upcoming feature is about how you can show your settings from your appsettings.json files without having the need to open these files in your file system. Orchard Core updates Restrict Content Type Admin Menus to only create the specified Content Type Several issues fixed regarding creating content items from the admin UI: Restored the new button specific to each content item when user filters by content type or accesses the content item list interface by link for a single content type in the admin menu. Fixed the behavior of the admin menu's links to Menus and Content Items: if they are not defined inside a recipe, they have a dynamic behavior and it causes an issue if the user defines a link for a specific content type inside the admin menu. In the BlogTheme, the Content Items link of the admin menu is defined in the recipe and doesn't have dynamic behavior. See the following GIF here where you can also see the creation of a new content type admin menu node that is about to list the Article content items. The new button under the new Article menu option is just about to create new Article content items. Update Blob Storage to search folder hierarchies The problem is that the method that is responsible to handle Blob Storage items does not correctly implement the includeSubDirectories = true option - it never did. This is because it's not like a normal file system where you can make one request and list everything, so it would have to make recursive requests for every directory it finds. Ironically the media step driver does this recursion already itself, but the recipe step does not when using Include All Media. So the short term workaround should be to specify the attached fields' folder's media fields, rather than Include All Media when creating the step. This issue withincludeSubDirectories = true affects this step, and the GraphQL media query - it's the only place we use it. So, Blob storage never handled searching subfolders correctly, so this should now work for the media step, and better in GraphQL queries (behaves identically to normal file system now). Now if you would like to get the content of the directory including subfolders too, the GetDirectoryContentFlatAsync method in the BlobFileStore class will return the files inside the subfolders too. Rename Smtp admin menu to Email The goal of renaming Smtp to Email is to make sure that you can edit settings related to sending emails even if you don't know what SMTP is (and this screen is also for testing email sending). Toggle password visibility on the login form and on the setup screen The login form and the setup screen now support toggling the password visibility, so can make sure that you typed the correct passwords in these textboxes. Demos Media options admin page In the appsettings.json file, you can define your media-related settings, e.g. change the list of allowed file extensions or the path used when serving media assets. The documentation includes all the default configuration values that can be overridden. The goal of this feature is to have a read-only version of the settings where you can see these configuration values without needing to navigate to your appsettings.json file to see the configured values. Head to YouTube to check out this short recording about this upcoming feature! New custom filters in Fluid Fluid is an open-source .NET templating engine that is as close as possible to the Liquid template language. It's a secure template language that is also very accessible for non-programmer audiences. It also contains an ASP.NET Core MVC View Engine. And of course, Orchard Core is using Fluid too to generate templates. If you would like to render numbers correctly, Fluid just renders them in a format 124456789, but you could not format it like for example 12,445.68 )(and you can't do it in Liquid by default either). We already had the format_date helper in Fluid where we can use the .NET formats, so the new helpers added are format_number and format_string, which are using the .NET format methods. They are not standard in Liquid, but there is nothing in Liquid to help achieving these. format_number: It will format the number with the current culture. If you pass "N", which means number in the standard numeric format strings, then it will use the number format that we have just mentioned above. So, to generate 12,445.68 from the 12445.6789 value, you can do that like 12445.6789 | format_number: "N" You can find a documentation about the standard numeric format strings here. format_string: In this case, you can pass a string with a String.Format inside and after using the format_string you can pass the values. Let's say you have the following expression: "hello {0} {1:C}" | format_string: "world" 123. This would be rendered as hello world $123.00. Notice that here we also used the currency ("C") format specifier to convert a number to a string that represents a currency amount. The documentation of Fluid contains the available custom filters where you can learn more about the other features of Fluid too. Head to YouTube to check out the recording about the new custom filters! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 161 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!

User disabled/enabled events, filter admin menu - This week in Orchard (07/02/2020)

Orchard Core has got several new features and fixes this week! With many others, we will see the new user disabled/enabled events, the new IAreaControllerRouteMapper implementation, the way how you can filter the admin menu then show you a demo about how to integrate stripe.js in your Orchard Core application with workflows. And finally, say some words about a new tentative date and location for the upcoming Harvest! Orchard Core updates Reduce the length of indexes for Content Fields Indexing Let's focus on the LinkFieldIndex and check these two columns: the Url and the BigUrl. The Url is the one that is trimmed and indexed, and the BigUrl is the original data that is not indexed. If you are using MySQL, the maximum length that this provider can support in an index under UTF8 collection is 768. Now we set the maximum length of the indexed columns is to not be longer than the supported length. Do not check "Include all content types" in deployment step by default When you create a content type deployment step, the default is to export all types. Now, this is unchecked by default. Adding User Disabled/Enabled Events The IUserCreatedEventHandler is changed to IUserEventHandler and there are two new events: DisabledAsync and EnabledAsync events. These two new events now triggered in the UserDisplayDriver that will trigger the two newly created workflow events to make it work in your workflows. Adding IAreaControllerRouteMapper Now there is an updated way how the admin prefix is applied by using custom convention and constraint that will ensure that the admin URLs start with the admin prefix. And also ensure that it is done correctly for the controllers that are named AdminController, not the ones that start with admin. Before every controller that starts with admin could be an admin controller, but now with this new convention, it has been decided that only controllers named AdminController can be an admin controller. For example, a controller named AdminItemController doesn't fall into this category, so it can't be an admin controller. A concrete implementation being AdminAreaControllerRouteMapper that uses AdminOptions to provide a default route pattern that is used in the OrchardCore.MVC startup. Just as a reminder, if you have admin controllers you have to name them AdminController or have the Admin attribute on that. This will ensure that the URL is strictly using the admin prefix (or whatever you set it), and the user has the admin permission and this will also apply the admin theme to the views from this controller. Filter admin menu Head to Configuration -> Settings -> Admin and put a tick near the Enable Admin Menu filter checkbox. Now you will have a new textbox at the top of the admin menu with a Filter placeholder text inside it. If you type something here you can filter the menu items and could find easier the option you want. And if you hit CTRL+SHIFT+F, this textbox will get the focus and you can type the menu option that you are looking for without needing to click into this textbox. Add menus content listing and create option If you navigate to the Content option of the admin menu you will find a new one, called Menus. This feature is listing all the menus of the system, and if you can see, there is a new button, called New Menu. By clicking on this button you can create a new Menu without needed the Menu content type to be creatable. Make lists sortable with ordering setting A few weeks ago we write about a way how you can make sortable lists using the Enable Ordering setting of the ListPart and you can also find a demo on YouTube about this feature. The good news is this feature is now merged to the dev branch of Orchard Core! Checkout to the latest changeset of the dev branch and try this feature now. Then don't forget to tell your opinion about it in the comments section! Razor Helpers documentation Now there is a new page in the Orchard Core documentation that contains the extension methods that are available in Razor using @Orchard. This documentation also contains the way how to use an extension method in a view and in a controller too. Demos Stripe.js and Workflows You can use Stripe.js’ APIs to tokenize customer information, collect sensitive card data using customizable Stripe Elements, and accept payments with browser payment APIs like Apple Pay and the Payment Request API. And of course, you can add Stripe.js to your Orchard Core site too! Let's create a registration form where users can register and after successful registration, they can pay the fee for a ticket. After the user submits the form, here comes a huge workflow, that will validate all the fields of the form. Here you can see the several validations, and when there is no error, the workflow will send an email, create an Enrollment in Orchard Core and redirect the user to stripe using a Fork. And there will be another workflow that will validate the payment using the response that Orchard Core will get from stripe.js. Now let's take a closer look at the Create Content Task that creates a new Enrollment content type. When you are creating a new content type using this task, you have to write the properties of the content. This is the JSON that is used to construct the given content item. As you can see, here you can use different Liquid expressions as well, for example, we could use the data coming from the form. You can see the website using this registration form under this URL. Here just click on the Register at the top right and select from the listed options. If you would like to see the whole demo just head to YouTube and watch the recording! News from the community A new tentative date and location for the next Harvest We have another tentative date for the next Harvest: the last week of June. In this date, we could do it in Europe and in a location that is easier to go from the USA too. London and Amsterdam have airports that can be reached easily from several other countries as well. What do you think about the new date and locations? Orchard Dojo Newsletter Now we have 114 subscribers of the Lombiq's Orchard Dojo Newsletter! 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!