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

Content Tree Module, Orchard Core Admin UI experience renewal survey - This week in Orchard (06/06/2025)

This time, you can see a fascinating demo of the Content Tree Module! But first, let's look at our other topics, like adding GraphQL support for querying content items by status from the Content Picker Field, fixing binding form input in the Coming Soon theme, and improving the Register User Task. Don't forget to fill out our Orchard Core Admin UI experience renewal survey to help shape the future of Orchard Core!

Featured tags

IIS
API
SMS
SEO
MCP
All tags >

OpenAI feature including Azure OpenAI integration, Orchard Harvest 2025 survey - This week in Orchard (17/01/2025)

This time, you can see a fascinating demo of the OpenAI feature, including Azure OpenAI integration! But first, let's check out our other topics, like removing ReCaptchaMode and DetectionThreshold, introducing the new ReCaptcha shape, and exposing properties of ITrackingConsentFeature and cookie policy in Liquid! Oh, and did we mention that we have just created a survey for Orchard Harvest 2025?

How to add media management to an ASP.NET Core app? - Orchard Core Nuggets

Using media files, such as images, videos, and documents (like PDF files), is a common requirement for a modern website. Media can enhance user experience by making content more engaging, visually appealing, and/or easier to understand. Fortunately, Orchard Core has a built-in solution: the Orchard Core Media feature. As the description says in the official documentation:The Media module provides a UI to upload and organize binary files that can be used while creating content.Are you new to Orchard Core? It's a great open-source framework, and CMS built on ASP.NET Core. Check out the official getting started docs.Let's see Orchard Dojo and its blog for a real-life example of why you would use the media feature. At Orchard Dojo, we mainly use images for two things:Image of trainers: As you can see on the About page.Images for blog posts: For example, in this blog post.We have flexibility, and we can organize the media files using the media feature.Flexibility: Let's say a trainer got a new haircut and wants to update their image. Then, we can overwrite the old image with the same name in the media library, and that's it.Organization: We can have a “Trainers” media folder with the trainers' images, a “Blog Posts” folder with the images for blog posts broken down to years, and a folder for each individual blog post's images.Now, to turn on the feature, go to Configuration → Features and make sure the Media feature is enabled. You can additionally enable these media features: Media Cache: The feature caches remote media files locally, improving performance and reducing bandwidth usage for sites using external storage like Azure Blob or S3. For example, an online store with product images hosted on cloud storage can deliver images faster to users.Media Slugify: The feature ensures SEO-friendly URLs by automatically renaming new media folders and files to use slugs (e.g., “The team (2020).jpg” becomes “the-team-2020.jpg”). This is useful for improving search visibility, such as when uploading product images for an e-commerce site. The URLs are also just nicer.Secure Media: This feature allows administrators to control access to media folders based on user roles, ensuring only authorized users can view or manage specific files. For example, a company could restrict marketing files to the marketing team while allowing all staff to access shared resources, enhancing security and organization. If you are new to Orchard Core, you can check out user management (including adding permissions to roles) in one of our Dojo Course videos (to learn more about Dojo Course, click here).After enabling the Media feature, go to the Content menu, and you will see the Media Library menu item. Inside the Media Library, you will see one already existing folder named “_Users”. You can read about this here in detail. But in a nutshell, Orchard Core's Media Library includes a “_Users” folder with subfolders for each user, allowing them to manage their own media. New permissions like Manage All Media Folders and Manage Own Media let admins control access while restricting editors to their folders.A few buttons are not self-explanatory in the media library; we will go through them. With the plus button, you can add new folders to the media library. Just click on the folder and type its name. If you click on an existing folder, follow the same process; the new folder will be created as a subfolder of the current one.The invert button inverts the selection, so if you have image-1.jpg, image-2.jpg, and image-3.jpg, and you selected images 1 and 2, if you click on it, images 1 and 2 will be unselected, and 3 will be selected.With these buttons, you can change between list and grid view: This is the button for uploading files. You can select them from your computer, but you can also just drag them into the empty space in your folder in the media library.The delete button is also available, which is mainly for mass deleting files. If you want to do something with only one file, you can click on it, and three options will appear: rename, delete, and download. You can also filter by file name, that option is left to the upload button (4).Turning on different media features will also add new menu items to the Media menu under the Configuration menu. Media Cache: This menu item appears only if you turn on the Media Cache feature, which we discussed earlier. It contains options related to that feature, such as purging all the assets from the cache.Media Options: Here, you can see the configured media options. One option, for example, is Allowed file extensions, which tell you files with which extensions may be uploaded. You can configure these options from the appsettings.json file or other ASP.NET Core configuration providers. You can read more about it here. For example, if you want to allow only image uploads, you can specify extensions like .jpg, .png, or .gif. This ensures users can upload only images, preventing unauthorized file types like .exe or .zip.Media Profiles: In this menu item, you can define custom image transformations, such as resizing or cropping, to ensure consistent formatting across your site. For example, you can create a thumbnail profile that automatically resizes all product images to 200x200 pixels for a uniform storefront display.When you turn on the Media feature, you will also have a new content field, the media field. Returning to our example, we have trainers on the About page on Orchard Dojo. We already have a widget dedicated to trainers. A media field called image was added to the content type. You can see the media field's settings here: For example, when using the “Multiple” option, we can display multiple images in one media field. With the media field added, when we are creating a Trainer Widget, we can select an image: The plus button opens the media library, where you can select your image. After selecting the image, you will get a small preview of it: But let's see the blog post example. In our Blog Post content type, we have an HTML body (with the Trumbowyg editor). This supports adding an image with the image shortcode. Clicking on the “Insert Media” button, you can select the file from the media library. The result will be something like this: [], and the image will appear in the blog post after publishing it.In this blog post, we’ve seen Orchard Dojo's media library and how we use it, but let's look at another example: You have an e-commerce page where you sell tech products. With the Media feature, you can create product content items with media fields to display images of the products (even multiple with one media field). Let's say on the same site, you are also reviewing tech products in a blog-like format. When you are writing a review, you can use the image shortcode in the HTML body to display your photos of the product.To conclude, Orchard Core’s Media feature makes it easy and effective to manage media files across your site. With features like customizable media profiles, caching, and role-based access, it helps keep your media organized.Did you like this post? It's part of our Orchard Core Nuggets series where we answer common Orchard questions, be it about user-facing features or developer-level issues. Check out the other posts for more such bite-sized Orchard Core tips and let us know if you have another question!

Extension method for easier ResourceManagementOptions registration, Testing time-dependent functionalities with a time shifting clock using the Lombiq UI Testing Toolbox - This week in Orchard (03/01/2025)

In our first post of this year, we will examine a new extension method for easier ResourceManagementOptions registration, test time-dependent functionalities with a time-shifting clock using the Lombiq UI Testing Toolbox, and more! Without further ado, let's dive in!

Reorganize the Admin Menu, Add PollingTime & MinimumIdleTime to BackgroundServiceOptions - This week in Orchard (13/12/2024)

This week's topics are adding PollingTime and MinimumIdleTime to BackgroundServiceOptions and showing the Remove Field/Part button when it is system-defined. The community is reorganizing the Admin Menu, and we need your valuable feedback to build the best admin menu for Orchard Core!

Auto Attach the DashboardPart to content types with DashboardWidget stereotype, how to add import/export to an ASP.NET Core app - This week in Orchard (29/11/2024)

This week's topics include auto-attaching the DashboardPart to content types with the DashboardWidget stereotype and supporting randomly ordering results in SQL queries. Don't forget to check out our newest Orchard Nuggets post about adding import/export to an ASP.NET Core app! Let's see the details!

How to add import/export to an ASP.NET Core app? - Orchard Core Nuggets

When working with an ASP.NET Core application, it’s often necessary to move various content or configurations between different environments or back up critical information. Whether you’re setting up a new site, migrating content, or synchronizing data across multiple instances, the Orchard Core Deployment feature can simplify the process. This feature provides an easy solution for importing and exporting data.Are you new to Orchard Core? It's a great open-source framework and CMS built on ASP.NET Core. Check out the official getting started docs.Let’s say you manage multiple sites for clients. You might have a standard set of content (like sample blog posts, landing pages, or settings) to help clients get started. With Orchard Core Deployment, you can create these once, export them, and import them into each new Orchard Core instance to streamline the onboarding process. A similar example would be to move content or configuration between a staging and production app.To get started, go to Configuration → Features and search for “Deployment”. Some features will also enable others explicitly. We will go through each feature and explain what they do. Deployment: Offers a framework for importing and exporting recipes, JSON files containing configuration and content. This feature is the foundation of deployment (how we call export-import) in Orchard Core, allowing for the structured export and import of content, technical configuration, and user-editable settings for entire sites or specific components.Remote Deployment: Extends the deployment feature by allowing content export and import to and from a remote server. This feature is useful when managing Orchard Core installations across multiple environments, enabling direct deployment to remote instances, without downloading and uploading JSON files.Add Content To Deployment Plan: This feature adds an action in the content item action list to include specific content items in a deployment plan. This is useful when you want to select specific items to deploy without including the entire site’s content.Export Content To Deployment Target: Adds an option to the content item action list that allows you to directly export content items to a specified deployment target (including downloading the recipe, thus basically the content item inside a JSON file locally).View Or Download Content As JSON: Provides an action in the content item action list to view or download content as JSON files. This feature is helpful for reviewing content item details or troubleshooting.Here is an example of all the content item list actions that are added by these features:These actions focus on single content items and they are really simple. “View as JSON” and “Download as JSON” options are self-explanatory. If you select “Add to Deployment Plan” you will get a list of your current deployment plans and a default one will be created (“Export content to deployment plan target”):“Export to Deployment Target” will list the deployment targets. The default one is “File Download”:But what is a deployment plan? It’s a collection of steps that together produce a recipe JSON file. You can have multiple deployment plans. Let’s create one! Go to Configuration → Import/Export → Deployment Plans. Here you can see your deployment plans, rename them (with “Edit”), delete them, and modify them (“Manage Steps”).image alt="Deployment plans inside menu"]BlogPost/orchard-nuggets/2024/how-to-add-import-export-to-an-asp-net-core-app/deployment-plans-inside-menu.png[/image]Click on the “Add Deployment Plan” button. Here you can name your new deployment plan.After that, you can create the plan, and then you will see it in the list. Now click on the “Manage Steps” button for your deployment plan. You will see this screen, but it’s empty since you need to click on the “Add Step” button to add steps:Here you will see all the available steps:They have descriptions, but just to name a few important ones:All Content: Exports all the content items of the system.Content: Exports all content items for specified content types.Content Item: Exports a specified content item.All Features: Exports the state of all features, ensuring the same features are enabled or disabled across sites.We have two Page content items in our case, so let’s export those with the “My second deployment plan”.Add the “Content” step. Then select the Page content type. Additionally, you can check the “Export As Setup Recipe” option if the data should be exported as a Setup recipe. A setup recipe in Orchard Core is a JSON file that contains instructions for setting up content, configuration, and features on a new or existing Orchard Core instance, structured to automate the setup of a site. It’s almost the same as a recipe that you can export with the Deployment feature, just it needs to contain everything to set up a site, not just e.g. a couple of pages.After that, you can add the step by clicking on “Create” and execute the plan with “Execute”:When executing you can again select the target. The default option here is the previously mentioned “File Download” to download the deployment plan locally. This will download a ZIP file that has the “Recipe.json” file inside. This will contain in our case all the page content items.Okay, but how do you import? Go to Configuration → Import/Export. You will have multiple options:JSON Import: Here you can directly insert your Recipe.json file. You can copy the file's content, or you can also just drag the file there. The content will be visible as JSON and you can edit it before importing. In this example, we used the recipe which was inside the ZIP that we downloaded from “My second deployment plan”.Package Import: Imports a complete package (ZIP file) containing multiple JSON files, media files (yes you can export media files, by adding the Media step), and other resources. So this is best for large-scale site migrations or complete environment setups. You just need to select the ZIP file, then click on “Import”:In our case, this will throw an error but this is because we already have the two pages (thus the two permalinks of the pages are already in use), but if you import this package in another application that has the Page content type, it will work. But if it doesn’t have the Page content type, you can just add the “Replace Content Definitions” step in your plan, which will also export the content type after you choose it.But what if you want to import to a remote instance? If you have the Orchard Core Deployment Remote enabled you will see two more options under Import/Export: “Remote Clients” and “Remote Instances”.Under “Remote Clients” you can add your remote clients:You will need to set a “Client Name” and an “Api Key”. This will come from the client app. So for example, if you want to import from staging to production, you will need to go to production and create the client.After that, you can enter your staging site, and under “Remote Instances” you can add the instance.You will need to set a name (it’s just for display and can be anything) and a URL (which can be copied from under “Remote Clients” for example in your production app if you are importing to production).Then you will need to set the client name and the API key. These are the ones that you set first in “Remote Clients” in the other app.After that, the instance will be available as a target when exporting something (so it would be imported right into the target).Returning to the example at the beginning:Let’s say you manage multiple sites for clients. You might have a standard set of content (like sample blog posts, landing pages, or settings) to help clients get started.With Orchard Core Deployment, you can create the “template” of these sites, with the necessary items and settings, then export them into a recipe. After that, you can send that to your clients. Or Orchard Core Remote Deployment you can even export the recipe right to your clients' app.Orchard Core’s Deployment features make it easy to move content and configuration across environments or different sites. Whether you're migrating data or synchronizing settings, these tools simplify the process. Want to see these features in action? Check out our tutorial video to learn how to set up and use Orchard Core Deployment features!Did you like this post? It's part of our Orchard Core Nuggets series where we answer common Orchard questions, be it about user-facing features or developer-level issues. Check out the other posts for more such bite-sized Orchard Core tips and let us know if you have another question!