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

Blazor guide for decoupled CMS, Workflow Trimming Task - This week in Orchard (06/09/2024)

Blazor guide for decoupled CMS, a new Workflow Trimming Task, and our renewed Orchard Dojo website are the topics for this week. You can still cast your votes for the Jean-Thierry Kéchichian Community Award! Only one week left until the Orchard Harvest conference! Let's see the news for this week!

Featured tags

IIS
API
All tags >

This week in Orchard - 8/23/2018

Last week we had no 'This week in Orchard' post because of vacation, so in this post we will focus on the happenings of last week. And we have a lot to talk about so get ready for a longer post! On Orchard 1.x The latest version of Orchard 1.x (Orchard 1.10.2) released on Apr 27, 2017. The community fixed several bugs since then, so the next release of Orchard 1.x will be arrive soon. We would like to have a working Dynamic Compilation with C# 7 for the next version and Lombiq is working on this issue. After that, the community will release Orchard 1.10.3. On Orchard Core Culture settings A new, Culture object is available in all Liquid pages on top of the Site object. This represents the site's default culture as an ISO language code. Culture has Name, that is the request's culture as an ISO language code, for example: en-Us. The Dir property of the Culture object contains the text writing directionality, like rtl or nothing that is the default means left to right. We need to mention two helper methods here, that you can use in the Razor layouts of Orchard Core. The first one is the OrchardCore.CultureDir() With this method, you can set the value of the dir property. You can see an example in the Layout.cshtml file of the TheAdmin theme. <body class="preload" dir="@OrchardCore.CultureDir()"> ... </body> The second one is the OrcharCore.CultureName() that is used in the same file: <html lang="@OrchardCore.CultureName()"> Instead of typing CultureInfo.CurrentUICulture you can just simply use this method and this way you don't have to add a using to System.Globalaziation, OrchardCore.CultureName will be enough. Demos Resume theme for Orchard Core Antoine developed a new theme for Orchard Core, called Resume. You can download the new theme as a NuGet package and you can also test the theme here. Check out this site, that is using this theme here. If you are interested in the features of the new theme, check out the recording of last week's Orchard meeting from this point. MiniProfiler Scott Hanselman updated his PC and now can build Orchard Core in 7.2 seconds. MiniProfiler is a simple, but effective mini-profiler for .NET, Ruby, Go and Node.js. Now you have the ability to enable MiniProfiler for Orchard Core. After that you can see for instance the duration in ms that is needed to render the different parts of the site. With the help of the MiniProfiler you also have the ability to test the caching of your site. This feature is available on the sebros/1895 branch. Culture management improvements In a previous post we mention that how you can set up the default culture of your site. Now let's see the new features of Orchard Core's localization! Make sure you enabled the Localization module. The default culture will be used if the user didn't provide any information about the language that they use. When you host your site on localhost and reach that by an URL like: https://localhost:44300 you will see that the request header contains an accept-language: en-us. ASP.NET Core with the default configuration will look into this header and take it as a hint to find that language to use to render the page. It actually takes three elements into considerations by default: first its looking at the URL. If we say that: https://localhost:44300?culture=en-Us, it will take that in priority, because we explicitly asking for this page with the en-US culture. If we type: https://localhost:44300?culture=hu-HU and ask for Hungarian, we get the following when we see the page source, because we haven't set the site to support the Hungarian culture. Then let's go to the Configuration -> Settings -> General page using the Dashboard. Here you can manage the default cultures that your site supports. This list tells that this site is available in these languages. Let's add a supported culture for the site by clicking on the Add or remove supported cultures for the site link. Here select the hu-HU | Hungarian (Hungary) culture and hit Add. Also add the en-US | English (United States) culture to the list. Then go back to the General Settings page and hit Save. The site will restart for the settings to take effect. Now if you view the page source you will see the following value of the lang property: Your site now supports the Hungarian culture and Orchard can render you this page with the requested one. Let's see a more interesting sample! Let's add a culture that uses RTL writing, for instance the fa-IR | Persian (Iran) culture. After if you ask the page with the fa-IR culture, you can see other changes in the page source as well. For example, the body dir has the rtl value, that means we can customize the css files in the themes based on the direction of the writing. If you set up the site using the blog recipe you can also check out the correct format of the date. Don't forget to watch the recording of the whole Orchard Podcast for the full demos! Demoing the capabilities of Orchard Core Beta 2 Last Friday, Sébastien gives a nearly 2 hours long demo about the capabilities of Orchard Core! If you are new to Orchard Core and want an introductory overview about every notable features and goals you should check out his fantastic presentation! In the next lines we will give you a recap about the content of this presentation. A quick overview of the OrchardCore solution using the Solution Explorer of Visual Studio First, we have a quick overview of the OrchardCore solution using the Solution Explorer of Visual Studio. Under the src folder, there is an OrchardCore folder, that contains useful projects for every other module. OrchardCore.Module folder contains not CMS-specific projects. For example, the Admin site, deployment, sending emails is nothing to do with the CMS. All these modules can be reused in any other app. The OrchardCore.Modules.Cms folder contains content management specific modules, like managing content types, content fields, alias, autoroute to build routes dynamically, etc. The main difference is that now you can create any web application and just reference a package called OrchardCore.Application.Cms.Targets and that references all the projects and any other modules for the CMS. The OrchardCore.Application.Cms.Targets is a project that just references all the CMS projects and the themes we have. If you just want an MVC app, that is not a CMS, you should reference the OrchardCore.Application.Mvc.Targets project and then you won't have any CMS-specific modules, just the MVC logic to create an MVC modular app. The OrchardCore.Cms.Web is just a simple web app, that references the OrchardCore.Application.Cms.Targets project. Other difference here is that you can have modules and themes anywhere in the solution. Every project can be anywhere, there is no specific location to put the files, like Modules folder or Themes folder. The folders above are just solution folders, not physical folders. Bag Part After we fire the application, Sébastian shows the menu of Orchard Core and the content items and content types, that are generated using the Agency setup recipe. Here you can find the Landing Page content type, that has a Services part. This part is a named part, called bag part. A bag part is a content part that can contain other content items. If you check the Contained Content Types, you will see that this part can only contains Service content items. Live Preview in Orchard Core In Orchard Core, the content item editor has a Preview button. Just Ctrl+Click on this button and try to edit the content of any content item. You will see your changes instantly in the new window thanks to the live preview feature. Templates In Orchard Core you still have the ability to create Razor templates as you did it in Orchard 1.x. The themes called SafeMode, TheAdmin and TheTheme contains the familiar cshtml files. We can now make Liquid templates as you can see it in the case of the TheAgencyTheme or in the TheBlogTheme. You can create these files nearly with the same name convention as you did before in Orchard 1.x. But the TheAgencyTheme doesn't have a Content-Landingpage.liquid in the theme. Orchard Core has a module called Templates, that allows you to define front-end templates from the admin. If you navigate to Configuration -> Templates (and set up your site using the Agency recipe) you will see the template for the Landing Page content type. Here you can edit your template and also have the ability for the live preview! If you want to show what's available for instance in the Model.ContentItem.Content, you can simply render that using Liquid. The Liquid will output the JSON of the requested content and you can access every part of it directly without needing to save your template thanks to the live preview feature. If you define a template in the admin, it will overwrite everything that is defined in the file system. Running queries in Liquid pages Let's say you set up your site using the Blog recipe and created another new blog post to it with title 'A very impressive blog post'. If you have enabled the Queries and the SQL Queries module you can add a new query under the Queries menu of Content from the admin. Here we created a query called BlogPosts that will return every published content item with BlogPost content type. Check the tick near the Return documents checkbox. In this case the query will also return the documents (in this case blog posts) not just the DocumentIds. Now let's create a new Liquid page called Blog Posts where we will render the results of the previously created query. We have a Queries object available here that has access to all the defined queries. Using Liquid, we can iterate through the resulted items of our BlogPosts query. These are SQL queries, so everything that is available in SQL you can query on that. Flow Part A flow part is like a bag part, but for widgets. Widget is a content item that is rendered in some way in a page. A flow will let us display all the available widgets. Widget can be any content type that you define. Let's say we add a simple Html widget to a page with some content. The nice thing with the flow part that we can organize each widget on the flow of widgets. So, I can say it's justified, means it will take the full width of my page. In this case you can create pages based on pieces of contents and can organize them in columns. And we also have a widget called Container that is also a flow of things. You can create all the widgets that you want. For example, you can create a carousel widget that has a bag part of slides and then you can simply add more slides to it with your properties. Why do we need Liquid and Jint instead of Razor We use Liquid, because Razor is not safe, because its C#. If we let the admins or anyone to write Razor, we let them write C#. If we let them write C#, we let them to have access to everything. In Liquid you only have access to the properties that are opted in, so it’s like a sandbox. The Layers module lets you edit widgets, place them in zones across the site based on rules. The Blog recipe has one widget, called Footer which is applied using the Always rule. This rule has a simple expression: true. This is JavaScript, because it’s safe, we do not have to run C#. Orchard Core also uses JavaScript in the Workflows module, where all the scripting is done without C#. We haven't mention every aspect of the demo in the examples above, so we definitely suggest to take your time and watch the whole demo! There is a possibility that a new live demo about how to create a new theme from scratch in Orchard Core will come from Sébastien this Friday (Aug 24). If you are interested in taking part in the live demo, check out his Twitter for further information!

This week in Orchard - 8/9/2018

In the latest Orchard Podcast we have a demo about the improvements of the Deployment module and have a nice demo about the GraphQL feature of Orchard Core! On Orchard Core Deployment Last time we mentioned that you can run a recipe on a separate Orchard instance on another server. So, you can link two servers and the client can send a POST request to the remote machine. Then you can upload content to the different machine, like production from the staging. Now we have a refact about how the deployment steps were executed. The idea is that: when we create a deployment plan and execute it we generate a ZIP file, that could contain recipes, medias and anything else that you want to include in the ZIP file. This is how the content exporting works. After that we can send this package to any target. These targets are extensible, we could export it to a file for a browser to download it or to an endpoint, therefore we could send that package to another Orchard instance and we can define even more options, like we can send it to an FTP or to a Git repository. So, in this case you can easily create for example backups. Another instance can read these Git and FTP endpoints to download that and to make the intermediate server to get the deployments, so there are many ways to use that. Now the logic that imports the file are extracted, any module can do something when the package is imported. GraphQL By enabling the GraphQL module of Orchard Core, you have the ability to run GraphQL queries using the new GraphQL explorer from the dashboard under the Configuration menu. This feature isn't release ready yet, because for instance it cannot lists fields or Markdown yet, so if you want to try out the GraphQL, switch to the jsonapi branch. In the explorer everything based on metadata schema, that means you can introspect what you can query. Just hit CTRL+SPACE and you have access to everything you can query. The context menu shows all the available content types for you. Demos Deployment Let's see a short demo about the deployment! For this, we will run two Orchard Core instances on localhost. Let's image a scenario where we send packages from the staging server to the production environment using the deployment module. For this, you have to create a remote client on the production instance under the Content -> Import/Export -> Remote Clients menu. The remote client is what is able to execute a deployment plan by using a given URL, that could be: http://localhost:2919/Deployment/ImportSo, create a remote client with name "Production" and add an API key. Now you have to define a remote instance in the staging environment under the Remote Instances option. Remote instance is the instance where you want to upload the plan. You have to add the URL here that you can find on the other instance's Remote Clients page. You also have to use the same Client Name and Api Key here that you have defined earlier. After that you can create a Deployment Plan. Deployment plans have deployment steps where you can define the elements that you would like to export. For instance, by selecting the Content step you can export all the content items for the specified content types. For the Demo, I have selected to export every blog post. You have the ability to add other steps to your plan as well. Now if you click on Execute, you will see the available targets, where you can deploy your plan. If you select the Production (which is the name of the previously created remote instance), Orchard will deploy your selection to the Production instance. But if you choose the File Download target, you can also download a ZIP file, that contains a Recipe.json. And here comes the Package Import option under the Import/Export menu. GraphQL Let's see a simple demonstration about the capabilities of the GraphQL explorer! The following query will list you the blogposts with its created UTC, Title Part, owner, the path value of the Autoroute Part, etc. The contentItem() is a custom filter which let's you define a content item by it's ID and you will get the content item. You can also have queries here. For instance, recentBlogPosts is a query that was done in Lucene. On Orchard Harvest The latest conference was held in New York, February 2017. In the podcast, the community have a discussion about the next possible Orchard Harvest. There will be propably no Harvest this year, because the community needs to be more advanced with Orchard Core and then they can think about Harvest. Organizing a conference with a released and more powerful Orchard Core could be more interesting for people to take part in the event. Don't forget to watch the whole recording of this week's Orchard meeting!

This week in Orchard - 7/26/2018

Orchard Podcast is back with 3 demos about the new features of Orchard Core! On Orchard 1.x At this meeting, the community discussed the two new fixes that goes the dev branch of Orchard 1.x, that we have mentioned last week, thanks to Chaleomkiat Munkong. Firstly, he fixed an error in ContainerSettings while editor validating, that comes when attaching a ContainerPart to a content type that has too many parts inside and some of these parts has settings with input validation. When saving with invalid value, you will get an exception. You can see that fix here. This issue also comes up while validating the values of Date Time Fields, so now we also have a fix for that. On Orchard Core Demos This week we had 3 demos about the new features of Orchard Core. Notice that these features are under development, so you will not have these changes in the dev branch of Orchard Core. Having a UI when running setup recipes Now you have the ability to run setup recipes using the Dashboard. You can head to the Configuration/Recipes menu, where Orchard lists you the available recipes. When you click run, the system will execute the commands in the selected recipes. After the demo, the community have a discussion about the further improvements of this feature. That could be a very useful feature, if the admin would have the ability to pass parameters from the dashboard to the recipes, like in the ARM templates. That could be also a good improvement to have recipes like migrations. So, the users could write a migration in recipe files. YouTube Video field Let's say that you attached the YouTube Video field to the Page content type. When you edit the content definition of the Page, you have the ability to set the width and the height of the embedded YouTube video. And when you create a new Page, you can enter the embedded URL of that YouTube video. The next improvement could be to let the users insert the original YouTube video URL (just copy it from the address bar of the browser), because now they need to have the embedded URL pasted here. Default culture When you enable the Localization module, now you have the possibility to set the default culture of the current tenant using the General page of Settings. You can also add or remove different cultures to the tenant, like in the page below. If you are interested in every new commit of the dev branch, head to the GitHub repository of Orchard Core! You can also watch the whole recording of this week's Orchard meeting!

This week in Orchard - 7/19/2018

We have no Orchard meeting this week, but the development of Orchard continues. On Orchard 1.x We have two fixes in Orchard 1.x thanks to Chaleomkiat Munkong. Firstly, he fixed an error in ContainerSettings while editor validating, that comes when attaching a ContainerPart to a content type that has too many parts inside and some of these parts has settings with input validation. When saving with invalid value, you will get an exception. You can see that fix here. This issue also comes up while validating the values of Date Time Fields, so now we also have a fix for that. On Orchard Core Orchard Core has much more fixes and improvements since the latest post, so let’s check some of those. Matias fixed the content ownership on agency.recipe.json. If you head to the commit, you can realize that the values of the owner and author are no longer hardcoded null or admin, now that comes from the AdminUsername parameter. Antoine fixed an issue, where he set’s the value of the Font Awesome to version 4 on TheBlogTheme, because in the case of version 5, the brand icons need a fab prefix. Orchard Core has more detailed documentation than Orchard 1.x, and of course spelling and grammar issues could occur. In this commit Ryan fixed a huge amount of spelling and grammar issues of the documentation. If you are interested in every new commit of the dev branch, head to the GitHub repository of Orchard Core! On Lombiq Orchard Dojo Newsletter Maybe you haven’t heard about it yet: Lombiq announced the Orchard Dojo Newsletter. If you subscribe to this newsletter you will get an e-mail every time when a new post published to Orchard Dojo, including ‘This week in Orchard’ of course. So, if you want to keep up to date with Orchard news, subscribe to Lombiq’s Orchard Dojo Newsletter!

This week in Orchard - 7/12/2018

We have no Orchard meeting this week, because it 'conflicts with the World Cup and they didn’t want to cancel'. :) So, let's see the most important news of this week. On Orchard Core Let’s see some numbers of the Beta 2 release of Orchard Core. If you visit the NuGet Gallery, you will find that more than 250 user downloads the OrchardCore.Mvc.Core Nuget, and there are numerous downloads for the previous releases as well. If you type OrchardCore in to the search box of the NuGet Gallery you can find that there are 137 packages mainly from Sébastien Ros of course, but there are other packages as well, for instance the Disqus.OrchardCore module, that allows you to add comments on a content type. There aren’t any new commits in the dev branch of Orchard Core, but the contributors pushing the features and fixes in their branches industriously. For instance there are several commits in the culture-settings branch to implement a feature that will allow to set the allowed cultures and the default one in the admin. In GitHub you can find the issues that marked with the beta3 tag. These are the planned features and fixes that would be included in the Beta 3 release of Orchard Core that has an estimated due date in 3rd of September. There are about 100 open issues left, so carry on and pick some to work on! If you have any questions or you are just interested in the discussion around Orchard Core, feel free to drop on Orchard Cores dedicated Gitter. On Lombiq Orchard Dojo Newsletter Maybe you haven’t heard about it yet: last week Lombiq announced the Orchard Dojo Newsletter. If you subscribe to this newsletter you will get an e-mail every time when a new post published to Orchard Dojo, including ‘This week in Orchard’ of course. So, if you want to keep up to date with Orchard news, subscribe to Lombiq’s Orchard Dojo Newsletter!

This week in Orchard - 6/28/2018

Orchard Core Beta 2 is out now! Orchard Core Framework and Orchard Core CMS Beta 2 are now public on NuGet. Read the release notes and the documentation for more details. On Orchard 1.x Orchard 1.x has only one small change regarding the WebRequestActivity.cs where the handling of HTTP Delete method was missing. On Orchard Core Orchard Core Beta 2 The Beta 2 release of Orchard Core comes with several changes. To list the changes from the release notes: Update to ASP.NET Core 2.1 Precompiled Razor Views Razor Pages Updated to Bootstrap 4.1 Admin responsive menu Assets user interface improvements Fragment caching Content and Query tag helpers Code based manifest files Updated OpenId Social login support Email module Password reset Email confirmation Site and User timezones Date Time (with timezone), Date and Time fields Workflows module Forms module Azure Blob Storage Assets Data Protection dotnet new templates There were 60 contributors on Orchard Core, and it's just the second beta release. Check out the trend in the project's GitHub page! Now, by using Read the Docs, Orchard Core has a quite detailed documentation about how to start working with the framework, descriptions about the CMS and Core modules and so on. The community also provides a solution with several Orchard Core samples in GitHub. This sample web application is demonstrating how to build a modular and multi-tenant ASP.NET Core application. But if you need a step by step tutorial about building a multi-tenant ASP.NET Core application read Sipke Schoorstra's article on Building multi-tenant ASP.NET Core Applications with the Orchard Core Framework. If you have a profile on Facebook, follow the newly created Orchard Core page where you can read about the most important news around Orchard Core and don't forget to join to the Orchard Core User Group. Demos Creating a new website using the code generation templates In the next short tutorial, we will create a new Orchard Core website using only the code generation templates. First you have to make sure that you have the latest version for both Runtime and SDK of .NET Core. The current version of the SDK is v2.1.301 and the Runtime has a version of v2.1.1. You can download the installers from here. Fire up the Command Prompt with administrator privileges. The following command will install the most stable templates for creating Orchard Core Cms web applications. dotnet new -i OrchardCore.Cms.Templates::1.0.0-beta2 You can also use the latest dev branch of Orchard Core if you specify the NuGet source to use during install, but for now let's just work with the most stable version. dotnet new -i OrchardCore.Cms.Templates::1.0.0-beta2 --nuget-source https://www.myget.org/F/orchardcore-preview/api/v3/index.json Navigate to the folder where you want to install your application. The dotnet new occms command will install a new Orchard Core Cms Web App to the current directory. If you type dotnet run, the compiler will compile your application and for default it will listening on http://localhost:5000. Open a browser and visit the newly created site. If you are interested in every new changes that added to the Beta 2 version of Orchard Core to this week, don't forget to check out the recording of the weekly Orchard podcast. Now go ahead and set up your Orchard Core application!

This week in Orchard - 6/20/2018

The Orchard community is so close to release the Beta 2 version of Orchard Core. If you check out the beta2 milestone tag in the project’s GitHub page, you can see the few issues that are left for the upcoming release. On Orchard 1.x But this week is not just about fixing the issues of Orchard Core and implementing its new features. Smaller bug fixes were also added to Orchard 1.x: E.g. if you wanted to hide and show text per radio button, it works by clicking on the radio button, but at Page Load everything was shown. Or new css rule-sets added for superscripts and subscripts of the Theme Machine’s Site.css, and now these tags don't look like normal text. On Orchard Core Workflows (OrchardCore.Workflows) As mentioned, there were a lot of merged changesets to the developer branch of Orchard Core. If you are interested about every fix and feature, check out the recording of the latest Orchard community meeting from 3:15. Forms (OrchardCore.Forms) The OrchardCore.Workflows module is available, and you can enable it from the dashboard. The Workflows module provides a way for users to visually implement business rules using flowchart diagrams. And from now every activity can start a workflow, not just Event activities, that typically listen for an event to happen before execution continues. There are also two sub-features of the Workflows module: HTTP Workflows Activities and Timer Workflow Activities. By enabling HTTP Workflows Activities, you have the option to add new task and event type activities to your workflows. For example you can add an Http Request Event activity that you can set as a starting point of your workflow. By sending an HTTP request to a generated URL (like https://localhost:44300//Workflows/Invoke?token=CfDJ8MBBg4_qSN5) you can fire different events. In the attached screenshot, after invoking this endpoint with a GET request the site will redirect the user to the homepage using the HTTP Redirect Task (that also comes from HTTP Workflows Activities) and show a notification to the user. For more information about the Workflows module, check out the author's, Sipke Schoorstra's post about the new features of this module or if you are interested in a tutorial on creating a new content approval workflow from the ground up, please follow the steps of this demo: http://www.ideliverable.com/blog/orchard-core-workflows-walkthrough-content-approval. You can find a Readme.md file in the module's project, where you can read about the available activities. Forms (OrchardCore.Forms) By enabling the OrchardCore.Flows module, you have the ability to attach Flow content parts to your content types. The OrchardCore.Forms module relies on this module, that means now you can add several different type of Widgets to your custom type. Therefore you can simply build a form where users can enter a text and submits its content. The editor looks like the following: You can see the settings of the Form and the added widgets, like Input, Button and Validation. To be able to use Captcha, don’t forget to set up the Site Key and the Site Secret under /Admin/Settings/nocaptcha. Demos In this week we don't have any demos, but because this is the first post of the 'This week in Orchard’ series, let’s check out some demos from the previous meeting. New editor type for the Boolean field When you add a new Boolean field to your content type you have the ability to choose what type of editor you want to use. If you chose the 'switch' option, you'll have a different styling for the Boolean field when you specify the value of that field while creating a new content item of that type. In this screenshot below you can see two editors with switch and standard types. Setting database presets If you enable the Tenants module, you have the ability to create multiple tenants. When you create a new tenant, you have the option to set the database presets under /Configuration/Tenants. Let’s say you would like to use SQLite for your database. Then if you navigate to the setup screen of the newly created tenant, you don’t have the ability to set or change any setting regarding the database presets. If you choose SQL Server for the database, you also have to specify the connection string from the main tenant. You can't configure the connection properties from the subtenants. If you are interested in every new issue and feature that was added to Orchard Core, don't forget to check out the whole recording of the latest Orchard community meeting!