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 >

Fix the QueriesDocument and the Queries UI, Lombiq API Client for Orchard Core - This week in Orchard (09/08/2024)

Fix the QueriesDocument and the Queries UI, add new helpful Entity Extensions, and a demo about the Lombiq API Client for Orchard Core are the topics for the week. And don't forget that the discounted price for Orchard Harvest is available only until August 15! Let's see the details! Orchard Core updates Fix the QueriesDocument and the Queries UI Previously, any query type had to inherit from Query and required its own distinct type (e.g., SqlQuery, LuceneQuery, ElasticQuery). However, thanks to this change, creating a custom type for each query type is no longer necessary. This update involved modifications to the IQueryManager and IQuerySource interfaces, as well as the Query class. Additionally, a new project, OrchardCore.Queries.Core, was introduced. A migration process has been implemented to transition existing queries into the new structure, ensuring no impact on existing tenants. Let's see the key changes! Modification of interfaces and classes: Updates were made to the IQueryManager, IQuerySource interface, and Query class to accommodate the new structure. Addition of OrchardCore.Queries.Core: This new project supports the updated query handling mechanism. And how you can implement the IQuerySource interface? We now request implementations of IQuerySource using keyed services. Below is an example of how to register new implementations: services.AddQuerySource<SqlQuerySource>(SqlQuerySource.SourceName); This approach allows for more flexible and modular query handling in Orchard Core. Furthermore, we now have handlers for dealing with queries. To manipulate a query using a handler, implement the IQueryHandler interface. This provides a structured way to extend and customize the behavior of queries within the framework. Add new helpful Entity Extensions This change is about adding the following helpful extensions to the entity: IEntity Alter<TAspect>(this IEntity entity, Action<TAspect> action) bool TryGet<T>(this IEntity entity, out T aspect) The new extensions simplify the following already existing extensions: IEntity Alter<TAspect>(this IEntity entity, string name, Action<TAspect> action) bool TryGet<T>(this IEntity entity, string name, out T aspect) If we check out the code, you can see that from now on, we will not need to pass the name of the settings when updating it, providing the action to apply on the aspect is sufficient. Demos Lombiq API Client for Orchard Core In this demo, we will check out the Lombiq API Client for Orchard Core, a client library for communicating with the Orchard Core web APIs. Currently, it contains an implementation for the tenant and content management APIs and a console application for testing and demonstration. The project requires the Tenants feature, and OpenId features to be enabled and set up. The readme file of this library covers how you can set up the OpenId features but for easy use, enable the Deployment feature and import this recipe as a deployment package. The library contains a simple tester console app for manually testing the features of the Lombiq API Client for Orchard Core. Let's see the Program.cs file of this app! This tester app first sets up a tenant and edits that tenant. The next steps are creating a taxonomy and editing the taxonomy's display text by using API calls. This library with the tester app is included in our Open-Source Orchard Core Extensions full Orchard Core solution. You will find our other useful Orchard Core-related open-source projects there, too. And as always, if you want to see this little tester app in action, head to YouTube for a recording! News from the community Orchard Harvest 2024 Program The full Orchard Harvest program has finally arrived. This year’s program is packed with insightful sessions, engaging panels, and ample opportunities to connect with the Orchard community and to make Orchard Harvest the biggest Orchard Core event of the year. All sessions will be recorded and published on the Orchard YouTube channel after the event, so even if you can't make it live, you can see the sessions. However, being there live will allow you to ask the speakers, meet other community members, and have a lot of fun! All indicated times are local time in Las Vegas. After each session, you'll have a chance to ask questions, and we'll have a short break too. Here is a detailed schedule to help you prepare for the conference. Can't wait until September? Check out recordings from last year's special online Orchard Harvest on this YouTube channel here. Ready to be a part of something extraordinary? Reserve your spot today and take advantage of early-bird pricing at Orchard Harvest Conference 2024. And don't forget that the discounted price is available only until August 15. Secure your spot today and get ready to level up your skills at Orchard Harvest Conference 2024! See you there! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 467 subscribers! We have started this newsletter to inform the community around Orchard of the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post is published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news about Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting!

Dynamic index tables, allow any user to manage two-factor authentication - This week in Orchard (28/06/2024)

Allow any user to manage two-factor authentication, show recipe error instead of throwing an exception, and a demo about Dynamic index tables are the topics for the week. You can still apply to speak at Harvest 2024 and share your insights on Orchard Core's future, CMS roles, AI tools, cloud integrations, and more! Let's see the details! Orchard Core updates Allow any user to manage two-factor authentication Two-factor authentication (2FA) is now available for all users. Previously, only users with permission to access the admin area could set up their 2FA methods, although all users could still use 2FA if it was set up by an admin. To enable this change, the method IsRequiredAsync() in both the ITwoFactorAuthenticationHandlerCoordinator and ITwoFactorAuthenticationHandler interfaces has been updated to IsRequiredAsync(IUser user). Summary of changes The feature OrchardCore.Users.EmailConfirmation was removed. This feature was recently added and was enabled by dependency only. Its services have been moved up to the OrchardCore.Users feature since it is a core functional and needed by OrchardCore.Users. Using the 2FA email method now requires email confirmation using the existing email confirmation process. As mentioned, the method IsRequiredAsync() in both the ITwoFactorAuthenticationHandlerCoordinator and ITwoFactorAuthenticationHandler was changed to IsRequiredAsync(IUser user). OK, so, what does it look like in action? First of all, you have to make sure that you have at least one two-factor authentication method enabled. To do that, you have to navigate to Configuration -> Features and enable the regarding features. We enabled two modules: Two-Factor Authenticator App Method: Provides users with a two-factor authentication method through any Authentication App. Two-Factor Email Method: Provides users with a two-factor authentication method through an Email service. Orchard Core provides a third two-factor authentication method through an SMS service but these two will be enough for demonstration. After that, we need to have a user without any special roles. We created a user under Security -> Users, where we used John as the user's name. Make sure that this user is enabled to be able to log in as John. The last thing we have to do is to make sure that the Default Theme is the current site theme because that theme renders the navbar by default and includes the dropdown with the Security-related settings. And as you can see in the screen below, we logged in as John. If you click Security on the dropdown menu that we mentioned earlier, you may notice that John can enable the two-factor authentication by adding one of the below two-factor methods. The SMS is not here, because we have only enabled the App Method and the Email Method features. Show recipe error instead of throwing an exception Currently, when importing a recipe and something goes throw, implementations of IRecipeStepHandler or IRecipeEventHandler will throw exceptions to report errors if something fails to import. In a production environment, the user gets a white page, which leaves them lost on what had happened. This is no longer the recommended approach for error reporting. Now, to handle errors, we have introduced a new property named Errors in the RecipeExecutionContext. This property allows you to log errors instead of throwing exceptions. These errors should be localized and must not contain any sensitive data, as they are visible to the end user. Exceptions are still used for logging additional information, but these are not shown to the end user. Additionally, if an error occurs, a new custom exception, RecipeExecutionException, is thrown. Let's say you want to import a deployment package or import JSON from text. Assume that the JSON contains some errors in both cases. Here, you can see that Orchard Core shows the error to the user so they have feedback instead of dumping an exception or a white page. And the same applies if you want to execute a recipe that contains errors. Demos Dynamic Index Tables When using YesSql index tables, you have to build these index tables using code. This solution provides you with a way to build index tables without the need to write code. Using the admin UI, you can select the content type you want to index and you can add the table columns using a nice UI. You can also use a script to execute to build the column value mapping. Here, you can return how you wanted to be your content item indexed. In the screen below, you can see the index table for the content type called Comic Book. In the Map Script editor, we defined what we should need to return when retrieving the values inside the DisplayText, IssueVolumeNumber, and ReleaseDate columns. After that, if you do a SELECT * query for this index table, you may notice that the table contains the columns defined in the previous step. And it's just the top of everything this feature offers. If you are curious about the details, check out this demo video on YouTube for more! News from the community Orchard Harvest 2024 date and location Get ready to power up your Orchard skills at Orchard Harvest Conference 2024! Join us on September 12th-13th at the Orleans Hotel and Casino in lively Las Vegas for two days packed with learning, coding, and community fun. What can you expect at Orchard Harvest Conference 2024? Hands-On Workshops: Elevate your coding game with interactive sessions led by industry experts. Insider Insights: Learn best practices, advanced techniques, and real-world insights from qualified developers. Global Connections: Connect with fellow enthusiasts, exchange ideas, and forge meaningful relationships within the Orchard community. Special Perks: Participants get exclusive discounts on accommodations at the Orleans Hotel and Casino. Can't wait until September? Check out recordings from last year's special online Orchard Harvest on our YouTube channel here. Ready to be a part of something extraordinary? Reserve your spot today and take advantage of early-bird pricing at Orchard Harvest Conference 2024. We also opened the registration form for the speakers: https://forms.office.com/e/fewh7hh20d This year's leading themes: Leading up to a v3.0, what will the future Orchard Core look like? What's the role of a CMS nowadays (with the decoupled/headless operating models, and AI development tools) Explore some advanced topics such as Shapes, Placements, Cloud Integrations, Performance, module extensibility, etc. Showcases on implementing Orchard Core in action. We've extended the sign-up period by another 2 weeks, so if you haven't signed up yet, you can still sign up now! Apply to be a speaker until the 29th of June, midnight Anywhere on Earth! We'll notify you whether your talk is selected for Harvest in 1 or 2 weeks after the application period. The chosen speakers will receive complimentary tickets for the event. Want to support our mission? Become a sponsor! Reach out to us at [email protected] or [email protected] to explore sponsorship opportunities. Secure your spot today and get ready to level up your skills at Orchard Harvest Conference 2024! See you there! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 473 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.8, add a way to provide a custom Elasticsearch query - This week in Orchard (12/01/2024)

We are thrilled to announce that Orchard Core 1.8 is now available! Check out this post to know everything about the latest release of Orchard Core. In the upcoming weeks, we will check out the newest features and additions of Orchard Core 1.8. Let's get started! Orchard Core updates Fix an exception when creating content type without any content part Let's assume the scenario where you create a new content type with a name but you are not adding any content parts to it. If you hit Save without any added content parts, you will get a NullReferenceException. The fix here is to check if the partNames array is null. The same check applies to the fieldNames array as well. Add a way to provide a custom Elasticsearch query In the search module, the only available option to conduct a search is using query-string or multi-match query by providing a list of default fields to search. What if we want to customize the query, for example, by using fuzziness or other options? Currently, there is no simple way to configure the default search to use advanced search options. This is a new feature such that you can define what is sent to Elasticsearch when you type some terms in the search box. As you can see in the following screencast; you can define the following custom query to perform advanced operations like fuzziness. { "query": { "match": { "Content.ContentItem.FullText": { "query": "{{ term }}", "fuzziness": "AUTO", "analyzer": "whitespace" } } }} The documentation page of the Elasticsearch module has also been updated, and the example for setting the default search settings accepts a SearchType option where you can use 'custom' for a custom query in DefaultQuery and 'query_string' for a Query String Query search. Leave it blank for the default, which is a Multi-Match Query search. News from the community Orchard Core 1.8 and Orchard Core 1.8.1 The community recently released the latest 1.8 version of Orchard Core with several new features and additions! In this update, we've introduced several significant changes that may require your attention before upgrading. Additionally, performance-related enhancements have been implemented to optimize your app's scalability, especially when dealing with a large number of tenants. The Admin Theme was upgraded to Bootstrap 5, and from now on, the theme mode is set to auto, which allows us to use the default device color preference, which could be dark or light. A new option for restarting a specific Workflow instance has been incorporated, involving adjustments to both the IActivity and IWorkflowManager interfaces, and the HTTP error views are now in the form of shapes. The upper navigation bar has been transformed into a customizable shape (Navbar shape), allowing for easy integration of items. As an enhancement for the Elasticssearch feature, we introduced a new option that permits the definition of a custom query for the default search. And we have a lot more to cover! Here are all the details of the release. Note that this release removes support for net6.0 and net7.0. Only net8.0 is supported. Orchard Core 1.8.1 was released a few days after the 1.8 one to address some issues of the 1.8 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.8.1 now! Feel free to drop on the dedicated Gitter chat or use the Discussions on GitHub and ask questions! As we mentioned, Orchard Core is available as a NuGet package which you can easily add to your ASP.NET Core solution. Here's how you can get started with Orchard Core. Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 480 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!

Lucene index rebuild and reset steps, Lombiq GitHub Actions - This week in Orchard (21/10/2022)

Lucene index rebuild and reset steps, update all action bars, utilize ContentTypeExtensions, and a demo about the Lombiq GitHub Actions project! Do we need to tell more about the content of our current post? Let's jump into the recent news of Orchard Core! Orchard Core updates Lucene index rebuild and reset steps Currently, when we are creating a search index from a recipe it doesn't build the index. This causes issues with Lucene and Elasticsearch where the Queries won't return any results, and also Elasticsearch will log an issue about "all shards failed" if nothing has been indexed yet in its indexes. It would be nice to be able to trigger an index to be rebuilt or reset from a scheduled background task as a one-time-only task. And from now on, you will find two new recipe steps that will help you with that: The Reset Lucene Search Index Step resets a Lucene index. The Rebuild Lucene Search Index Step rebuilds a Lucene index. You can find more information about how you can use these new recipe steps in the Orchard Core documentation. Update all action bars We have some improvements regarding the action bars on the admin UI of Orchard Core. As you can see on the screen below, there was a lot of wasted space between the search box and the New button. There was an extra round space between the filter icon and the search box and we also had uneven spaces, as you can see. The other thing is when using a mobile phone to manage contents (or any view with an action bar), the search input on the top shows up very small because of the wasted space between the search box and the New button. And here you can see the updated action bar. You can see that all of the mentioned issues are resolved like the search box is now longer, and we have equal spaces. Utilize ContentTypeExtensions We have had a static class called ContentTypeExtensions for a while now in the source, which contains several useful extensions. Like shortcuts to tell that the given content type is creatable, versionable, has stereotypes, and so on. Here the goal was to use the newly added extensions ContentTypeExtensions across the solution. Demos Lombiq GitHub Actions The Lombiq GitHub Actions project contains extensions that make a lot of things very easy in an Orchard Core or an Orchard Core-based project. If you don't know GitHub Actions or aren't entirely clear with the terminology, GitHub actions are GitHub's automation platform or CI/CD platform. Orchard Core of course also uses it to run various builds. And how you define a pipeline there is by creating workflows and/or composite actions. Workflows are what actually run, and actions are something that you can add on your own as well, these are things that workflows can call. Workflow is kind of like a program, and action is like a library that your program calls into. And of course, actions can be third-party as well. The point here is that you can use GitHub actions to automate a lot of things, like .NET builds, running tests, and doing various verifications on a pull request, and you can also do all kinds of modularization between these builds. And what we have under this project are workflows and actions. Workflows that you can call from your own workflows. Pretty much like one-liners, for example, to run the .NET build and execute a test. Actions are the building blocks that you can also use if you just want to have something specific. And we have quite a lot of actions and workflows here. Let's check out the workflow called Build and Test Orchard Core solution workflow! Here you can see how you use it. The example above is not even a minimal usage actually, it can be even shorter. This can be your GitHub Actions workflow in your own repository with an Orchard Core application, where you execute the workflow that we provide here. This is actually used in Orchard Core Commerce as well. If you check out the build-and-test.yml file inside the repository, you will find all the code that is necessary to run such builds. If you check out the details of a pull request inside the Commerce repository, you will see there are builds for Ubuntu and Windows as well. These are all the automated checks that we run. This is quite a long build because it's not just a .NET build, it also runs all kinds of static code analysis. It verifies that .NET packages are consolidated, and it also runs unit and UI tests with SQL Server and Azure Storage actually. And the Lombiq GitHub Actions projects contain a lot more than that! Are you interested in the details of what you can achieve if you use this project in yours too? If your answer is yes, or you want to know more about this automation platform check out this recording on YouTube for more! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 365 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!

Bootstrap 5 in the default Admin theme, Orchard Core Commerce survey - This week in Orchard (27/05/2022)

The default Admin theme now using Bootstrap 5, logging warning when a Zone isn't a Shape, adding documentation on Query API results changes and if you do e-commerce or if you have an opinion about e-commerce, please share your opinion with us by filling out this survey! Orchard Core updates Bootstrap 5 in the default Admin theme The Admin theme now using Bootstrap 5! The change only affects the Admin theme, there is no change in the built-in themes, you can use whatever Bootstrap version would you like to use there (or any other framework of course). If you open up the ResourceManagementOptionsConfiguration file in the Resources module, you can see that now you have the option to use the new Bootstrap version. Log warning when a Zone isn't a Shape You can't use both <zone> tag helpers and widgets for the same zone. If you have a widget in the zone, the content in zone tag helpers are ignored. Steps to reproduce the behavior: Create a new Orchard Core CMS Web App solution. Add a new Orchard Core Theme project. Replace the Views/Layout.liquid with Views/Layout.cshtml having the following content to keep it simple: @inherits OrchardCore.DisplayManagement.Razor.RazorPage<TModel>@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers@addTagHelper *, OrchardCore.DisplayManagement@addTagHelper *, OrchardCore.ResourceManagement<zone name="Footer"> <p>Hello from zone tag helper!</p></zone>@await RenderSectionAsync("Content", required: false)@await RenderSectionAsync("Footer", required: false) Launch and set up the web app. Go to /Admin/Themes, and select the newly created theme. Confirm "Hello from zone tag helper!" is visible on the home page. Create a zone "Footer" and a layer "Always" (boolean true condition). Create a widget content type with Html Body and add a new item with "Hello from Widget!" to the Footer zone. Go back to the home page. You only see Hello from Widget! and any tag helpers are ignored. The expected behavior would be that you should see Hello from zone tag helper!Hello from Widget! in the footer. From now, the code will log a warning instead of failing silently if the zone is not a shape. Here you can see the logging in the ZoneTagHelper and in the ZoneTag. Add documentation on Query API results changes If you called the api/query/{name} endpoint in Orchard Core 1.0.0, the query returned with the following schema: [ { "Id": 321, "UserName": "test", "Email": "[email protected]" }] If you upgraded to Orchard Core 1.1.0, this endpoint returns the data in a different format: { "items": [ { "Id": 321, "UserName": "test", "Email": "[email protected]" } ] } To make sure you handle the response correctly, the documentation of Orchard Core has been updated to reflect these changes. News from the community Orchard Core Commerce MVP planning and survey A few weeks ago you could see a nice demo about the Orchard Core Commerce module. And in that blog post, we also mentioned that Lombiq provides stewardship for this module. That actually means that we will do code reviews, and work on features and fixes. To have that, Márk Bartha (who is the project leader from our side) started this thread and added this survey. This is about asking the community what the most important features for you would be in an Orchard Core-based e-commerce solution. If you do e-commerce or if you have an opinion about e-commerce, please share your opinion here. The point of this is to try to do not all the things but focus on what is really needed first. Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 271 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!

Feature aware Razor Pages, Orchard Core Commerce - This week in Orchard (06/05/2022)

This week you can read that the Feature attribute was not working for Razor Pages, the Lucene documentation updates, and a demo of the Orchard Core Commerce module! Are you interested in the details? Check out this post for more! Orchard Core updates Feature attribute was not working for Razor Pages The Feature attribute was not applied to Razor Pages because Razor Pages were always tied to the module. What does it mean? Well, let's follow the steps below: Create a Module with a feature. Add a Razor Page. Add the Feature attribute to a Razor Page. Enable the module and the feature it will serve the Razor Page. Disable the feature - notice that Razor Page is still served. Now, the feature is disabled, and the site should not serve the Razor Page, but it was still served. Now, this has been fixed and you can also try it out if you enable the Orchard Core and Orchard Foo Demo features that sit in the Orchard Demo project. Note that this project is not referenced by default, so if you would like to try it out, you can simply add it to the OrchardCore.Cms.Web, for example. You can find two Razor Pages (Edit and List) with the Feature attribute OrchardCore.Demo.Foo. Meaning that if you enable the Orchard Demo feature but keep the Orchard Demo Foo disabled, you can not reach these pages. Lucene documentation updates You can write elaborate Lucene Queries with the ElasticSearch DSL. This includes the match query type (akin to using the my search term syntax in the search box) and match_all (like writing "my search term" for exact search). And you can optionally use the parsed Lucene search syntax in the search text box. However, the documentation of the Lucene module had some missing examples about how you can combine the two and how to use the search syntax with a Query. The simple_query_string is also available but was missing from the docs, it has been added too. Demos Orchard Core Commerce Orchard Core Commerce will be an Orchard Core port and partial rewrite of the open source Nwazet Commerce module that was built for Orchard CMS 1.x. Nwazet Commerce was initially built in 2012 by Bertrand Le Roy, loosely based on a commerce sample by Sipke Shoorstra. The initial goal of Nwazet Commerce was to power the website of the hardware startup Nwazet. While Nwazet is no longer operating, the Nwazet Commerce project went on, and was further developed by a group of passionate contributors who are using the platform for their own, and their customer's websites. Like Orchard, Nwazet Commerce was built with extensibility in mind, and as such it has its own extensions (typical examples include local tax and shipping modules). It's also pure, idiomatic Orchard. Orchard Core represents a major evolution of the Orchard design principles and is sufficiently different that running Nwazet Commerce on it will necessitate significant work. As such, the community decided that starting from a blank slate was the best way to go, so they will port Nwazet Commerce piece by piece, being careful to accurately apply Orchard Core's new design principles. The community also decided to adopt a new name that gets rid of the now obsolete origins and establishes our ambition for the module to become the go-to commerce module for Orchard Core. This work is in its initial design phases and will focus at first on porting a minimum viable feature set. In this demo, we will check out the current state of the module. To set up your dev environment, you should clone this repository, build and run the SampleWebApp project (set up with any recipe) and enable the Orchard Core Commerce, Orchard Core Commerce Session Cart Storage, and the Orchard Core Commerce Settings Currency Selector features. From now on, you can start using the features by creating a new Product content type and adding the Product part to it, and so on. But you can run the built-in recipes (MultiCurrencyProduct, Order, and Product) to set up your content model just by a few clicks. Meaning you will have a Product content type with a Product Part and multiple Price Parts. Order content type with an Order Part, a shipping address, and a billing address. Product content type with a Product Part and a Price Part. And if you check out the recording below you will know how to create products like this one, where you can define the SKU(Stock Keeping Unit), the base price of the product, and you have the option to attach the built-in Boolean/Numeric/Text Product Attribute Fields that can help you to define the available sizes for the given T-shirt for example. News from the community Lombiq provides stewardship for Orchard Core Commerce You saw the current state of the Orchard Core Commerce module, and if you follow the news around Orchard and Orchard Core, you may notice that the project is moving a little slow because of the level of the contributions. We'd like to announce that Lombiq Technologies provides stewardship for the Orchard Core Commerce project. Bertrand, who initially founded the Orchard 1 and Orchard Core Commerce modules, reached out to us if we are interested in actively maintaining the project. We at Lombiq are really excited about this opportunity. We want to move this forward with proper planning and frequent contributions to the repository. On our side, Márk Bartha will be the project leader. A few seasoned Orchard developers are ready to implement features. But first, we want to hear your opinion about what you need first and most for the MVP. We'll put together a short survey to collect your ideas in an organized manner. Until then, feel free to comment and let us know your thoughts! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 248 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!

Fix Liquid QueryCollection access, renaming page route parameter - This week in Orchard (04/12/2021)

Fixed Liquid QueryCollection access, an interesting bug when using the page route in Razor Pages, and updated libraries used in Orchard Core. Check out our current post to read about the details! Orchard Core updates Pager used the reserved "page" route parameter The bug only happens if you are using Razor Pages at least one razor @page. In that case when you list the items of a given content type e.g. /Admin/Contents/ContentItems/Article?admin=674211458, the Pager links, in place of using our custom pattern /Admin/Contents/ContentItems/Article?admin=674211458&page=2, they use the default pattern where the content type is a query string parameter /Admin/OC.Contents/Admin/List?contentTypeId=Article&admin=...&page=2. At this point, you can still go to a given Pager page. But then if you select a new filter option it removes the above query string contentTypeId parameter e.g. /Admin/Contents/ContentItems?q=status%3APublished. So in place of still listing the items of a specific content type, you go to the list of all content types in place of staying in the list of a specific type. Removing the contentTypeId parameter is another issue filtering should preserve the existing parameters, but here we're only talking about the fact that the Pager links don't use the right custom pattern if at least a Razor @page is defined. This is because the Pager uses a page route parameter to generate link URLs, but this is a reserved ASP .NET Core routing name. The solution is to remove this route value in the ActionLink shape before generating an URL and then explicitly add it as a query string parameter. Currently, as a workaround, there is a custom IShapeTableProvider. So in one sentence, you are not allowed to use page in routes because it's a reserved word because of Razor Pages. And now it has been changed to pagenum everywhere. Fixed Liquid QueryCollection access Let's set up your site using the Agency recipe. That recipe contains a template for the Landing Page content type where we can test the Request.Query Liquid filter easily. If you check out line 19 of this template, you can see that we are using the Request.Query Liquid filter to say, give me the value of the test field from the query string. But how can you use this one? The helper is just about to print the value of the query string by the given field. So, if we open up the predefined Landing Page content item and put something in the query string using the test, you will see the printed value on the page. It's an IQueryCollection whose underlying type is a QueryCollectionInternal, but we only allow access to QueryCollection. Jean-Thierry Kéchichian fixed it by creating a QueryCollection. Updated libraries We have this Libraries page in the Orchard Core documentation that lists the different .NET libraries, the different Client-side libraries, and the different Tests libraries used in Orchard Core. In Orchard Core, the community always tries to use the latest versions of these libraries to make sure you will always get the latest bug fixes and the latest features provided by these libraries. News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 233 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!

Fixing rendering of helper and block tag helper, Bynder for Orchard Core - This week in Orchard (21/10/2021)

Fixing rendering of helper and block tag helper, documentation for the Feature Profiles, OpenID improvements, and demo about a module that integrates Bynder for Orchard Core! Don't forget to check out our current post to know more! Orchard Core updates Documentation for Feature Profiles Last week we had a demo about the new Feature Profiles feature. If you haven't seen the demo video about that feature or you haven't read about it yet, you should check out our previous post! In the meantime, the Tenants page of the Orchard Core documentation has a new section that describes everything you need to know to use the Feature Profiles feature. Fixing rendering of helper and block tag helper We had an issue in Orchard Core when using Tag Helpers in Liquid. You can write a tag like a block that will implicitly invoke ASP.NET Tag Helpers and try to map the provided name and properties to the given Tag Helper. In this case, we say to invoke the anchor Tag Helper and with the provided action, class, and route_todoid properties. Here you can see a nice example in the OrchardCore.Demo module to see how you can call an ASP.NET Tag Helper using Liquid. OpenID Recipes: use step model instead of the view model, support update Orchard Core got several updates related to the OpenID feature. The changes in this addition are: Add unit tests for OpenID scopes. Add unit tests for OpenID apps. Replace OpenIdScopeStepViewModel with OpenIdScopeStepModel in recipe. Replace CreateOpenIdApplicationViewModel with OpenIdApplicationStepModel in recipe. Adjust OpenIdScopeStep to support update. Adjust OpenIdApplicationStep to support update. Adjust OpenIdApplicationStep to include importing scopes, which were not imported before. If you check out the code of the OpenIdApplicationStep, (which is a recipe step that adds an OpenID Connect app), you will see that now it's using a new OpenIdApplicationStepModel instead of the CreateOpenIdApplicationViewModel to serialize the data coming from a recipe file. Refactor IQueryResult usage This addition contains several changes: Moving LuceneQueryResults to OrchardCore.Lucene.Abstractions. Moving SqlQueryResult to OrchardCore.Data.Abstractions. Adding OrchardCore.Queries.Abstractions to both these projects to use the IQueryResults interface. This means now, if you would like to use the LuceneQueryResults in your solution, you will find that class in the OrchardCore.Lucene.Abstractions project, under the OrchardCore.Lucene namespace. The old LuceneQueryResults class is marked as obsolete to do not break your code when you will update your solution to the upcoming Orchard Core 1.1. Demos Bynder for Orchard Core This demo is about an Orchard Core module for integrating with the digital asset management platform Bynder. Foremost, it provides the Bynder Field content field that can be added to content parts so Bynder resources can be browsed and attached. But what is Bynder? Bynder’s digital asset management platform enables teams to collaborate in the cloud, get content to market faster, and maximize the impact of marketing assets. It's pretty much a media gallery for bigger companies or for governments used mostly by marketing people. You can upload images and else into Bynder and then everybody from marking will access and use them when publishing materials. If you are interested, you can easily create your 30-day trial here. This module adds a media picker field for Bynder into the Orchard admin. Let's see it in action! In this demo, we will go with a quicker way and use our Open-Source Orchard Core Extensions full Orchard Core solution. We just clone the repository of the Bynder module too and add it to this solution. You have to do one thing before using the module. You need to configure your Bynder Portal's URL to be used in all Bynder Fields via the BynderOptions see its definition. It means that you need to add the PortalUrl to the appsettings.json file. Now, let's set up a site using the Blog recipe. After, we need to enable the module. To do that, head to Configuration -> Features and find the one called CSM.Bynder. Let's say that we want to extend the content definition of the Blog Post by adding the Bynder Field to it (Content -> Content Definition -> Content Types -> Blog Post -> Add Field). Now we have the Bynder Field added to the Blog Post content type, let's see what will happen if we would like to edit the predefined blog post! You will find a new button called Browse Bynder. And if you click on that button, you have the ability to browse some images. Here you can see the dialog provided by the Bynder SDK where you can see all of the assets under the specific collection of the given company. The field is currently configured for allowing multiple of these pictures so we will be able to select more than one. And that's not all of it! If you would like to know more about this module developed by Lombiq Technologies, just head to YouTube for a recording! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 229 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!

GrahQL Queries queries, Negative role condition evaluator - This week in Orchard (07/06/2021)

We start this week by showing the ability to export templates as files, the negative role condition evaluator, and the brand new alternates for widget parts and for dynamic parts with great examples in the documentation. After, we will see a great demo about using templated GraphQL queries with Liquid. Check out our post for more! Orchard Core updates Add ability to export templates as files The idea here is in the exported ZIP file, the templates are now files instead of being embedded in the JSON recipe. Let's check it out quickly! Let's say you have the Templates module enabled (the Templates module provides a way to write custom shape templates from the admin) and have a defined template. If you set up your site using the Agency recipe, you will have one template, called Content__LandingPage, which is a template for the Landing Page content type, and the homepage of that installation is a Landing Page content item. Now, head to Configuration -> Import/Export and create a new Deployment Plan under the Deployment Plans option. Let's name the plan as Templates and add one Deployment Step to it, the All Templates one. Here you will see a new option: Export templates as files. Let's just put a tick in this checkbox to see what will happen. Now we have only one thing left to do, to execute the deployment plan. Let's just download the deployment plan locally and check the content of the Templates.zip file. Here you will see a Recipe.json file and a Templates folder. The Recipe.json file contains the Templates step with our only one Content__LandingPage template, and the content of that template can be found in the Content-LandingPage.liquid file in the Templates folder. Negative Role Condition Evaluator The way a role condition with a negative operator is evaluated right now doesn't take multiple roles into account. If we have 2 users: -- roleA roleB UserA X UserB X X The evaluator uses .Any() when evaluating the value against every role of the user. If we pick the operator "Equals" with the value "roleB", it will only be true for UserB, which has roleB. If we were now to just change the operator to "NotEquals" logically, it should be the opposite result of "Equals" but since the value gets compare against every role and roleA != roleB it will return true as well. .Any() (Current) Operator Value UserA UserB Equals roleB false true Not Equals roleB true true Contains roleB false true Not Contains roleB true true Using .All() with the negative operators which would give opposite results as intended. .All() Operator Value UserA UserB Equals roleB false true Not Equals roleB true false Contains roleB false true Not Contains roleB true false We have many negate operators, like StringNotContainsOperator, StringNotEndsWithOperator, StringNotStartsWithOperator, StringNotStartsWithOperator. Now, if you use them, the code execution will return with using the .All() instead of using the .Any(). If you don't know what are the rules and how to use them, check out the demo about the Rules module in this post! Validate content type and part names There was an unhandled exception during content item creation if you have a part named like property on ContentItem. The reason was that we have some reserved names that you cannot use when you are naming your content parts or content types. The _reservedNames HashSet here contains the names, that you cannot use. Use ZStringWriter ZString is a library that provides StringBuilder and StringWriter with zero allocation, meaning it's allocating an array on the stack for small buffers, instead of creating new StringBuilders and StringWriters every time. All ZString methods only allocate the final string. Also, ZString has enabled to access the inner buffer, so if the output target has stringless API, you can achieve completely zero allocation. Now we can use the new ZStringWriter instead of the existing StringWriter one. Alternates for Widget Parts This change contains several new alternates for widget parts and dynamic parts. And the documentation has also been updated with the new alternates. And when we are saying that the documentation has been updated, we mean that it's really got a huge update with many examples, like Display mode with Part Type and Shape without Display type Examples, Display mode with Part Type and Shape with Display type Examples, Display mode with Part Name and Custom Shape with Display type Examples and many more. Demos GraphQL Queries queries Let's meet with the new GraphQL Query type that basically allows you to use a GraphQL query in the admin interface and Liquid. It's using the same principle as the SQL query or the Lucene query. For example, let's say we have a GraphQL query created called ContactRequests, which is just about getting the Contact Request content items from the site. This query returns the contentItemID, the createdUtc, and the display text values of the Contact Request content items. But by using this experimental feature, you have the availability to use a templated GraphQL with Liquid. What do we mean? Well, first let's find the new Run GraphQL Query under Search -> Queries. Here let's add a template that contains Liquid code. By using Liquid, you can add output parameters to your query. In this case, we would like to get the email and the message fields too of the Content Request content items by using parameters. As you can see, we used the contactRequestEmail parameter to get the email and the contactRequestMessage parameter to get the message. If you open up the StatCan Orchard Core repository, you will find a collection of custom Orchard Core resources, modules, and themes that support various web applications and software-as-a-service (SaaS) products. One of the modules here is the VueForms module, which provides a form ContentType that simplifies using VueJs forms in the frontend. We had a demo about that one too, way back in 2020. If you don't remember about that, you can check out that in this post! And as always, if you want to know more about this feature, don't forget to check out the following recording on YouTube! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 203 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!