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 >

Enhance the Search module and UI, System Module - This week in Orchard (24/03/2023)

Ensure the Background tasks name is visible for old entries, enhance the Search module and UI, and a demo about the System Module! Check out our post for the details! Orchard Core updates Ensure the Background tasks name is visible for old entries In a recent change to the background tasks, a title was added to the background tasks. This works great for entries that have not been saved into the database. However, for entries that are already saved in the database, we do not have a title to show so it leads to no name being displayed on the UI. Since the title is not an editable field, we should always set the title to the default settings when showing tasks on the UI. Enhance the Search module and UI Currently, we have two different SearchController. Each one handles its own search provider, Lucence and Elasticsearch. We should be able to combine these two into one and place it on the Search module since that module's sole purpose is to export a front-end UI for the search. Also, we should add a setting to change the placeholder for the search bar. Additionally, we should have a Search Form widget that would allow the user to add a search widget. So, this update contains the following enhancements: Remove the SearchController from both Elasticsearch and the Lucene module. We now have one common SearchController in the Search module. The new controller now returns a shape instead of a view model which allows the user to override the default views. Adds settings to allow the user to define a title for the search page and also a placeholder text for the search bar. Add a Search widget that a user can add to their site. The default widget will direct the user to the /search route. Allow the user to optionally pass the index name in the route value. For example, /search/index-name the index-name is an optional value, and when it is not provided, the default index is used. Let's see some of the improvements mentioned in action! For this demonstration, we set up our site using the Blog recipe, and to be able to test the enhanced Search module, we have to enable the Search module itself and one search provider, which will be Lucene, for example. Now, we need to create a Lucene index under Search -> Indexing -> Lucene Indices. Here we added the name BlogPosts and included the Blog Post content type to the index. After that, we navigated to Search -> Settings -> Lucene and selected the BlogPosts search index as the default index to use for the search page and put a tick into the "Allow Lucene queries in search form" checkbox. Now we have a simple search set up, let's see the new Search Widget in action! We decided to place this widget on the home page. The predefined Blog content item is the home page in this recipe, so we edited the content definition of the Blog content type by adding a Flow Part to it. By having a Flow Part, we can add the new Search Form widget to the Blog content item. Here we can add some placeholder text if we want and can define the index name. Now it's time to utilize our widget! If we navigate to the home page of our site, we will see our Search Form widget. Let's type something and hit the Search button. As you can see, it lists our test posts which contain the "post" word. And you may notice the index name in the URL too (BlogPosts). If we had multiple indices, we can replace the BlogPosts one with any other existing index and that would mean that we search for something based on the content of that index. Remove .tiff from the supported images array Most modern web browsers, including Google Chrome, Microsoft Edge, Mozilla Firefox, and Opera, do not support the display of TIFF images natively on web pages. This is because TIFF files are typically very large in size and may take a long time to load. If you check out the MediaOrchardHelperExtensions class, you will see that the .tiff is now missing from the _imageExtensions. Demos System Module For this demo, we will clone the following GitHub repository which contains a set of modules for Orchard Core CMS that is driven by the community members who love Orchard Core. This will encourage all the passionate developers to build modules that aren't included in Orchard Core. Such modules may be necessary for the community or essential for any sort of CMS. This repository contains several modules, this time we will check out the one called System Module, which provides information about the currently running application; it can display the available system updates and put your site in maintenance mode while you upgrade. If you run this repository and enter the admin site using the admin username and admin@OCC123 password, you can navigate to Configuration -> Features and search for the "system" word. This will list the following features: System, System Maintenance, and System Updates. Enable them all! Now you will find a new option on the menu called System. Click on the Info under System! This page lists several useful information, like the ASP.NET Core Version, the OS Version, the Tenants, the enabled features, and so on. But you can find another option under System, called Updates. On this page, you can make sure that you are using the latest version of Orchard Core. If you are using the latest one (1.5 currently), you will see a "You're all up to date!" text, meaning there is no newer version of Orchard Core. And the third thing is the Maintenance mode. You can enable this mode by navigating to Configuration -> Settings -> System -> Maintenance and putting a tick into the "Allow maintenance mode" checkbox. If you do that and navigate to the front end of your site, you will see the page which shows you that the site is currently offline for maintenance. And as always, if you would like to learn more about this module, don't forget to check out this recording on YouTube! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 430 subscribers! We have started this newsletter to inform the community around Orchard of the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post is published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news about Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting!

Add Description to Content Types, Amazon S3 media options update - This week in Orchard (06/07/2022)

Adding Description to Content Types, Amazon Media Storage feature updates, and making media library upload size limit error message more detailed. Check out our current post to read about the details! Orchard Core updates Add Description to Content Types If you navigate to the admin UI of Orchard Core and head to Content -> Content Definition -> Content Parts and create or edit a Content Part, you have the option to optionally provide a description for the part. And Orchard Core displays this description on the page that lists Content Parts. And from now you can add descriptions to Content Types too! Amazon S3 media options update Neglectedvalue changed the custom AwsStorageOptions to AWSOptions provided by the AWS team. AWSOptions are more flexible and provide more ways to interact with AWS infrastructure: A huge piece of code(registration of the IAmazonS3 client) was removed and changed to a single call services.AddAWSService<IAmazonS3>(options); ClientFactory now allows using the common AWS credentials mechanism. Documentation was also updated. This change will also introduce many breaking changes: the OrchardCore_Media_AmazonS3 config section was changed: RegionEndpoint was renamed to Region and extracted from the Credentials section to the root section of OrchardCore_Media_AmazonS3, AccessKeyId was renamed to AccessKey, ProfileName was renamed to Profile. You will find these breaking changes in the documentation of the next Orchard Core release. Making media library upload size limit error messages more detailed It's not a bug, but rather an enhancement. When uploading to the media library a file larger than MaxFileSize, the error message isn't user-friendly, it just says 'Error: error'. You can quickly reproduce this by turning on the Media feature and uploading a file larger than MaxFileSize. From now on, the error message is more detailed, as you can see on the screen above. Thanks to Zoltán Máté from Lombiq for his first contribution! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 291 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 WebP to Media Profile options, Sitemap DateTime format should be ISO 8601 compliant - This week in Orchard (24/06/2022)

Adding WebP to Media Profile Options, fixing that Sitemap DateTime format should be ISO 8601 compliant, and updating the Scripting docs to reflect the correct way to use IScriptingManager and IScriptingEngine! Check out our current post to read about the details! Orchard Core updates Add WebP to Media Profile options WebP is an image file format developed by Google intended as a replacement for JPEG, PNG, and GIF file formats. It supports both lossy and lossless compression, as well as animation and alpha transparency. Google announced the WebP format in September 2010 and released the first version of its supporting library in April 2018. And from now you can select the WebP when adding a new Media Profile! To try that out, simply navigate to the admin UI of Orchard and find Configuration -> Media -> Media Profiles. Here you can add a new Media Profile or edit the existing ones. And the editor contains a dropdown where you can select the format for the processed image (a default value means a format command will not be applied). And from now, you can see that the list contains the WebP as well. Don't forget to check out the docs to know more about Media and Media Profiles! Sitemap DateTime format should be ISO 8601 compliant When formatting DateTime, sitemap source builders use the current culture instead of an invariant one. Here are the steps to reproduce the behavior: Change default culture to fi or fi-FI. Create a sitemap and add content to it. As a result, the formatted DateTime in the sitemap uses a period as a separator instead of a colon as you can see on the screen. Now, this has been fixed to use a colon as a separator instead of a period. Update the Scripting docs to reflect the correct way to use IScriptingManager and IScriptingEngine The scripting module provides an API allowing you to evaluate custom scripts in different languages. The example in the docs on how to evaluate code by executing some script using the IScriptingManager did not work. In the past, the example shows this way to get the current date using script. var scriptingManager = serviceProvider.GetService<IScriptingManager>();var date = scriptingManager.Evaluate("js: new Date().toISOString()"); However, the IScriptingManager does not expose a method that accepts string only. The goal here is to update the example to something like: var scriptingManager = serviceProvider.GetService<IScriptingManager>();var engine = scriptingManager.GetScriptingEngine("js");var scope = engine.CreateScope(_scriptingManager.GlobalMethodProviders.SelectMany(x => x.GetMethods()), serviceProvider, null, null);var date = engine.Evaluate("js: new Date().toISOString()"); If you open up the page from the docs about the Scripting module, you will find an updated example code that describes the correct way how to execute a script by using the IScriptingManager interface. News from the community 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 for Orchard Core 1.4.! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 287 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!

Amazon S3 Media Storage support, Content Localization module - This week in Orchard (17/06/2022)

New Amazon Media Storage feature that enables support for storing assets in Amazon S3 Bucket, a demo about the new Localization Matrix feature, and many more! Check out this post for the details! Orchard Core updates Amazon S3 Media Storage support The Amazon Media Storage feature enables support for storing assets in Amazon S3 Bucket. The feature replaces the default App_Data file-based media store with an Amazon Media Storage Provider. Media is still served by the Orchard Core website, and the Media Cache module takes responsibility for fetching media, on the fly, from the Amazon S3 Bucket. This allows the Amazon Media Storage feature to support image resizing on the fly through integration with ImageSharp.Web. The URL generated by the AssetUrl helpers points to the Orchard Core website. You can also find documentation about what configuration values are used by default and can be customized. In the docs, you can also read about the S3 Bucket policies, how to configure a bucket per tenant or how to configure a single bucket, with a base folder per tenant, and many more. Auto register IDisplayManager<T> for T on AddTheming In Orchard Core, to add a display manager, we configure services for each type as below eg, services.AddScoped<IDisplayManager<MenuItem>, DisplayManager<MenuItem>>();services.AddScoped<IDisplayManager<User>, DisplayManager<User>>(); It seems redundant code to resolve services for DisplayManager for a given type. Orchard builder should register generic display manager resolver as below, similar to what it's already done for Documents here. So, from now, instead of registering all the implementations of IDisplayManager<T>, there is a generic registration which is in the OrchardCoreBuilderExtensions.cs. So, anytime you resolve a generic IDisplayManager, you will get the DisplayManager of this time. Demos Content Localization 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. If you remember, you could also see a demo about the Swagger module made by Hisham, as well. This time we will check out how you can use the Content Localization Module. The point here is that this module provides easy integration. So, if you add the OrchardCoreContrib.ContentLocalization NuGet package to your Orchard Core host project, you are good to go. The module provides features for localizing content with one feature in it, called Localization Matrix, that shows a matrix for localized content per culture. Just head to the admin UI of Orchard Core and search for the matrix word in the Configuration -> Features screen. To be able to see the goal of this feature, we need to do some preparations first. That means, we need to have a content type with the Localization Part attached. We set up our site using the Blog recipe, so we just navigate to Content -> Content Definition -> Content Types and edit the Blog Post one. And under Parts, we add the Localization Part to it. And don't forget to have at least two cultures that are supported by the site (Configuration -> Settings -> Localization -> Cultures). Now, let's create another localized version for the built-in post, and let's create a new blog post as well with only one localization. Here come our blog post content items. Now let's see the new feature in action. If you navigate to Configuration -> Settings -> Localization -> Localization Matrix, you will see the new page added by this feature. This page shows you an overview of which content items are there in the system that is localizable (have Localization Part attached) and which versions they have. As you can see, we have the Hungarian and the US localization for the built-in blog post. But the blog post with the title Missing localization only has a US version but no Hungarian version. And as always, if you would like to know more about this feature, head to YouTube for a recording! 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 279 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!

Cache Failover and Shared options, YesSql updates - This week in Orchard (26/11/2021)

Huge YesSql updates, new cache failover and shared options, Media Library improvements, and a new site running on Orchard Core! Do you want to know more? Then don't forget to check out our current post! Orchard Core updates YesSql updates YesSql has updates for the following drivers: MySqlConnector 2.0, Npgsql 6.0, Microsoft.Data.Sqlite 6.0. The Npgsql 6.0 has breaking changes in terms of date and time serialization. The breaking change is in the way it handles time stamps and date-time storage and the type of column that it stores them into. The Microsoft.Data.Sqlite is on 6.0, which contains the SQLite Connection Pooling, so it's pooling SQLite connections now. If we check out the benchmarks for MVC, where Orchard is one of them, and it's running the About page on SQLite, and you can see that on both Windows and Linux it goes up from around 5000 requests per second to 16000 requests per second and also the latency went down. Removed beforeFolderAdded to stop multiple calls to fetch folders When you click OK on the new Media Folder name dialog, the first thing it does after creating the new folder emits beforeFolderAdded which loads the folder we are currently on. Then it emits the folderAdded, which selects the new folder (triggering a load of the new folder through the watcher). It appears that both requests are in flight at the same time, and we are seeing that occasionally the beforeFolderAdded request comes in last and then makes it appear as if the new folder has all the contents of the previously selected folder. bus.$on('addFolder', function (target, folder) { if (self.model == target) {bus.$emit('beforeFolderAdded', self.model); if (self.children !== null) { self.children.push(folder); } folder.parent = self.model; bus.$emit('folderAdded', folder); }}); So, when we create a folder, we fire the beforeFolderAdded then folderAdded both of which load contents of a folder, but there is no guarantee on the order these calls will resolve in. Occasionally, we are seeing the first call to the original folder come in second, and the new folder appears to be populated with images already. Cache Failover and Shared options Sometimes the Redis server is not available because there could be timeouts for example. What do you serve when Redis is down, and it's part of your system. Do you serve something or just wait and try again? You could say that if the cache fails then go to the database and return something from there. But at the same time, it can also be dangerous because you could expose yourself to put your site down. If you expect not to do a lot of database stuff because you have a caching layer, you can put your site down. The DefaultDynamicCacheService uses the IMemoryCache to at least prevent something if Redis is down. For example, cache the id of a requested document locally so that the memory cache is used during the FailoverRetryLatency, which is a configuration value that has a 30 seconds value by default. News from the community Dixin's Blog is running on Orchard Core If you navigate to https://weblogs.asp.net/dixin, you will find a blog that contains several interesting posts about .NET, Windows, and many more. The site is using Orchard Core, and as you may notice, it's very fast, no matter how much content it has on it. Lombiq Gulp Extensions with Stylelint Our Gulp Extensions project now also provides Sass SCSS linting with Stylelint! To use it in your Gulp JS SCSS build pipeline, just configure the corresponding SCSS targets Gulp task. Read more about how you can do that here! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 232 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!

Orchard Core 1.1 release, Dynamic style Content Field - This week in Orchard (28/10/2021)

We are thrilled to announce that Orchard Core 1.1 is now available! Check out this post to know everything about the latest release of Orchard Core and see a demo about a great third-party Orchard Core module that provides a dynamic styling content field for Orchard Core! Let's get started! Orchard Core updates Add Media background checkerboard pattern for transparent images Let's say that you have a site set up with the Blog recipe and you want to change the Banner Image of the predefined blog post. It's a possible scenario that you upload a PNG or a GIF file that has transparency. But the transparency of the selected image couldn't be easily seen because the admin theme has no support to show that the given image has a transparent background. To fix this issue, now you will have a background checkerboard to easily see the transparent parts of the image, that works in dark mode too. Here you can see that we uploaded and selected an Orchard Core logo that has a transparent background. Add Total support for Lucene API queries The change is just to return whatever the query object is returned from the query API, and it might contain more than what the interface exposes, which is just the items. For instance, Lucene can return the number, the total items. SQL won't do that because that's too costly. Demos Dynamic style Content Field The ThisNetWorks.OrchardCore.Styles module provides a dynamic styling Content Field for Orchard Core. The repository contains a sample project which includes custom configurations for the CKEditor toolbar. In this demo, we will clone the mentioned repository and run the solution inside. Set up your site using the Styles sample recipe that allows you to set up your site with additional pre-configured options, features, and settings out of the box. First of all, let's navigate to Design -> Style Schemas. A style schema defines how the Styles field will be edited, and which components will be available. Open up the one called H2 Color. As you can see here, we defined a component schema. At its most basic a schema entry must contain a reference to a Vuejs component and the description of how to render its entry as CSS. The renderer can be either a renderer name, e.g., "renderer": "CssSizeEntry" or a LiquidJS template for more complex schemas. Here the template says that set the color of the h2 tags to the #8bc34a hex value. Before moving forward, let's check out the content definition of the Style Guide content type that comes from the Styles sample recipe as well (Content -> Content Definition -> Content Types -> Style Guide). As you may notice, this content type has three Style fields attached. Now let's focus on the one with the display name Heading 2. Every Style field can have a selected style schema (H2 Color in this case), or you can select the Custom schema option from the drop-down to say I don't want to use a given style schema, I would like to define the schema here for this Style field. Now check out the predefined Style Guide content item. As you can see here, we have an h2 tag with the heading 2 text. And because we attached the H2 Color style schema with the Heading 2 Style field, when we render the content of this content item, the color of the text inside the h2 tag will be using the #8bc34a hex value. You can find other style schemas on the site, like the Css Variables one. Here you can see a range of CSS vars for the site. The BorderRadius adds rounded corners to the given elements. Here you can see we defined the value of the radius using rem. If you scroll back to the Style Guide content item, you will see that here we defined a my-sites-button class with a border value. The border-radius: var(--border-radius); means to use the defined BorderRadius value from a style schema. And here, you can see the usage of other variables from the style schemas like the button-background-color-hex, where you can easily say button-background-color-rgb as well if you defined the rgb value too. Here button is the name of the component, background-color is the name of the schema with a predefined hex and rgb colors. Now, if you open up the Style Guide content item, you will see something like this. Here you can see the color of heading 2, the border-radius of the buttons, and every other style that we defined using style schemas and attached them to our content type by using content fields. If you check out the README.md file of the repository, you will find nice, detailed documentation about the properties that you can use inside the schemas. And as always, you can find a recording about this module on YouTube to see this feature in action! News from the community Orchard Core 1.1 Orchard Core 1.1 is released! 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.1 now! Feel free to drop on the dedicated Gitter chat or use the Discussions on GitHub and ask questions! Reusable tests in Lombiq UI Testing Toolbox The Lombiq UI Testing Toolbox is a web UI testing toolbox mostly for Orchard Core applications. Everything you need to do UI testing with Selenium for an Orchard app is here. UI Testing here is an automation that clicks through the web application in a browser. One of the most popular frameworks for that is Selenium, which does exactly that. You get an API to instruct a browser, and every major browser is supported. This UI Testing Toolbox provides a lot of features on top of Selenium for Orchard Core. Basically allowing you to UI test an Orchard Core application in a safe and parallelized way providing a lot of helpers, a lot of higher-level APIs allowing you to test your application with SQLite, with SQL Server with local media storage, or with Azure Blob Storage. And you can have a test e-mail sent with a local SMTP server too. Everything just works. Check out the highlights of the Readme.md file of this repository to see all of the features! We had a demo about the UI Testing Toolbox a few weeks ago. If you haven't seen it yet, check out this This week in Orchard post! And the UI Testing Toolbox just got something very useful: Reusable tests to check that basic Orchard Core features work, like login, registration, and content management. Make sure your Orchard app's basics work! Check out the sample here! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 231 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!

Add UsersFolder for media assets, Liquid IntelliSense for Monaco editor - This week in Orchard (18/08/2021)

Updating Monaco editor to have Liquid IntelliSense, new UsersFolder for media assets, a brand new Orchard Core website, and many more in our upcoming post! Orchard Core updates Add UsersFolder for media assets Open up the admin UI of Orchard Core and head to Content -> Media Library. Here you will find a folder called _Users. Under this folder, you can find three different ones where each folder has the name by an ID of a given user. The reason for that is, we have three users in the system right now who have access to manage the content of the media folder and the content of their own media folder. If you check the permissions page for one of the roles you will see some new permissions come from the OrchardCore.Media feature: Manage All Media Folders Manage Media For Others Manage Own Media These permissions allow administrator users to be able to manage the content of other user's media folders but can restrict others to manage just their folders. Users with the Editor role can only see and manage their own media folder. Note that this is just about managing media assets not hiding the files of the folder. Every user can see the image served under the https://localhost:44300/media/_Users/4dsckq969tr2czhkskgg9nw3mj/image.jpg but they cannot delete this file and cannot modify the content of the 4dsckq969tr2czhkskgg9nw3mj folder. On the left window, the administrator user can see all of the folders, but on the right window, an editor user can only see their folder. If you don't like the naming _Users for the folder under AssetsPath, you can easily use another name for that just by using the appsettings.json file to configure media. If you navigate to Configuration -> Media -> Media Options you will find the name for the Assets user folder as well. Liquid IntelliSense for Monaco editor We have several custom Liquid filters and tags in Orchard Core and when you would like to use these from the admin UI of Orchard Core, (like editing a template or an Html Field using the Monaco editor) that would be nice to have some help with the registered filters and tags. This feature is about adding IntelliSense for Liquid in the Monaco editor. Let's see how we can try it out! Here we have a site installed with the Agency recipe. That recipe contains a Content__LandingPage template for the Landing Page content type by default. If we start to type the {% shape %} expression, we will see a list that contains all the registered filters with the word shape in it. Flow alignment icon always render as left aligned Let's say we have a content type with a Flow Part attached. If you are using Flow Part, you have the option to put several widgets to it. You can also set the alignments of the widgets and the width of the widgets meaning you can put two widgets near each other and you can say that I want to put this widget on the left side of the row and fill the 66% of the row with it and I want to put this widget on the right side of the row and fill the 33% of the row with it. You can do that using a nice UI but there was a minor bug which was about the little icon of the editor wasn't reflect the alignment of the given widget. You can see that now the icon here shows that the second Html widget inside the Container widget is right-aligned. News from the community A new website using Orchard Core: City of Santa Monica Santa Monica is a beachside city of 8.3 square miles on the westside of Los Angeles County. Offering an environment of unparalleled natural beauty, the city is home to a mix of residential communities, commercial districts, and recreational venues. And now the website of the City of Santa Monica is here, built by using Orchard Core! Check out this brand new, amazing-looking Orchard Core site here! If you are interested in more websites using Orchard and Orchard Core, don't forget to visit Show Orchard. Show Orchard is a website for showing representative Orchard CMS (and now Orchard Core) websites all around the internet. It was started by Ryan Drew Burnett, but since he doesn't work with Orchard anymore, as announced earlier it is now maintained by our team at Lombiq Technologies. DotNest Core DotNest Core is a complete redevelopment of the DotNest platform, all on the latest version of Orchard Core. We've been running it with a couple of select few customers for a while now, and it's time to open it up a bit more. While you can't yet just simply create an Orchard Core-based DotNest site, you can sign up for our limited beta here. You'll soon be able to get a fully functional, reliably hosted Orchard Core site on DotNest where you can build your personal website or something to showcase your Orchard skills with. Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 216 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!

Extension method for site setting deployments, optimize AddTokenToPath - This week in Orchard (11/08/2021)

The development of Orchard Core of course has been continued after the release of 1.0. Are you curious about the newest improvements of Orchard Core? Well, let's check them out! Orchard Core updates Optimize AddTokenToPath The community tries to make Orchard Core as optimized and as fast as it could be. C# and ASP.NET Core with other third-party libraries offer several tricks and techniques to achieve this goal. For example, you can use ZString instead of StringBuilder. 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. Or another improvement could be to not use string.Split that causing array allocation, use sub-strings instead. Add extension method for site setting deployments Whenever you would like to add a deployment step that allows exporting your custom site settings, you need to register three services with the transient, scoped, and singleton lifetimes. It's not a huge issue though because you can easily open a Startup.cs file of a module that contains these kinds of registrations and see how you can do it in your module but having an extension method for site setting deployments could reduce the lines that you need to copy every time. The new AddSiteSettingsPropertyDeploymentStep allows you to register your custom site settings deployments just in one line! Check out the Startup.cs files of any module to see the new way of registering your site setting deployments. Not use a current culture when checking invalid Autoroute path If you enable the Localization module and set a default culture to a non en-US culture, e.g. th-TH, you will get a validation error when trying to save a content item with an Autoroute part. Here is the screenshot when trying to save a content item and a default culture is th-TH. This issue is from AutoroutePartExtensions.ValidatePathFieldValue method. Inside the method, there is a call of autoroute.Path?.IndexOf("//") which returns 0 instead of -1 when a current culture is th-TH. According to the MS document, IndexOf(String) searches a word by using culture and case sensitivity. Refer to Recommendations for string usage, we should use StringComparison.Ordinal or StringComparison.OrdinalIgnoreCase for the non-linguistic string search. There is no case in a space and //, so the fix here was to pick StringComparison.Ordinal and to match IndexOf which is case-sensitive. Cypress 8.2.0 and Trumbowyg 2.25.1 If you are a huge Orchard Core enthusiast and like to check out the recent changes of the CMS from time to time, you may notice that the community upgrades the different .NET/Client-side/Test libraries from time to time. The Orchard Core documentation has a Libraries page under the Resources one where you can see the versions of these libraries that are used across the main branch of Orchard Core. Antoine Griffard recently updated Cypress to 8.2.0 and Trumbowyg to 2.25.1! With these updates, you can make sure that if you would like to use the built-in libraries of Orchard Core you will always have the latest versions! News from the community Lombiq Technologies: new developer colleagues and new group photo We had a great company trip last week where almost all of the colleagues of Lombiq gathered together to spend the whole day together offline. This was a great opportunity to update our group photo on our official website, so head to the About us page where you can see the most, but not all of our team as of the summer of 2021. And we also have two new colleagues to introduce: Ádám Jakab and Szabolcs Deme. Don't forget to check out their bio too! DotNest Core DotNest Core is a complete redevelopment of the DotNest platform, all on the latest version of Orchard Core. We've been running it with a couple of select few customers for a while now, and it's time to open it up a bit more. While you can't yet just simply create an Orchard Core-based DotNest site, you can sign up for our limited beta here. You'll soon be able to get a fully functional, reliably hosted Orchard Core site on DotNest where you can build your personal website or something to showcase your Orchard skills with. Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 215 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!

Source Browser, Content Request Culture Provider cookie setting - This week in Orchard (12/07/2021)

Fixing forms multi submit, set the cookie in the Content Request Culture Provider, Source Browser with Orchard Core, and many more coming this week! Orchard Core updates Set the cookie in the ContentRequestCultureProvider The ContentRequestCultureProvider allows you to switch the current culture based on the content item URL. If you have a site in French and English and you go on a page that contains a French content item, then the full request will go in French. This is what the RequestCultureProvider does, it assigns the current thread culture to the one that a content item is taken. The issue is the following. Assume you have a drop-down French and English to switch languages. Like you are, for instance, on the home page for English. And in the drop-down, you select French using the content picker. In this case, your whole navigation is back in French. Everything you will click should be in French now; the widgets, the content items, everything. But if you go to a page that is in English, the cookie is still for French, which means the next page that will open will assume you still want to be in French. This new option lets you switch the cookie to the culture of the content item you are watching. That means if you go to a content item with a different culture, your cookie will say: 'Oh, I want to be in this culture now, I don't want to be in the one that the drop-down selected before!'. By default, the ContentCulturePicker sets a cookie for the CookieRequestCultureProvider. This can be disabled in the Configuration -> Settings -> Localization -> Content Culture Picker settings page. The ContentRequestCultureProvider can set the cookie based on the ContentItem that matches the current URL. This setting can be edited in the Configuration -> Settings -> Localization -> Content Request Culture Provider settings page. Minor security issue: Internal File Path Disclosure An issue has been raised that the Media module can potentially expose internal file paths, letting a would-be attacker find out what OS the server is using and gaining knowledge about the file structure being used by the web application. If you open up the AdminController and check out the HttpPost version of the Upload action, you would see the following lines in the code that prints the path of the given file. The media file stores are supposed to catch all exceptions and rethrow them as a FileStoreException. The issue was the result contains the path, while it shouldn't. This issue has been fixed by now. Fix forms multi submit The idea here is that if you add the no-multisubmit class, then you can't submit a form twice. So when you double click, there won't be two POST requests, just a single one. And the issues that it triggered were like locking issues or concurrency issues like two content items use the same version and then two published versions. This is preventing issues like this. And you had to change every single form to prevent that. Document Static File Provider Feature and robots.txt for Tenants There is a Static File Provider feature that allows you to have custom static files served for each tenant differently. And in this case, whatever file you put under the App_Data\Sites\[Tenant]\wwwroot will be served in priority over the module's static files or the theme's static files. This way you can customize, for instance, a CSS for a tenant by putting it in this folder. If all tenants use the same theme, you can customize CSS or JavaScript by putting the files there. If you would like to read more about this, check out this updated page of the documentation. Demos Source Browser Source browser website generator that powers https://referencesource.microsoft.com, http://sourceroslyn.io, https://source.dot.net, and others. Create and host your own static HTML website to browse your C#/VB/MSBuild/TypeScript source code. Note that it does require an ASP.NET Core website for hosting (symbol index is kept server-side), so without ASP.NET Core the search function doesn't work. Dean Marcussen decided to build one for Orchard Core. And you can now browse the source code of Orchard Core using Source Browser. You can find the source code in the dm/orchardcore branch of this repository. If you would like to see a nice demo and discussion about this feature, don't forget to check out the following recording on YouTube! News from the community Lombiq Helpful Libraries: Contents Libraries The Lombiq Helpful Libraries consist of several various libraries that can be handy when developing for Orchard Core CMS, to be used from your own Orchard modules. This time we will see some helpful constants and extensions regarding contents. The CommonContentDisplayTypes static class contains values that can be used with IContentItemDisplayManager.BuildDisplayAsync or OrchardRazorHelperExtensions.DisplayAsync to safely select the correct display type. Here we have a BuildDisplayAsync method that loads the content item if the display type is not SummaryAdmin. As you can see, we could use the SummaryAdmin constant string here. The PublicationStatus enum can be used for instance to query content items based on the status of the content item. The WithContentItem extension method also uses these enums to filters a query to match the publication status in ContentItemIndex. You can see we have a query.WithContentItem(PublicationStatus.Published) call that will extend the given query with the ContentItemIndex index and use the given status of the content item. Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 207 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!