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

Featured tags

IIS
API
SMS
All tags >

Azure Email Communication Services feature, Shortcode for cache busting - This week in Orchard (08/12/2023)

Shortcode for cache busing, update the Admin Dashboard documentation, and a demo about the upcoming Azure Email Communication Services feature! Let's get started! Orchard Core updates Update the Admin Dashboard documentation The documentation page for the Admin Dashboard has been updated with details about how to create custom widgets that you can add to the Admin Dashboard. You can also read about the customizable settings of these widgets and the options that you can use if you wish to modify the look of your widgets. Shortcode for cache busting There was no option to add a Shortcode for cache busting. For reference, you can add cache busting in a cshtml file like this: @Orchard.AssetUrl(assetPath: path, appendVersion: true). So, if somebody used an image in (for example) an HTML Body part, there was no way to add cache busting with a Shortcode. The goal of this improvement was to add a Shortcode that allows cache busting. The Shortcodes page of the documentation lists the available Shortcodes in Orchard Core. This contains the Demos Azure Email Communication Services feature Azure now has a new set of resources under the Communication Services (ACS) umbrella, Email Communication Services being one of them. This is a cheaper, Azure-native alternative to SendGrid. The primary way to use it is not through traditional SMTP-server configuration, but a connection string (of two components, endpoint, and access key) provided by the ACS resource, which allows access to the specific communication service resources attached to it (for example, an Email Communication Services instance). This requires a custom implementation to send emails using the corresponding SDK. OrchardCore.Email doesn't seem to support this scenario at its current state and needs a bit of refactoring (can take inspiration from the structure in O1 for better extensibility). Now let's see the current state of this feature that you can also check out in this PR! First, we need to enable the Azure Email Communication Services feature that configures email settings and a default email service based on (ACS) under the Configuration -> Features option from the admin UI. After that, you will find a new option under Configuration -> Settings -> Email, called Azure Email Settings. Here, you can see the Default Sender and the Connection String values. The Default Sender can be set up under the Email Settings menu item or use the appsettings.json file. The Connection String can be set up using the appsettings.json file. And if you are interested in how to use this feature from code, you can see a unit test for this in the AzureEmailServiceTests class. As always, if you would like to know more about this upcoming feature, head to YouTube for a recording! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 487 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!

Hide the "New" option if they are not authorized to edit, UI testing PoC with the Lombiq UI Testing Toolbox - This week in Orchard (04/03/2022)

This week you can read about hiding the "New" option from the admin UI if they are not authorized to edit, changing the content of the built-in recipes, and a demo about a UI testing PoC with the Lombiq UI Testing Toolbox! Are you interested in the details? Check out this post for more! Orchard Core updates Hide the "New" option if they are not authorized to edit If you have a list content type (e.g., Blog) with the contained type (Blog Post) and the user doesn't have Edit Blog Post permission, they still see the New Blog Post button on the Blog editor. Note, that the user has permission to edit the Blog. And it was a bug that could be reproduced by just following some simple steps: Create a Blog Post content type. Create a Blog content type with a ListPart containing the Blog Post type. Update the Moderator role: set Edit for Blog but don't set it to Blog Post. Create a test user and associate them with the Moderator role. Log in with the test user and create a Blog. Observe that the New Blog Post button appears on the top-right corner, but you'll get a 403 when you click on it. The solution was just to similarly to the Content list page authorize the user to edit the types so if they are not authorized to edit, then hide the New option. Remove FileContentDefinition from recipes Last December, the community decided to do not to enable the File Content Definition feature by default. And by doing that, the OrchardCore.Contents.FileContentDefinition usage was removed from the Agency and Blog recipes. It's only useful in specific cases, and most of the time you need to turn it off. The same issue is there with the Headless and Blank recipes. Especially for the Blank recipe, there is no reason to include anything apart from the bare bones. The solution was just to remove the OrchardCore.Contents.FileContentDefinition enables a step from the two recipes. Demos UI testing PoC with the Lombiq UI Testing Toolbox In this demo, we will talk about this particular pull request, which is about a proof of concept. 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, and some weeks ago, you could read about the automated monkey testing feature of the toolbox. So, what about trying out this toolbox in Orchard itself, and let's see whether it works and whether it can be useful. Of course, we have Cypress tests in Orchard Core, so this will be something with the same goal - not necessarily useful, not necessarily wanted to add - it's a proof of concept. Let's see how it looks! If you check out the mentioned pull request, you will find a new OrchardCore.Tests.UI project which references the UI Testing Toolbox. It contains a couple of classes, the main point here is the BasicOrchardFeaturesTests one. As you can see, this contains two xUnit test methods. The first is just running the TestBasicOrchardFeaturesExceptRegistrationAsync method, which tests all the basic Orchard features except for registration with the Blog recipe. You can specify the recipe itself with several other options like enabling accessibility checks. The second test is a failing test that you can check out on the CI. It's a usual Dotnet test execution, so you get a test summary in the end. You can see what the test did, and you can find the exact reason why this test failed (because it's cannot find the element by the navbar ID on a given page). If you go to Summary and check out Artifacts, you can download a file that contains the whole dump of the application with screenshots, HTML output, the Orchard logs, everything that you may need for troubleshooting. And, of course, you can also execute the test from Visual Studio as usual. The next steps here would be to: Recreate the Cypress tests so we can see how it compares. Most possibly, this would be running TestBasicOrchardFeaturesExceptRegistrationAsync with all recipes. Using WebApplicationFactory directly instead of running the tested app with the Dotnet CLI would be useful. What's behind TestBasicOrchardFeaturesExceptRegistrationAsync would potentially need to be copied to be serious here, since if something changes in Orchard deliberately, it can fail. If you would like to know more about this PoC, head to YouTube for a recording! News from the community War in Ukraine and Lombiq War in Ukraine and Lombiq: How does it affect us at Lombiq and what we're doing to help: https://lombiq.com/blog/war-in-ukraine-and-lombiq 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 Orchard meeting!

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

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

Admin Dashboard Widgets, GitHub Issue Templates - This week in Orchard (24/01/2021)

This week we will see the new issue templates in GitHub, the new View Media Options permission, and have a demo about a nice upcoming feature called Admin Dashboard Widgets! Check out our current post for more! Orchard Core updates Adding documentation for Resources Libraries If you navigate to the OrchardCore.Resources project and open the ResourceManifest.cs file there you can see the list of the resources used by Orchard Core by default. That means if you would like to use jQuery for example in your site, you don't have to add this resource again from your theme or module because Orchard Core already has it. The goal of this table in the documentation is to collect all the used libraries with their versions. New View Media Options permission You can use the appsettings.json file to configure different media options like the supported sizes, allowed file extensions, and so on. But if you don't remember the exact values off the top of your head you had to open the appsettings.json file to check out the configuration values. To solve this issue, you can just easily navigate to Configuration -> Media -> Media Options that means you just need the admin UI of Orchard Core to see the values. And now you will find new permission called View Media Options that can be used to control who can be able to view the content of this site. GitHub Issue Templates If you found a bug while using Orchard Core or you just have a suggestion or an idea to make the CMS better, feel free to add a new issue on the GitHub page of Orchard Core. All you have to do is to select the Issues tab and click on the New issue button. This will navigate you to a new page where you can select what kind of issue you would like to submit. You can see three different kinds of options here: Bug report, Feature request, and Discussions. If you select the Discussions one, you can start a new discussion. GitHub Discussions is a collaborative communication forum for the community around an open-source project. Community members can ask and answer questions, share updates, have open-ended conversations, and follow along on decisions affecting the community's way of working. Check out the existing discussions related to Orchard Core here! But if you found a bug or have a new feature request, select from the first two options. If you do that, you will be redirected to these pages. Here you can add your issue by using nice issue templates that help us to investigate the given bug, like how can we reproduce your issue. Or if you have a feature request, the template could help us to understand better what is the problem that can be solved by adding this new feature to the system. Feel free to try out and use them when submitting new issues! Refactor media tokens This is about replacing the used Data Protection to encrypt tokens, as the encrypted token changed every server restart (because of course encryption should never produce the same value twice, for a given input). This caused the browser and/or CDN to refresh all the images every time the server is restarted/deployed. The is-cache wasn't affected by this, just the browser/CDN caches. Demos Admin Dashboard Widgets A few weeks ago we wrote about an upcoming new feature called Admin Dashboard that allows you to add cards to the homepage of the dashboard, which is about to represent a piece of functionality of a given feature or module. This feature is still under development and it has changed in the meantime a lot, so it's time to check out the newest improvements! First of all, go to Configuration -> Features and enable the Admin Dashboard feature. If you do that, you will see the following screen when you navigate back to the homepage of your dashboard. You can see one predefined card here with the title Orchard Core, and at the bottom of the card, you can see an Edit and a Delete button. Let's click on the Edit one! As you can see this is an Html Dashboard Widget content type with a Title Part and a HtmlBody Part attached. But under that, you can see a textbox called Position. By using that setting you can control the order of your widgets on the dashboard. We have just this one, so whatever you type here, this will be rendered as the first widget. If you click on the Add Widget button on the dashboard, you can create as many other Html Dashboard Widgets as you want. But now let's look under the hood and see how you can create custom dashboard widgets! Navigate to Content -> Content Definition -> Content Types and create a new type, call it Markdown Dashboard Widget. Add the Title Part, the Markdown Body Part, and the Dashboard Part to it. The Dashboard Part is the one, that you will need to attach to every content type that you would like to mark as a dashboard widget. By using that part you can set the Position of your widget. And the final thing you have to do is to set the stereotype of your content type to DashboardWidget. Now let's get back to the dashboard of the admin UI and select the Markdown Dashboard Widget after clicking on the Add Widget button. As you can see, if we set the position to 1, it will be rendered after the predefined one with the title Orchard Core. If we modify the value of the position, we can change the ordering of the widgets. But that's not all! Head to YouTube now to see a video about this upcoming new feature! News from the community Execute an Orchard Core shape into HTML sample in the Lombiq Training Demo for Orchard Core The Lombiq Training Demo for Orchard Core is a demo Orchard Core CMS module for training purposes guiding you to become an Orchard developer. You can use this module as part of a vanilla Orchard Core source that includes the full source code - which is the recommended way. You can also use it as part of a solution that uses Orchard Core NuGet packages, however, it's harder to look under the hood of Orchard Core features. And now the module just got a new sample about how to execute an Orchard Core shape into HTML! Check it out now if you're learning Orchard and you haven't seen this feature yet! 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 185 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!