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 >

Leverage CSPROJ meta information, Lombiq Helpful Libraries - Navigation for Orchard Core - This week in Orchard (29/04/2022)

Adding an AppSetting option to disable SQLite connection pooling, leveraging your CSPROJ meta information and news and updates around the Lombiq Helpful Libraries! Check out our current post to read about the details! Orchard Core updates Remove Lucene from built-in recipes This is about making the built-in setup recipes lightweight: Lucene is a feature that you don't need on every site, especially due to it storing files on the local file system that need to be preserved (i.e., not temp files) it needs special considerations for hosting (you need to take care of those files when moving the app between environments and doing deployments). The goal here is to not enable Lucene by default in the following recipes: Headless: just remove it. Blank: just remove it. Blog: Create an SQL RecentBlogPosts Query and don't enable Lucene by default. Have a separate, non-setup recipe to set up the search just for a frontend search page (i.e., 90% of what happens related to Lucene in the recipe now). Have a second non-setup recipe that runs the previous one and also swaps out RecentBlogPosts with a Lucene Query. And from now you can find two new optional recipes in the TheBlogTheme: Lucene Query Recipe: this recipe runs the Blog Lucene Search recipe and as an example, the recipe replaces the RecentBlogPosts SQL query with a Lucene query. Lucene Search Recipe: this recipe enables the Lucene feature and creates the Search setting, Lucene indices, and permissions. The Recipes and Starter Themes page of the Orchard Core documentation has also been updated to reflect these changes. Leverage CSPROJ meta information Out of the box, a Manifest.cs file is generated, which includes the ModuleAttribute, FeatureAttribute, ThemeAttribute, and so forth, that describe the Orchard Core meta-information about your projects. However, let's say you want to connect available meta properties at the CSPROJ level, i.e., such properties as $(MSBuildProjectName), $(AssemblyVersion), $(PackageTags), to name a few. At its core, you may want to follow a pattern similar to InternalsVisibleTo, i.e. <ItemGroup> <AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo"> <_Parameter1>Test.$(MSBuildProjectName)</_Parameter1> </AssemblyAttribute></ItemGroup> The principles are the same, but in prior versions, the attribute constructors were not available to lean into. Michael W Powell also decided to provide helpful MSBuild Items as a more accessible, self-documenting shorthand input. From now, you can connect available meta properties at the CSPROJ level by leveraging CSPROJ meta information. If you are interested in how to leverage Orchard Core CSPROJ item lists and properties to enrich and get the absolute most from your authoring experience, this is the page you should take a look at! News from the community Lombiq Helpful Libraries - Navigation for Orchard Core The Lombiq Helpful Libraries contains various useful libraries that can be handy when developing for .NET, ASP.NET Core, and Orchard Core, to be used for your own projects. This time we would like to show you two helpful abstract classes: the NavigationProviderBase and the MainMenuNavigationProviderBase. NavigationProviderBase: an abstract base class for creating reducing boilerplate in INavigationProvider for checking the name parameter and if the user is authenticated. MainMenuNavigationProviderBase: an abstract base class derived from NavigationProviderBase for creating a home page menu structure using the main navigation name. If you use the Lombiq.BaseTheme automatically displays the generated menu as a widget in the Navigation zone. There is a Lombiq.HelpfulLibraries.Samples project for various examples in the form of an Orchard Core module. And that project contains a class called HelpfulLibrariesNavigationProvider. This class inherits the MainMenuNavigationProviderBase, which overrides the NavigationName with the "main" value. And if you check out the sample code here, you can see some other interesting stuff, like how we set up where to navigate users when they click on the given menu items. .ActionTask<LinqToDbSamplesController>(context, controller => controller.SimpleQuery())) In this case, we say that let's navigate the user to the SimpleQuery action of the LinqToDbSamplesController. And of course, you have the option to provide additional arguments as well if you check out the NavigationItemBuilderExtensions static class. Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 247 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!

Make Resources module always enabled, Content Preview module - This week in Orchard (22/04/2022)

This week you can read about making the Resources module always enabled, fixing HTML accessibility validation in the admin UI, using LinkGenerator instead of IUrlHelper in SignalMethodProvider, and a demo of the Content Preview module for Orchard Core! Are you interested in the details? Check out this post for more! Orchard Core updates Make Resources module always enabled Let's say you have the Resources module enabled on your site. The Resources module declares scripts and stylesheets that you can use across your tenants like you can have jQuery, jQuery UI, Bootstrap, and CodeMirror just by using the assets defined in this module. But you were able to disable the Resources module without any warning. If you disable that module, you will face an exception. From now you can see that the IsAlwaysEnabled property is set to true in the Manifest file of the module. IsAlwaysEnabled only means that you can't disable the feature once it is enabled, so you can still not use it if not defined from a setup recipe, from a configuration, or from the app with the helpers and so on. Fix HTML accessibility validation in the admin UI There were some UI warnings on the admin page if you run through these validators in the admin UI of Orchard Core: https://validator.w3.org/ https://html-validate.org/rules/prefer-native-element.html https://html-validate.org/rules/no-dup-id.html https://html-validate.org/rules/text-content.html Most of the warnings were found in the UserMenu.cshtml and the Layout. cshtml. For example: UserMenu: Attribute class duplicated. Attribute asp-route-returnurl should be lowercase. <button> is missing the required type attribute. Layout: <resources> must not be self-closed. <button> is missing the required type attribute. Anchor link must have a text describing its purpose. Now - as you can see - the button has the type attribute, there are no duplicated class attributes, and the returnurl is lowercased. Use LinkGenerator instead of IUrlHelper in SignalMethodProvider The signalUrl() JavaScript helper method stopped working, and you were faced with this error: The solution was to not use the IUrlHelper interface anymore but instead of that, use the LinkGenerator, which has a GetPathByAction method that can provide the URL for you. Demos Content Preview Module Hisham Bin Ateya has an organization on GitHub called OrchardCore Contrib with a couple of projects under it. The OrchardCoreContrib.Modules repository contains several modules. This demo is about checking how you can use the Content Preview Module. The Content preview feature of Orchard Core allows you to display the result that will be rendered on the front-end in a separate window while you are editing a content item in the admin. A Preview button is available in the action buttons when you create or edit a content item. And this module allows you to preview your page on different devices. So, if you add the OrchardCoreContrib.ContentPreview NuGet package to your Orchard Core host project and run your application, you will find a new feature if you search for the bar word in the Configuration -> Features screen. If you enable the Page Preview Bar feature, you will be able to preview the currently visited page on desktop, tablet, and mobile from within the top page preview bar. In our case, we hit the Preview button of the predefined About article of the Blog recipe. If you would like to know more, head to YouTube for a short demonstration of this module! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 247 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!

Creating ContentPart_Edit Shape using ShapeResult to support placement, Swagger module - This week in Orchard (14/04/2022)

This week you can read about updating the Roles module documentation, creating ContentPart_Edit Shape using ShapeResult to support placement, fixing an NRE when trying to save an empty LinkField and a demo of a Swagger module for Orchard Core! Are you interested in the details? Check out this post for more! Orchard Core updates Update Roles module documentation Orchard doesn't actually "come with predefined roles". The roles themselves are actually not created anywhere by default. Permissions corresponding to them are but without roles, they don't do anything. The roles all just come from recipes. Szabolcs Deme updated the description of the documentation to reflect that. Create ContentPart_Edit Shape using ShapeResult to support the placement In the past, when the placement was defined for ContentPart_Edit none of the following applied. { "ContentPart_Edit": [ { "place": "-", "contentType": [ "Container" ] } ], "BackgroundColor_Edit": [ { "place": "-", "contentType": [ "Container" ] } ], "BootstrapColor_Edit": [ { "place": "-", "contentType": [ "Container" ] } ]} If you want to reproduce the behavior, you can follow these steps: Create part BootstrapColor with TextField with PredefinedList as editor. Select Reusable. Add BootstrapColor Part as named part to Container content type with name BackgroundColor. Add any of the following placement rules in placement.json to hide:"ContentPart_Edit": [ { "place": "-", "contentType": [ "Container"], "contentPart" : ["BootstrapColor"], "differentiator": "BackgroundColor" } ] OR"BootstrapColor_Edit": [ { "place": "-", "contentType": [ "Container"], "contentPart" : ["BootstrapColor"], "differentiator": "BackgroundColor" } ] OR"BootstrapColor": [ { "place": "-", "displayType": "Edit", "contentType": [ "Container"], "contentPart" : ["BootstrapColor"], "differentiator": "BackgroundColor" } ] See part is still visible while editing and placement rule is not applied, but the expected behavior is the placement should apply. So, this is about creating ContentPart Shape using ShapeResult to support placement and alternates. Now, placement can be applied to dynamic named parts as follows: { "ContentPart_Edit": [ { "place": "Parts#HTML Attributes", "differentiator": "Container-BackgroundColor", "contentType": ["Container"], "contentPart": ["BootstrapColor"] }]} and shape can be overridden using alternates, eg. ContentPart-Container-BackgroundColor.Edit.cshtml. Fix NRE when trying to save an empty LinkField Content items with optional Link Fields don't allow the Link Field URL to be cleared once saved due to a Null exception in the display driver. The expected behavior would be when a Link Field that is set to Optional has its values cleared, the Link Field should remain empty when saved. You could reproduce the behavior by following these steps: Create a content type with a Link Field and leave it Optional. Create a new instance of that type and fill in a URL and Link Text then save. Edit the previously created instance, clear the URL and Link Text, and then save again. Edit the previously saved instance, and the URL and Link Text will still be there. Check the Orchard logs - there will be a Null exception from the display driver. As you can see from the changes below, now we only validate the URL if it exists. Demos Swagger Module Hisham Bin Ateya has an organization on GitHub called OrchardCore Contrib with a couple of projects under it. The OrchardCoreContrib.Modules repository contains several modules. This demo is about checking how you can use the Swagger Module. Swagger is an Interface Description Language for describing RESTful APIs expressed using JSON. Swagger is used together with a set of open-source software tools to design, build, document, and use RESTful web services. Swagger includes automated documentation, code generation (into many programming languages), and test-case generation. The point here is that this module provides easy integration. So, if you add the OrchardCoreContrib.Apis.Swagger NuGet package to your Orchard Core host project and run your application, you will find two new features if you search for the swagger word in the Configuration -> Features screen. If you enable them then you get a Swagger JSON-based API documentation by visiting the Swagger end-point by append /swagger/v1.0.0/swagger.json to the URL. And the same thing is also available under the /swagger/index.html URL with a nice Swagger UI. This - just as Swagger does - automatically shows all registered API endpoints, so if you add documentation to them, those will show up here. And of course, you can play with them as you can do with Swagger in any context. If you would like to know more, head to YouTube for a short demonstration of this module! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 247 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!

Option to disable SQLite connection pooling, tenant hostname duplicate check - This week in Orchard (08/04/2022)

Adding an AppSetting option to disable SQLite connection pooling, improving tenant hostname duplicate check, Monaco loader aware of the virtual folder, and a new tutorial sample project in the Lombiq Vue.js module for Orchard Core! Check out our current post to read about the details! Orchard Core updates Added an AppSettings option to disable SQLite connection pooling Most database configuration is handled automatically, but there are limited options that can affect the way the database works. By default in .NET 6, Microsoft.Data.Sqlite pools connections to the database. It achieves this by putting locking the database file and leaving connections open to be reused. If the lock is preventing tasks like backups, this functionality can be disabled. There may be a performance penalty associated with disabling connection pooling. See the Microsoft.Data.Sqlite documentation or the Orchard Core documentation for more details. As you can see in the screen below, you can configure the UseConnectionPooling by using the appsettings.json to turn on the pooling that will be used by the SqliteConnectionStringBuilder when using SQLite. Improving tenant hostname duplicate check There was an issue about the tenant's hostname was not checked for existence if the other tenant has multiple hostnames. You could reproduce this bug by following these simple steps: Create a tenant with the hostnames "example1.com, example2.com". Create a tenant with the hostname "example1.com". Observe that you can create the second tenant even though the hostname is duplicated. The expected behavior would be that you get the "A tenant with the same host and prefix already exists." validation error, and you can't save the tenant. Note that the validation error is raised if the first tenant has just a single hostname specified. In the following example, we created a tenant with the name Tenant4. We keep everything as is, and we just provided the hostname to be example1.com. After we added another tenant by using Tenant5 as the name. We kept the prefix empty and used example1.com as the hostname again. As you can see, we got the following validation error. Monaco loader is aware of the virtual folder We use the tenant prefix to set a data-tenant-prefix attribute that will be used by the monaco loader.js to load editor.main.js. But it doesn't take into account a possible virtual folder, so here we use the PathBase instead. Jean-Thierry Kéchichian kept the data-tenant-prefix attribute name to not break anything. Just for info, he tried to use tété as a tenant prefix, then in the HTML source code, we can see some attributes that are URL encoded t%C3%A9t%C3%A9, e.g., when .RouteUrl() is used, some are HTML encoded t&#xE9;t&#xE9; e.g., when @Url.Content(~/...) is used, and some that are not encoded tété, e.g., those provided by resources tag helpers. We know that the browser is able to do the right decoding/encoding (escaping is more important, e.g., on server-side redirections), so he let things as is to not break anything. But here it is an HTML data attribute used by a script, so here he opted to use the escaped PathBase by not using .Value so that the implicit .ToString() will encode it if needed. Don't forget that Url.Content("~/") doesn't encode URLs, so if you use href="@Url.Content("~/"), special chars that were not URL encoded will be HTML encoded by the rendering. News from the community New tutorial sample project in the Lombiq Vue.js module for Orchard Core The Lombiq Vue.js module for Orchard Core is an Orchard Core module that contains Vue.js and commonly used Vue.js components to be used in other Vue.js apps as dependencies. Provides extensibility to create Vue.js component templates as Orchard Core shapes making them able to override in themes or modules. We wrote about having Single File Components in the module a few weeks ago, and from now, this module contains this new, polished, detailed tutorial sample project about integrating Vue.Js into Orchard Core. The sample project has different top-level training sections, like: Writing Vue.js applications in Orchard Core modules Writing Vue.js Single File Components in Orchard Core modules If you want to know more about it, don't forget to check out the mentioned This week in Orchard post and this recording on YouTube! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 247 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!

Add UI for email proxy settings, Lombiq Orchard Visual Studio Extension supports Visual Studio 2022 - This week in Orchard (31/03/2022)

Fixing that content parts/fields were not showing up in preview when ContentCard is used, preventing Visual Studio Missing Components warning, adding UI for email proxy settings, and the Lombiq Orchard Visual Studio Extension now supports Visual Studio 2022! Check out our current post to read about the details! Orchard Core updates Add UI for email proxy settings A few weeks ago, we mentioned that from now you have the option to configure the proxy server and the proxy port number if you would like to set up the SMTP settings. And you must configure ProxyHost and ProxyPort if the SMTP server runs through a proxy server. But you don't have a UI for these until now! If you enable the Email feature and navigate to Configuration -> Settings -> Email, you will find the text boxes that you can use to set up the proxy hostname and proxy port number. Prevent Visual Studio Missing Components warning If you have installed Visual Studio Community 2022 (and don't forget: Orchard Core 1.3.0 release is removing support for netcoreapp3.1 and net5.0. Only net6.0 is supported, which is not supported in Visual Studio 2019), you didn't need to install any additional components. So, maybe we could just remove the .vsconfig file. But maybe still useful to keep it, so Jean-Thierry Kéchichian removed the Microsoft.NetCore.ComponentGroup.Web.2.1, Microsoft.VisualStudio.Component.TypeScript.3.5, and Microsoft.VisualStudio.Workload.NetCoreTools components that aren't included in the Visual Studio Community component directory documentation or marked as no more supported. Content parts/fields were not showing up in preview when ContentCard is used Let's say, you are trying to modify the BagPart to support a read-only scenario. Like if a user does not have permission to EditContent but has permission to ViewContent. In that case, the user should not be able to edit but should be able to view the data. Here are the steps to reproduce the behavior: Add content type A and attach BagPart to it that contains content type B. Make B securable to control who can edit and who can view it. Give the user read-only permission to B and Edit permission to A. At this point, you'll need to modify the BagPart.Edit.cshtml template to set the BuildEditor property to false when the user does not have the proper permission to edit. Finally, you'll need to render the ContentPreview shape on the ContentCard.Frame to display the ContentCard in a preview only. The expected behavior would be that the ContentCard to show up in the BagPart as it would in a preview screen. But it does not. The display the content cards correctly, the fix was to do a little modification in the ContentCard.cshtml file. News from the community Lombiq Orchard Visual Studio Extension now supports Visual Studio 2022 Lombiq Orchard Visual Studio Extension is a Visual Studio extension with many features and templates frequently used by Lombiq developers. It contains Orchard-related (including Orchard Core) as well as generic goodies. It contains several useful features like: Dependency Injector: When a class is opened in the editor, you can inject a dependency with this feature. Type the dependency name, hit Enter, and it will be injected. Orchard Error Log Watcher: Watches the Orchard error log (or any other error log) and lights up an icon when a new entry was logged. And wait, there's more! This feature also supports BlinkStick USB LED sticks that can blink or light up when an error happens. Check out this video for a demo of the whole feature. And from now, our Orchard Visual Studio Extension supports Visual Studio 2022! For more details, check out the Readme! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 244 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!

Orchard Core 1.3.0, fix missing permission checks and encoding - This week in Orchard (24/03/2022)

We are thrilled to announce that Orchard Core 1.3.0 is now available! Check out this post to know everything about the latest release of Orchard Core! Now let's see the newest features and additions of the current release that we will continue next week too! Let's get started! Orchard Core updates Fix missing permission checks and encoding These are security fixes that are fixed with Orchard Core 1.3.0. In this case, the fix targets two major issues. The first is that some authorization checks were not done correctly for some controllers. Here you can see the changes of the AdminController of the Features module. The second change is in the SEO module. There were XSS issues in the module. They were not very critical issues because you have to reach the admin editor to do that, and when you define SEO things for the front-end, you might want to render an HTML. But now it's sanitized for XSS reasons. The properties in the SeoPart are now encoded, in a way that you can use the Shortcodes, but you can't type anything else. You can't write any HTML you want, just the ones that make sense. And there is one special case when you set up the Google Schema: now it's not outputting anything, it's just validating the JSON format that you have provided. And when you create custom Shortcodes now the usage of the Shortcode (which is just some documentation) is now also sanitized, such that you can't inject custom JavaScript code in the description of the Shortcodes and try to hack people on the same admin page. Update full-text search index documentation Orchard Core provides a Lucene module/feature that allows you to do a full-text search on your websites. It is possible to configure which text/data you want to index in the Content Type configuration by using Liquid. And the following guide is helping you with how to implement a website full-text search step by step. And now the page has been updated with the following section: if your content item is also a set of content items, then you need to call the full_text_aspect helper to include the content of the content item inside the full-text search index. Fix NRE with TaxonomyIndex The index runs while cloning a content item, right after an empty content item was created (so before the actual cloning). The fields are there, but all are null. Casting this to JObject fails, as null is a JValue. The solution is that you have to do the casting in another way by using the as keyword. News from the community Orchard Core 1.3.0 Orchard Core 1.3.0 is now available! If you open up nuget.org and search for the OrchardCore.Application.Cms.Targets package, you will find the updated version of Orchard Core! There is a new page in the documentation with the breaking changes and the new features. Upgrade your solution to 1.3.0 now! Feel free to drop on the dedicated Gitter chat and ask questions! And don't forget: this release is removing support for netcoreapp3.1 and net5.0. Only net6.0 is supported. Updated Lombiq's Open-Source Orchard Core Extensions Lombiq's Open-Source Orchard Core Extensions is an Orchard Core CMS Visual Studio solution. It contains most of Lombiq's open-source Orchard modules and themes, as well as related utilities and libraries, like the Lombiq UI Testing Toolbox or the Training Demo module that guides you to become an Orchard Core developer. And from now, this solution with all the extensions inside is updated to Orchard Core v1.3.0 and .NET 6! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 241 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!

Support Mail Proxy, open-source Lombiq projects published on NuGet - This week in Orchard (10/03/2022)

Topics for the week are the new mail proxy support, documentation about how to use a local copy of Orchard Core source code as NuGet packages, and the published Lombiq projects on NuGet! Do you want to know more? Then check out our post now! Orchard Core updates Support Mail Proxy Let's say that your web hosting provider doesn't allow outbound connections by default (IONOS Windows Shared). In this case, all outbound connections should be sent through a proxy on this platform. You can configure it for HTTP(S) by adding this in the Startup.cs of the Orchard Core web app: HttpClient.DefaultProxy = new WebProxy("http://winproxy.server.lan:3128"); However, there was no way to configure this for SMTP connections. So there was an issue about not being able to send a mail with Orchard on this hosting provider. But from now you can configure the proxy server and the proxy port number by enabling the OrchardCore.Email module and using the SMTP Settings. The documentation is also updated with these new settings. Using a local copy of Orchard Core source code as NuGet packages There is a new page in the Orchard Core Documentation about how to use a local copy of Orchard Core source code as NuGet packages. In this new article, you can see how to create your own local NuGet feed from your local source code, how to publish to your NuGet feed, and how to update your project to use the newly created feed. News from the community Configure portable object localization in ASP.NET Core There was an ASP.NET Community Standup about localizing the .NET website. There was a topic on how the .NET websites have been localized using the Orchard Core localization package with PO files. Sébastien Ros did a demo about the package, explained how the localizer works, how to inject it, how to use the module, how to create a PO file, how to use pluralization, etc. If you would like to know more about localization and haven't seen that demo yet, check out the recording of that standup meeting here! And in the meantime, now there is a new article on the Microsoft Technical Documentation where you can read more about what is a PO file, how to configure PO file support in ASP.NET Core, or how to create a PO file with several useful examples. Open-source Lombiq projects now published on NuGet We have more than 160 open-source repositories under our GitHub organization, out of which more than 140 are somehow related to Orchard (including Orchard Core and 1.x). Up until now, if you wanted to utilize our projects in your own ones, you could only reference them as Git submodules or copy over the source files. Now, however, all the Orchard Core-related projects of ours, as well as several others, are available as NuGet packages! Check out our blog post to know more about our NuGet packages! Do you want to easily publish your projects to NuGet as well? You can build on what we've created for that: Take a look at our new GitHub Actions project that we developed with the help of Orchard community member Dean Marcussen. 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!

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!

Monaco editor supports preview, Vue.js Single File Components in Lombiq Vue.js module - This week in Orchard (25/02/2022)

This week you can read about updating the Monaco editor to support preview, improving the documentation of Orchard Core, search form improvements, and a demo about using Vue.js Single File Components in Lombiq Vue.js module for Orchard Core! Are you interested in the details? Check out this post for more! Orchard Core updates Make the Monaco editor Field support preview Now the Monaco editor Field correctly supports the content preview feature on every change. To test this out, you just need to have a content type with a Text Field attached. Don't forget to set the editor type to Monaco editor for that field. Documentation improvements The documentation of Orchard Core has been improved. Documentation for the Audit Trail, SEO Meta, Deployment, Remote Deployment, Redis modules have been added, and there were some missing Orchard Core Demo YouTube videos that are now embedded into the corresponding page of the documentation. Search Form: allow to override Index used Let's say you have a content type, called Blog. Inside that, there are a lot of blog posts, and there is a need to search inside of that content type of Blog. The question is, how can you limit the full-text search based on that content type? Well, from now there is a new feature that allows passing a QueryString param in the search form page to override the current default Index used for displaying results. This can also be set as a hidden form input fixed value if used from a different form. These Indices are protected by permissions, so it should be fine to allow to do this, instead of needing to create a different controller per index required to be searched from. You can use this in the following way: /search?Terms=moon&Index=BlogIndex Demos Vue.js Single File Components in Lombiq Vue.js module for Orchard Core The Lombiq Vue.js module for Orchard Core is an Orchard Core module, that contains Vue.js and commonly used Vue.js components to be used in other Vue.js apps as dependencies. Provides extensibility to create Vue.js component templates as Orchard Core shapes making them able to override in themes or modules. And from now, you have the option to use Vue.js Single File Components! The module identifies Single File Components in the Assets/Scripts/VueComponents directory and harvests them as shapes. They have a custom .vue file renderer that displays the content of the <template> element after applying localization for the custom [[ ... ]] expression that calls IStringLocalizer. Besides that, it's pure Vue, yet you can still make use of shape overriding if needed. You can read more about it in the module's readme file. Now it's time to see it in action! You will find a Lombiq.VueJs.Samples project in the repository that contains some Vue files. The module now supports these special files (where you can put the template and the script in the same file) and harvest these as shapes. If you open up the demo-sfc.vue file, you can see one unique solution for localization. As we mentioned, by using the [[ ... ]] syntax, you can perform localization via IStringLocalizer at runtime. Let's run the Vue.js Single File Component sample in the Lombiq.VueJs.Samples module! As you can see, this sample is about providing a table with some data and a pager that you can use to navigate between the pages of the table with the help of the Single File Components. And we are just scratching the surface here! If you would like to know more about using Vue.js Single File Components with the help of the Lombiq Vue.js module, check out this recording on YouTube! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 237 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!

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!