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

Featured tags

IIS
API
SMS
SEO
All tags >

Add a way to restart an instance of a workflow, Http Redirect to Form Location Task - This week in Orchard (17/11/2023)

Thumbnails for the media library, add a way to restart an instance of a workflow, and a demo about the Http Redirect to Form Location Task! Let's get started! Orchard Core updates Thumbnails for the media library In the media library, there are new icons and thumbnails for well-known file types using Font Awesome icons. Here, you can see the assets provided by the Blog recipe. When you are uploading a PDF or an XLXS file, you can see the new icons instead of the old ones. Add a way to restart an instance of a workflow Sometimes, a workflow instance can fail for some reason, for example, we have a workflow that sends an email and fails. It would be helpful if we could restart the instance. This change adds a button next to the Delete button named Restart. This takes the current workflow state and restarts it. As you can see here, we have a workflow called test with one faulted instance. If we hit the Restart button near the faulted instance, it creates another instance that can run successfully. To do that, there is a new RestartWorkflowAsync method in the IWorkflowManager interface, which starts a new workflow using the specified workflow definition. Each type of activity can implement custom logic when a workflow instance has been restarted because sometimes it needs to load some extra state. This can be achieved by implementing the OnWorkflowRestartingAsync and OnWorkflowRestartedAsync methods. For example, the ContentActivity now stores the content item version ID of the content item that triggered the workflow. It means when you retrigger a workflow, you can use the same version of the content item that you were dealing with before. Demos Http Redirect to Form Location Task This feature allows you to be able to put a form on a page and then somehow redirect back to that same page where we came from using a workflow. We already have a workflow task that allows us to redirect the user to a specific location, which is great if you know where you want to go back to. Like, if you want to go back to the home page, then you can always redirect the users to the home page. But what if you want to reuse the same workflow for multiple forms (or reuse the same form on multiple pages) and then when the user submits that form, go back to where they submitted the form from? There is no way to do that right now and that's where this demo came from. How can we redirect the user back to the page where they came from? Now let's create two forms, called the Q&A form and Contact Us, it doesn't matter right now. The thing that matters is they are both using the same URL to submit the form. So, we will have one workflow that will do something, then it will redirect the user back to the source form. Here, you can notice a new checkbox called Save Form Location. If we want to redirect the user back to this form, it's required to put a tick into this checkbox to store the location of the form. It's time to create our workflow! Here, you can see that the starting task of our workflow is an Http Request Event, followed by a simple Notify Task. The last task is a new one, called Http Redirect To Form Location Task. The last remaining thing to do is to set up our activities. As you can see, the Http Request Event has a new textbox with a label Form Location. It serves as a key that will be added as an entry to the dictionary of re-hydrated values provided to the initiator of the workflow, the Output of the WorkflowContext. Meaning we store the location of the source form under this key in the dictionary. As you can see, we need to use this key for the Http Redirect To Form Location Task as well. In a nutshell, the Http Request Event stores the source form's URL in a Dictionary with the provided QAContactUsFormLocation key, and the Http Redirect To Form Location Task will read the entry from the dictionary where the key is QAContactUsFormLocation. It allows us to store the location of the source form. And as always, if you would like to know more about this new feature, head to YouTube for a recording! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 485 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 1.7.1 and Orchard Core 1.7.2 - This week in Orchard (20/10/2023)

Orchard Core 1.7.1 and Orchard Core 1.7.2 have been released to address some issues of the 1.7.0 release. In our current post, we will check out everything that you should know about the latest release of Orchard Core! Check out our post for the details! Orchard Core updates Fix workflow page list issue when using PostgreSQL When a new Orchard Core 1.7 application using PostgreSQL is started, the Workflow page (/Admin/Workflows/Types) gives an error when opening. This error happened after upgrading a 1.6 project using PostgreSQL to 1.7. If you did a clean installation via the Orchard Core repo, you encountered this error again when using PostgreSQL. If you are using SQLite, this problem does not occur. The issue was in the following query that caused problems with PostgreSQL: "SELECT DISTINCT WorkflowTypeId FROM \"WorkflowIndex\"" After the fix, the query looks like the following: "SELECT DISTINCT \"WorkflowIndex\".\"WorkflowTypeId\" FROM \"WorkflowIndex\"" Set index length limit for MySQL Multiple exceptions were thrown when you started a new MySQL-based instance of Orchard Core 1.7, and of course, the expected behavior is to start the application successfully without any exception. The issue was the following. An index entry in MySQL can't contain more than 3072 bytes. With the current default utf8nb4 collation, this accounts for 768 chars. This means that all the fields that make up an index entry can't go over that, but only in MySQL. MySQL has a custom syntax to define the prefix size of an index, meaning the amount of data to use for each field. For instance, we can limit the Alias field size in the index with CREATE INDEX ... (DocumentId, Alias(50), ...), and then it would only take the first 50 chars even if the content is bigger. This way, we can have limits on the content itself, MaxAliasSize, but a distinct max size for the index. And we wouldn't need to constrain the field size to the index size for MySQL. In YesSql the columns names are injected as-is in the SQL Query:https://github.com/sebastienros/yessql/blob/c0771eb555c67bf419859016cb3563a3540fe7c7/src/YesSql.Core/Sql/BaseComandInterpreter.cs#L233 So, if we change the current migration to something like this, this would work as long as the sum of these constraints is less than 767 chars. SchemaBuilder.AlterIndexTable<AliasPartIndex>(table => table .CreateIndex( "IDX_AliasPartIndex_DocumentId", "DocumentId", "Alias(123)", "ContentItemId", "Published", "Latest")); News from the community Orchard Core 1.7.1 and Orchard Core 1.7.2 Orchard Core 1.7.2 was released a few days after the 1.7.1 one to address some issues of the 1.7.0 release. If you open up nuget.org and search for the OrchardCore.Application.Cms.Targets package, you will find the newest released version of Orchard Core! Upgrade your solution to 1.7.2 now! Feel free to drop on the dedicated Gitter chat or use the Discussions on GitHub and ask questions! Let's just quickly list the fixes that have been addressed in the latest release. If you click on each, you will be redirected to the related This week in Orchard post, where you can find more details about them. Position the modal over the navbar Two alerts are displayed in admin settings to reload the current tenant Add a fallback function to crypto.randomUUID Fix workflow page list issue when using PostgreSQL (current post) Set index length limit for MySQL (current post) Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 491 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!

New Catch Workflow Fault Event, interactive mode in the Lombiq UI Testing Toolbox - This week in Orchard (01/09/2023)

New Catch Workflow Fault Event, add additional text info to the Content Picker Field, and a demo about adding an interactive mode to the Lombiq UI Testing Toolbox! Check out our post for the details! Orchard Core updates New Catch Workflow Fault Event If you have the Workflows feature enabled, you can create workflows by clicking on the Workflows option from the admin menu. Here, you can create workflows and add events to your workflows by clicking on the Add Event button. In the list of available events, you will find a new one, called Catch Workflow Fault Event, that triggers and captures exception information when an exception occurs in any other workflow. If you select this event, you will find a text area called Trigger Condition, and the code inside it is automatically generated when you open the editor of the Catch Workflow Fault Event for the first time. Add additional text info to the Content Picker Field Let's play around a little bit with a site that we set up using the Blog recipe. First of all, we want to have an option where users can assign pages to blog posts, like "if you need more info, check out this page, or click here for this related content, and so on.". To do that, we can utilize the Content Picker Field. If we navigate to Content -> Content Definition -> Content Types and hit Edit near the Blog Post content type, we can find the Add Field button. By clicking on it, we can set the display name (let it be Related pages in this case) and select the field type (Content Picker Field). Now we can click the Edit button near our new Related pages Content Picker Field and do the magic here. We set up this field to allow multiple elements to be selected and said that we only want to choose from Page content types when working with this field. But the new stuff is the Title Pattern editor. Here, you can define the pattern used to render the title with Liquid support. Here, you can see that this field renders the Display Text of the content items by default (keeping the current behavior), but you can modify this as you want. This can be a huge help for other users because, for example, using only the display name has become a problem for multilingual sites with pages named "blog" in multiple languages. Here, we modified the pattern to include the display URL too, not just the display text of the content items. And now, the last step is to try this out in action! We will just simply edit the predefined blog post and click on the Related pages Content Picker Field to see what will happen. As you can see, we have two Page content items on our site where we used the sample display name. It's hard to distinguish the content items but by seeing the URL too, we have an idea which Page could be which one. OK, maybe we are not using the best URLs for illustration, but I think you get the point here. :) Demos Interactive mode in the Lombiq UI Testing Toolbox Maybe you have already heard about the Lombiq UI Testing Toolbox, our web UI testing toolbox mostly for Orchard Core applications. Everything you need to do UI testing with Selenium for an Orchard app is here. We wrote about it several times here as well, first when we open-sourced it, when we added some Orchard Core Features tests to it when we added the automated monkey testing feature to it, and when we introduced the Visual verification testing. At the end of last year, we showed you the latest updates about integrating UI testing into Orchard Core and the way you can use WebApplicationFactory or a fake video capture source. This time, we will check out a slightly different topic! Basically, the Orchard Core process and the UI testing process are running together, you can't actually do testing and continue running the web application itself. So, for that, we have a new method called SwitchToInteractiveAsync, which enables the interactive mode for debugging the app while the test is paused. If you run the test, you are able to pause at that point, like hitting a breakpoint when debugging the code. So, sometimes you want to debug the test session, and assuming direct control would be nice. But you can't just drop a breakpoint in the test, since the Orchard Core web app and the test are the same process so it would pause both. The SwitchToInteractiveAsync extension method opens a new tab with info about the interactive mode and, then causes the test thread to wait until you've clicked on the "Continue Test" button in this tab. During that time, you can interact with OC as if it was a normal execution. If you open up the InteractiveModeTests.cs file, you will find a demo of the feature with two tests: SampleTest and EnteringInteractiveModeShouldWait that illustrates how you can use the new SwitchToInteractiveAsync extension method. If you want to know more about this feature, head to YouTube for a recording! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 535 subscribers! We have started this newsletter to inform the community around Orchard of the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post is published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news about Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting!

Add support for user phone number, SMS support and two-factor authentication using SMS service - This week in Orchard (25/08/2023)

Add support for user phone number; add styling to Pager in TheAdmin theme, and a demo about SMS support and two-factor authentication using SMS service! Check out our post for the details! Orchard Core updates Add support for user phone number Currently, we do not support PhoneNumber in the UserStore, which is supported in the default identity implementation, and it's a nice feature to have if you are implementing an application that requires the user to enter and confirm their cell phone number, similar to the way email verification works. The latter is easy since UserStore implements IUserEmailStore, but when using UserManager.GenerateChangePhoneNumberTokenAsync, the call fails with a NotSupportedException: Store does not implement IUserPhoneNumberStore<TUser> exception. From now on, UserStore implements IUserPhoneNumberStore, updating User accordingly by adding a Phone property. This means a phone number is now supported in the UserStore and the User object. Let's see what the new field looks like in the user's profile! If you navigate to Security -> Users and hit the Add User button, you will find the new Phone Number field there. You may notice a black exclamation icon at the end of the editor, meaning that the phone number for this user is unverified. Add styling to Pager in TheAdmin theme This change is about improving the look and feel of the Pager across the admin UI. New views in TheAdmin theme were added to style the pages at the theme level, no base shapes were altered. The pager looked like this: And after this change, it looks like this: Demos SMS support and two-factor authentication using SMS service In this demo, you can see a brand-new feature for Orchard Core, the SMS module. This module provides you with a way to have SMS services on your site, and then you can do whatever you want with them. There are actually three features around it, and we will check out all. SMS: Provides settings and services to send SMS messages. Two-Factor SMS Method: Provides users a two-factor authentication method through an SMS service. SMS Notifications: Provides a way to send SMS notifications to users. Let's enable all of them, and after that, you will find a new option under Configuration -> Settings, called SMS. Here you can configure your provider. You can choose from Log and Twilio. If you select the Log one, any message that is sent through the SMS provider will be just printed in the log files, like: "A message with the body {body} was set to {phoneNumber}". You can implement your own provider, but by default, we provide you with Twilio. Twilio is probably the most commonly used service. If you select it, you can configure it with the information that is coming from your Twilio account. So, this is the SMS module, and to build more on top of it, here comes the Two-Factor SMS Method feature. If you enable it, you can navigate to the Security settings, and add the new SMS authentication as a new two-factor authentication method. To do that, you have to verify your phone number, and you will get a verification code that you have to apply. The third feature is called SMS Notifications. With this module, you can actually deliver notifications through SMS. If you enable this and you can go to your user profile (Security -> Users), you will see another notification method here which is called SMS Notifications. And if you have the Workflows feature enabled, you can utilize a new task, called Send SMS, meaning you can send SMS messages directly from the workflow. If you want to know more about this feature, head to YouTube for a recording! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 520 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!

Improve workflows page load time, Cloudflare CDN and protection for all DotNest sites - This week in Orchard (18/08/2023)

Rename Microsoft Azure Active Directory to Microsoft Entra ID; improve workflows page load time, and announce Cloudflare CDN and protection for all DotNest sites! Let's see the details in our post! Orchard Core updates Rename Microsoft Azure Active Directory to Microsoft Entra ID A few weeks ago, Microsoft announced significant milestones for identity and network access, including the news that Microsoft Azure Active Directory (Azure AD) is becoming Microsoft Entra ID. We have Azure AD integration in Orchard Core, and in order to authenticate users with Azure AD, you must enable and configure the OrchardCore.MicrosoftAuthentication.AzureAD and the OrchardCore.Users.Registration features. You can read more about the details here. So, due to Microsoft's recent rebranding, Azure AD has been renamed to Microsoft Entra ID. This only concerns UI labels and documentation, but technical identifiers remain, so you shouldn't expect anything breaking. Improve workflows page load time It takes several seconds to load the /Admin/Workflows/Types and /Admin/Workflows/Types/{TypeId}/Instances pages when there are a fairly large number (testing size: 500_000) rows in WorkflowIndex. There is a line in WorkflowTypeController that goes through the whole table of WorkflowIndex to then calculate (group by) in the code how many workflows are there per each type. In WorkflowController line 124 with the await query.CountAsync() it is for the same purpose but for only one workflow type, but this uses some additional joins which makes it even slower. You can easily reproduce this by having a fairly large number of finished workflows. Load the workflows page, or the type-specific workflow item list page and see that it takes several seconds to load. This issue has been fixed by removing the counting of each workflow type on the workflows listing page. And on the workflow instances list page changed to only fetch the document table for the workflows that are on the current page. News from the community Cloudflare CDN and protection for all DotNest sites Last week you could read that we published a case study about migrating the content of an old version of an Orchard Core website with a custom theme and modifications in the business logic of the Orchard Core Commerce module to DotNest. You can check out the case study here about how we achieved this with Ik wil een tart, a confectionery in the Netherlands! And now all DotNest sites are protected and sped up by Cloudflare! Head to the DotNest blog and check out the details here! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 505 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!

Elsa Workflows, Orchard Harvest Online - This week in Orchard (02/06/2023)

Thank you, everyone, for taking part in Orchard Harvest Online, and thanks to the presenters for their great presentations! Check out our current post for a short summary of the conference; a demo about Elsa Workflows and many more! Orchard Core updates Admin Dashboard widgets are not scrollable when the content is long Last week we mentioned several improvements regarding the Admin Dashboard and the Admin Dashboard widgets. And we have another improvement for this week too! Currently, the Admin Dashboard widgets are set to hide any horizontal and vertical overflow. This works well when you can control the content of your widget based on specifying the best height/width of each widget. Sometimes you may want to create a widget without being able to control the length. For example, recent contents/posts, most viewed contents, etc. All these examples of a widget with uncontrollable content. In that case, it does not make sense to hide the overflow content vertically. We can still hide the horizontal overflow and the widget since that is something each widget can design for. But the vertical overflow should be set to auto. You can reproduce this behavior easily by creating a widget that lists the last 10 content items and making the size and the width of the widget 1 x 1. That's what you can see on the left side of the screen. And as you can see, when setting the vertical overflow to auto, we get a scroll bar for the widgets when the content is larger than expected. Fix the notifier cookie path Let's say we have an Orchard Core site installed as an application under the default website in IIS. What this means is that we access the site with the following URL: https://localhost/orchard. The problem is that the notifier cookie uses the tenant prefix as the cookie path. For example: For the default tenant, https://localhost/orchard, the notifier cookie path is set to / when it should be set to /orchard. For another tenant, let's call it tenantA at https://localhost/orchard/tenantA, the notifier cookie path is set to /tenantA when it should be set to /orchard/tenantA. Technically, scenario 1 still works, since cookies with a path of / can still be seen by /orchard. Even though the path isn't exactly what it should be, the notification still appears. The problem is in scenario 2, since the cookie path is being set to /tenantA but /orchard/tenantA can't see that cookie, and the notification doesn't appear. After applying this fix, the notification works for tenantA using /orchard/tenantA. Demos Elsa Workflows Elsa Core is a workflow library that enables workflow execution in any .NET Core application. Workflows can be defined using code and using the visual workflow designer. We mention Else here because Elsa is an innovative workflow engine derived from Orchard Core's Workflows module. It was born from a requirement of a project where they didn't want to base it on Orchard Core, but they did want to have Workflows. So, the goal here was to create a reusable designer that you can host/use in your own dashboard application. In this demo, Sipke Schoorstra, one of the main contributors of Elsa shows you everything that you need to know about Elsa Workflows. Head to YouTube for this exciting demo! News from the community Orchard Harvest Online We had the first online Orchard Harvest last Wednesday, and it was so great to see that we had 188 sign-ups for the conference! It was an excellent opportunity to share knowledge, talk about development plans and ideas, and foremost, meet the rest of the worldwide community. The conference was started by a Keynote from Sébastien Ros and followed by a talk from Andrii Chebukin about how you can use Orchard Core Framework for multi-tenancy apps. After that, Zoltán Lehóczky showed us how you can use open-source tools in the following areas: CI builds, static code analysis, unit and UI testing, and telemetry collection. And just before the breakout sessions, you can see a great session by Peyton McManus about why they selected Orchard for their new application. How his team has leveraged Orchard to rebuild and re-imagine the application, and how they will continue to leverage Orchard for their set of features. In the breakout sessions, the attendees had a chance to meet the speakers and other community members. Each speaker had a breakout room where the attendees asked questions and discussed the topic of their talk, or anything else Orchard Core related. After the break, we could see a talk from Hisham Bin Ateya about exploring different parts of localization stuff in Orchard Core. After that, Dávid El-Saig described the Orchard Core Commerce project's state and showed the current features. And the last talk was from Sipke Schoorstra where he provided an overview of Elsa Workflows' features, compared it to Orchard Core Workflows, and discussed integration possibilities. And of course, we recorded every session, which means they will be available on YouTube soon! Don't forget to follow our This week in Orchard newsletter to be informed about the recordings! That was a blast! Thank you everyone for taking part and thanks to the presenters for their great presentations! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 464 subscribers! We have started this newsletter to inform the community around Orchard of the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post is published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news about Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting!

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

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

Orchard Harvest 2023, User Notifications - This week in Orchard (28/10/2022)

Adding default form templates for the Default Theme, adding wrapper element for all content fields, demo about the User Notifications module and don't forget to fill out a survey about the next Orchard Harvest conference! Orchard Core updates Adding default form templates for the Default Theme Currently, all of the form widgets are rendered using Widget.cshtml which renders too much HTML without any added value. The goal here is to create default Widget-Form, Widget-Input, Widget-Label, Widget-Select, Widget-TextArea, Widget-Validation, and Widget-ValidationSummary templates. It means that now, you will find these default form templates if you open up the Default Theme. Adding a wrapper element for all content fields There is no easy way to hide/show content fields "label and input as a group" using JavaScript event because there is no wrapper element to select. The goal here is to add a wrapper element to all of the content fields to allow the user to easily hide/show the entire field block using JavaScript. Here you can see the editor of the Text Field where the wrapper has now new classes with ones that you can easily use to distinguish the same kinds of Text Fields from each other. For example, the Text Field called Subtitle of the built-in Blog Post content type has the following HTML structure. Here you can see that the third class and the ID contain the technical name of the Text Field, which makes targeting the given field easier. Adding GetPageSize method to account for MaxPageSize throughout the code Now we have a new GetPageSize method in the PagerOptions class that returns the maximum number of the allowed page size based on the values of the default and maximum page size numbers. And we are using the value coming from this method for every occurrence, where we are constructing the Pager by passing it as the second parameter. Which is the default page size in this case. Demos User Notifications The goal of the User Notifications module is to push notifications to the user, meaning notify the user somehow. There are many ways you can notify a user, one of them being a web notification, you can do SMS, you can do push to a mobile application, etc. In Orchard Core right now, there is no way to send notifications, but there is a way to send emails. Let's navigate to Configuration -> Features and enable the Notifications module. This will provide a way to notify users. After you enable this module, you will see a new bell icon near the Dark mode icon at the top right. If you click on that icon, you will see a list that shows you all of the notifications that you have right now. You can click on them to mark them as read, or you can click on All Notifications at the bottom, which will redirect you to the page where you can see all of your notifications. Here you can see a list of all of the notifications available. You can use the search here, and filter them only to see the read or the unread notifications. You can sort by recently created, or by previously created. You can also mark the unread notifications as read, mark the read notifications as unread or you can delete the notifications as well. You can also hit the Mark All As Read button to mark everything as read. Now let's see how you can generate notifications! Notifications can be generated via code by injecting INotificationManager. But you can also generate notifications via Workflows. Here you can see we have a workflow called Notify Content Owner, which contains the custom activities provided by the Notifications module. Here we put two events, one for when the Blog Post content item is published and one for when the Article is deleted. And here, you can also see the two new Notify content's owner activities as well. Let's check out the content of the first Notify content's owner activity! Here you can see we have proper Liquid support to customize the summary, and the body of our notification. If we open up the editor of the second Notify content's owner activity, you can see here we have some HTML code in the body as well. To be able to render the HTML properly, don't forget to put a tick in the "The body contains HTML" checkbox. And that's not everything! If you would like to know don't forget to check out this recording on YouTube! And if you want to try out this feature for yourself, you can find the code in this PR! News from the community Orchard Harvest 2023 For those who are too young to remember, we had Orchard conferences, called Orchard Harvest. And the conference website was available under orchardharvest.org, but unfortunately, it's not anymore. The last one was in 2017 in New York. So, having another get-together is very much overdue. If you would like to see or get a feeling of how this looked like before, we have a couple of mood videos on the Orchard YouTube channel, like this one from the first conference. The point is that we should really think about organizing the next one, and we at Lombiq can take part in that or provide an organizing role with anybody who wants to take part. If you have any feedback or are you looking forward to having a Harvest again, please share your opinion with us by filling out this survey about the upcoming Orchard Harvest! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 381 subscribers! We have started this newsletter to inform the community around Orchard of the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post is published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who you think would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news around Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting!

Categorized tenants, Automated monkey testing in the Lombiq UI Testing Toolbox - This week in Orchard (20/02/2022)

Categorized tenants, change the Script Task to use Monaco Editor, update logos to NuGet packages, and automated monkey testing in the Lombiq UI Testing Toolbox for Orchard Core are the topics of this week. Interested in the details? Check out this post for the details! Orchard Core updates Categorized tenants Now you can have a Category on the Tenants page and filter tenants by category. If you want to try this out, just set up your site and make sure you have the Tenants feature enabled. Now head to Configuration -> Tenants on the admin UI and add some tenants by clicking on the Add Tenant button. Here you can see we added three additional tenants and used Category A and Category B as the category for these tenants. You can filter the list by the available categories just by clicking on the Category dropdown near the State one. Change the Script Task to use Monaco Editor If you enabled the Workflows feature, you have the option to use Workflows. You can add a Script task to your workflow that executes a script and continues execution based on the returned outcome. And the Script Task now uses the Monaco Editor instead of the CodeMirror one. New branding icons for Orchard Core projects templates and new logo to NuGet packages Now the branding icons are updated for project templates. And now we use the new logo for the NuGet packages because the packages had the default logos. Demos Lombiq UI Testing Toolbox for Orchard Core - Automated monkey testing When you are developing your software, you are always in the mindset that you actually know what your software is doing, how it works, what are the limitations. And with experience, you learn to anticipate different user behavior. Let's say that you are in the Orchard admin, and when you want to edit a content item, you know that you have to click on the Content option, and after a tiny delay, you will see a list that contains an element called Content Items. If you click on the Content Items, you will see a list of the content items. You know that you can edit a given content item by doing a single left click on the display text of the content item by default. Because it looks like a link, and you just have to click once. And if you want to save a content item, you still need to click once on the Publish button, for example. But a lot of people actually will do a double click on the Publish button. Long story short, there is a difference between what the developer can think of how users will use a piece of software and what users in the real world will actually end up doing. What you can see in this demo is about introducing monkey testing in the Lombiq UI Testing Toolbox for Orchard Core. It was done mostly by Yevgeniy Shunevych, who is a developer working a lot on automation and automated testing, including his UI testing framework called Atata. What we have done is that we used gremlins.js for automated monkey testing. Monkey testing is about random interactions. The library unleashes random interactions onto the software, and it will try to break it. If it can, then we found a bug, we can fix it. Now it's time to check it out quickly! Lombiq's Open-Source Orchard Core Extensions is an Orchard Core CMS 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 are 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). This solution contains the Lombiq UI Testing Toolbox as well, so we will use this one for the demo. Here we have an example for monkey tests as well, just find the MonkeyTests.cs file in the Lombiq.Tests.UI.Samples project. It's supposed to be very easy to use because the point is that you use this for features that you really want to break. The easiest way is to just test one particular page, that will do these random interactions on just that page. If it leaves the page, it will stop. And since it's random, every time it might be different, and to be able to produce deterministic repeatable results, it's also possible to provide a random seed which we have done here. But you can do the same just by using the MonkeyTestingOptions configuration class. You can find a method called TestCurrentPageAsMonkeyRecursivelyAsync. This means it won't stop if it leaves a certain page or if it leaves the page it starts with and will continue to test every page until it either finds a bug or if it runs out of time because you can also specify how much time it will spend on a single page. And if it leaves that page and comes back to the same page, it's still from that same time. Now let's see what will happen if you actually run a given test. You can easily run a monkey test by using the Test Explorer window of Visual Studio and finding a test under Lombiq.Tests.UI.Samples/Lombiq.Tests.UI.Samples.Tests/MonkeyTests. How it starts is like a standard UI test. First, it runs the setup, and if you have multiple tests just as before, it can reuse the same snapshot from the site that you have run the setup for. After, it will open the page and log in to the admin. And then you see it clicks everywhere, typing different kinds of keys and so on. This goes on until the time runs out. And that's not all of it! Do you want to know more about this new addition to the Lombiq UI Testing Toolbox for Orchard Core? Then check out this recording on YouTube! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 238 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!

Fluid updates, Better NRE handling for Widget and MenuItem stereotypes - This week in Orchard (07/01/2022)

Topics for this week are the Fluid updates; better NRE handling for Widget and MenuItem stereotypes; allowing sending emails without "To" if "Cc" or "Bcc" is provided. Do you want to know more? Then check out our post now! Orchard Core updates Allow sending emails without "To" if "CC" or "BCC" is provided Let's say you have a system to send emails to many recipients at once and want the recipients to be in the BCC header instead of the To one. The email module of Orchard Core was required to have at least one recipient in the To header, so, the scenario described above cannot be implemented in Orchard Core. The solution for this is that now you can send an email without a recipient in the To header. The mail message should have at least one of these headers: To, CC or BCC. Here you can see the editor of the Send Email task where we provided an email address for the BCC header but kept the To and the CC headers empty. Fluid v2.2.8 In Liquid, you can have an identifier that starts with a number like: {% assign 1st = "first" %} {{ 1st }} It was not easy to parse, but now Fluid supports this one with version 2.2.8. And just a note here. If you navigate to the Liquid Sandbox of Jumpseller, you can find a sandbox that is using Liquid but in Ruby, which is the actual implementation of Liquid. You can use LiquidJs to test, but that is a custom implementation in JavaScript, so it might not be as true as the Ruby implementation. Better NRE handling for Widget and MenuItem stereotypes As you may guess, the NRE handling is about catching the null reference exceptions and showing proper error messages instead of displaying the "An error occurred while executing this request.". What were those errors? For example, follow these steps: Create a new content type with stereotype = MenuItem. Add a menu item of that type to a menu. Delete the content type created in step 1. Go back to the menu you created in step 2. Observe a Null Reference Exception. Here we created a new content type with the MenuItem stereotype called NewContentType. The site that we are using was set up by using the Blog recipe, so we have the Main Menu admin menu where we can easily add menu items by just clicking on the Add Menu Item button. And if we delete the NewContentType and navigate back to the Main Menu, we will see the following messages instead. News from the community Lombiq's Open-Source Orchard Core Extensions now updated to Orchard Core v1.1 Looking for some useful Orchard Core extensions? Here's a bundle solution of all of Lombiq's open-source Orchard Core extensions (modules and themes). Clone and try them out! This is an Orchard Core CMS 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 are included which use the latest released version of Orchard (i.e. the very cutting-edge ones depending on a nightly build are not yet here). And this project, with all of our Orchard-related projects, is now updated to Orchard Core v1.1! Check it out here! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 235 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!