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 - 11/15/2019

This week we would like to show you two demos about the newest features of Orchard Core. First, you can take a look at the brand new content items UI, then we will dive a bit deeper and try out the new Trumbowyg editor for the Text Field and the HtmlBody Part. And of course, the discussion continues about the next Harvest! On Orchard Core Filter Features dependencies When you navigate to Configuration -> Features you have the ability to enable or disable the different features. To find the feature you want easier you can use a filter here and can type the name of the module. This filter only sort by the name of the feature. From now this filter checks for the different dependencies too! For example, if you type localization, you could see the Content Culture Picker in the list, because this module has dependencies with names like Content Localization or Localization. Harvest Core 2020 Sipke Schoorstra has connections in Nice and Miami, so that would be easier to organize the next Harvest one of these cities. Nice is in Europe, but Miami is warmer and easier to travel there from Europe because it's on the East Coast. The two possible dates are February and April, but the weather is not the same in these cities. If we do it in April, Nice would be the better option because of the weather. Miami is warmer in both months, so that wouldn't be an issue. Stay tuned for more information about the next Harvest! Demos New content items UI Now when you enter the admin site and go to Content -> Content Items, you will see a brand new UI. Under the Content Type dropdown, you can filter the items based on the selected or the typed type. You can filter the items by their status using the Show dropdown. And lastly the Sort dropdown is responsible to order the items by title, recently created, recently modified or published. If you select more than 1 item, you will see a new dropdown, called Actions, instead of the dropdowns we mentioned above. By using the Actions, you can publish, unpublish or delete the selected items. Lastly, we would like to mention the Filters dropdown near the textbox that has the Search all content items placeholder text. By using this you can filter the list by showing only the draft items, only the published items or the items owned by the logged-in user. Adding Trumbowyg editor for TextField and HtmlBody Let's set up a site using the Blog recipe. This recipe contains an Article content type. If you edit the definition of the Article under Content -> Content Definition -> Content Types you will see the attached HtmlBody Part. Hit Edit near it and select that you would like to use the Trumbowyg editor type. Under the editor options you can explicitly set the config you want to use, for example, which button you want to add to the toolbar. If you navigate to the OrchardCore.Resources module and check the content of the Assets folder, you will see the files that needed for the Trumbowyg plugins to work. Therefore you can use every existing plugin that is described on this page. Trumbowyg has a lot of plugins that you can use to customize your editor. Now let's add some new buttons to the editor! We will use the emoji, the giphy, and the font family plugin. All you need to do is to extend the btns section of the editor options like this: btns: [ ["viewHTML"], ['emoji', 'giphy', 'fontfamily'], ["undo", "redo"], ["formatting"], ["strong", "em", "del"], ["foreColor", "backColor"], ["superscript", "subscript"], ["link"], ["image"], ["align"], ["unorderedList", "orderedList"], ["horizontalRule"], ["removeformat"], ["fullscreen"]], plugins : { giphy: { apiKey: 'N5OwBrzBjP8nXXaFdv1TvVwZ82DWNUSz' }} Here you can see that the three new buttons will be placed after the View HTML button and will be near each other without a separator. The buttons you define in the same square brackets will be in one group. You could also see that we added a new section here, called plugins. Here you can define the options that needed for the different plugins. For example, to use giphy, you need to have an API key that will communicate with GIPHY. If you navigate to the Dashboard on the GIPHY Developers page you can create a new one by clicking on the Create an App button. Now you have successfully set up the editor options. It's time to create a new Article! Notice the three new dropdown buttons near the View HTML button and use them to create your awesome article! Another nice stuff is the template plugin, that manages a set of HTML templates to insert fast. In these options we only define the templates plugin with two options: { btns: [ ["template"] ], plugins: { templates: [ { name: 'Lorem ipsum', html: '<p>I am a Lorem ipsum template</p>' }, { name: 'Lorem ipsum 2', html: '<p>Another Lorem ipsum template</p>' } ] }} In this case, the editor will look like the following, where if we select the Lorem ipsum 2 option, the following HTML content will be injected to the editor. The same works for HTML Field too. If you add a new HTML Field to your content type and set the editor to Trumbowyg editor, you can define the editor options and you will get a customized Trumbowyg editor. On Lombiq Upload recordings of demos from the weekly meeting in separate videos We have an idea to upload recordings of demos from the weekly meeting in separate videos as well, so they can be found easier. To help us decide please visit our Tweet and choose from the following options: Good, I look for demos! Good, but don't need it. Bad, why more videos? Another idea, see reply! Searching for performance-intensive codes Do you write a performance-intensive code? Then help us build the nerdiest .NET thing! Drop us a line to [email protected] and we'll ask a few questions about the challenges you encounter, and in exchange, we'll show you how to make a chip out of your programs! Orchard Dojo Newsletter Now we have 102 subscribers of the Lombiq's Orchard Dojo Newsletter! 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 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!

This week in Orchard - 11/08/2019

Orchard Core has a brand new redesigned admin menu to help you find the settings you want easier. The CMS gets a lot of new improvements and fixes from time to time and it's time to start a discussion about releasing version 1.0. And now it's time to organize the next Orchard Harvest! Would like to know more? Then don't hesitate, check out our latest post with this week's news! On Orchard Core Add UI for PageSize You can edit the setting named PageSize that exists for a time ago, but there was no UI for it. This setting should be used when using pagers so that users can define how many items they want to see on the page. Rename Default into Current in Themes It could be quite confusing that the currently active theme is called Default on the admin UI. It's not something that would be enabled by default (since setup recipes decide this) and it's not a fallback in case of no other theme either since that's the Safe Mode Theme. So from now the new name of the Default theme is Current theme. Just head to Design -> Themes to see the changed interface. Adding token expiry for GlobalMethod and documenting scripts There was an issue with the lifetime of the workflow token. Now when you don't specify the lifetime of the workflow token you will get the value of the NoExpiryTokenLifespan variable in days, which is 100 years. Here you can see the updated code using the mentioned NoExpiryTokenLifespan variable. public class TokenMethodProvider : IGlobalMethodProvider{ private readonly GlobalMethod _createWorkflowToken; public TokenMethodProvider() { createWorkflowToken = new GlobalMethod { Name = "createWorkflowToken", Method = serviceProvider => (Func<string, string, int, string>)((workflowTypeId, activityId, days) => { var securityTokenService = serviceProvider.GetRequiredService<ISecurityTokenService>(); var payload = new WorkflowPayload(workflowTypeId, activityId); if (days == 0) { days = HttpWorkflowController.NoExpiryTokenLifespan; } return securityTokenService.CreateToken(payload, TimeSpan.FromDays(days)); }) }; } public IEnumerable<GlobalMethod> GetMethods() { return new[] { _createWorkflowToken }; }} And now you can find documentation for the javascript methods that are available in workflows for instance. When to ship Orchard Core 1.0? If you check the .NET Core Roadmap, you could see that the release of .NET Core 3.1 is scheduled for December 2019. The suggestion is to ship Orchard Core 1.0 with this version of .NET Core because there won't be any update until the .NET 5.0 and this way the community could align the same way as did when released Orchard Core RC. It gives the community one month to polish and merge missing PRs. This way there will be no need to reupdate when 3.1 is released. Starting the discussion about the next Orchard Harvest We will have a 1.0 soon and we already have the RC of Orchard Core. The community decided to organize the next Harvest if Orchard Core reaches a state that we can show at the conference. Now it's time to show the new framework by workshops too to learn the features of the new version. The suggestion is to make it happen in February or April of 2020. Let's do it probably in Europe because the last time it was in the United States. There are some options like Hungary, Italy, Greece, Spain or England. So, let's come back to this topic later and keep up the discussion! Building Workflow Driven .NET Core Applications with Elsa Sipke Schoorstra decided it was about time to take Orchard Core’s workflow engine and philosophies and turn it into a reusable, .NET Standard library, enabling any .NET application to enjoy the power of workflow. In this huge and informative post, he introduces Elsa, an open source suite of .NET Standard libraries and tools that enable developers to implement long-running workflows. The core philosophy of Elsa is to be able to connect small executable units with one another, allowing you to orchestrate real business processes such as document approval, customer on-boarding and order fulfillment processes. Following the guide "Creating a new decoupled CMS Website" live on Twitch Davin Davies a.k.a. copperbeardy decided to follow the guide called Creating a new decoupled CMS Website and broadcasting it using a live stream in Twitch. He tried to follow it once at the end of October, that session was very useful to fix and update the documentation and in some cases the code to be able to follow that with the latest changes of Orchard Core. Check out his second stream about following that guide again to create a decoupled site! Demos New Admin menu Here you can see the admin menu of Orchard Core if you enable every feature. Some of them don't have many sub-items, for example, the Content has only two (Content Items and Assets), and some of them have quite a lot. If you check the Configuration option, there are 13 sub-items. And at the bottom of the screen, you could see that every authentication provider has its own entry instead of grouping them in a section something like Authentication. There was a suggestion to reorganize the admin menu to make it cleaner that could make it easier to find the options you want. That could be a good point for the new structure to use the same setup as we used when updating the documentation. If you open the docs and click on the Key Topics, you could see a menu in the left with the following points: Manage your Content Customize the Display Localize your site Handle the Media Navigate between pages Query and Search data Secure your application Workflows When you update to the dev branch of Orchard Core you will face with the new, redesigned admin menu. Let's see what will you see if you enable every feature that is available right now. As you can see, the Content menu has everything you need to define your content types and manage your content items dynamically. Under Design, you could see everything related to the look and feel of your site. Here you can define templates, change the themes, etc. Widgets is a new option where you can edit the widgets and layers. That option was called Layers in the previous structure. Under Security, you will find the settings of the third-party authentication providers, can manage the users and the roles, and of course the OpenID settings. But that's enough talk for now, check out to the dev branch of Orchard Core and try the new admin menu now! On Lombiq Searching for performance-intensive codes Do you write a performance-intensive code? Then help us build the nerdiest .NET thing! Drop us a line to [email protected] and we'll ask a few questions about the challenges you encounter, and in exchange, we'll show you how to make a chip out of your programs! Orchard Dojo Newsletter Now we have 100 subscribers of the Lombiq's Orchard Dojo Newsletter! 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 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!

This week in Orchard - 10/11/2019

The Preview feature is improving, you can have admin templates and better defaults for the SearchController, and we are just scratching the surface of the new features that coming to Orchard Core. Let's check out those with some other fascinating features! On Orchard Core Validate stereotypes This prevents stereotypes from having non-alphanumeric values because these are used for file template names. Another issue was people assume that they can provide multiple stereotypes by passing a coma, but no, it's not a valid use case. Here's the fix in the UpdateAsync method of the ContentTypeSettingsDisplayDriver by adding the IsAlphaNumericOrEmpty private method. Fix attached media field add button visibility There was a couple of regressions with the media editor and media attached field editor: the delete button doesn't seem to work anymore (permanently disabled) in the media attached field editor, the add button doesn't reappear after deleting an image until you publish and re-edit the page You can see the fixes in the following gif. Adding shape_dump filter Do you remember the Shape Tracing feature in Orchard 1? It's like pressing the F12 button in a Chrome browser, but for shapes. You will see all the shapes that have been rendered and all the alternates and the source code for alternates. It makes easier to template shapes. The first step is towards this feature in Orchard Core is to use this filter to dump a shape. With this filter, you can export the JSON document of the shape. Let's say we have a site installed with the Blog recipe. Use the shape_dump filter in the Content-Article.liquid file by adding this line: {{ Model | shape_dump }}. After if you navigate to an article, you will see the following page with the rendered JSON document. This feature is under development, but you can check the current progress in this branch. Orchard Core Preview feature improvements The idea is to improve the Orchard Core Preview feature. Today when we do a preview it's using the ContentItemController, the one that renders the ContentShape. With that, you can have your own custom templates and it will render that. When you click on the Preview button, there is a new window that opens and this new window will call into a custom preview controller. This controller is in the OrchardCore.ContentPreview module, called PreviewController. What it does is when it's get called on a POST from the second window it gets the content item, which is inside the form post and tries to update the result of the POST, like it was a publish or a save action on the form. And in the end, we get a new content item as if we were about to save the content item form. And from this content item, we just call BuildDisplayAsync and render it using a view. And the Render.cshtml will just render the shape in the current layout of the frontend. The improvement would be to find a way to customize how to render the page in the preview window. This feature is working well when we are using the content shapes with the full CMS mode, but when we are in the decoupled mode to render anything it's not based on the content shape. It's based on the developer's own views and templates and controller actions. There will a new part, called PreviewPart, that contains nothing, but has settings. When you attach the PreviewPart to your content type, you will go to Settings and define the pattern to use to build the path. So, the developer makes their own view and then they can configure this content type to say that for the preview you should use my route that will display my content type. Then when we click on the Preview button, intercepting the Render to invoke the URL that will actually render the content item from the developers perspective instead of trying to render the content item using the content shape. In this case, we won't have any customization. In the end, we will have a working preview feature even in decoupled mode. If you are curious about the current state of this new feature, check out this branch. Demos Admin templates It's like templates, but for the admin. Let's see how it works! We have front end and admin themes. When you want to customize the admin theme, right now there is no other way than creating a new theme and having the theme as a base one and selecting your own admin theme in the dashboard. This feature is kinda same as the templates module and lets you create shape templates from the admin itself for the admin. This way most developers won't have to create a custom admin theme, because it's usually just to change a summary for a blog post or a detailed template for a specific widget to look different. Or maybe you would like to hide something like you want to hide the TitlePart editor in a way to make it different. Set up a site using the Blog recipe. To use this feature head to Configuration -> Features and enable the Admin templates feature. After you will see an Admin Templates option in the Configuration menu. Here click on the Add Template button to add a new admin template. Let's call this template Content_SummaryAdmin__BlogPost to override the summary admin shape of a BlogPost. Give it a likable content and hit save. Now navigate to the Blog option in the admin to see the list of the blog posts. Here you will see the new look of the one blog post that we have. This might also allow us to be able to create custom widgets to place on the landing page of the dashboard and many more. Better defaults for the SearchController The search feature is part of the Lucene module, that could not be the right way to do. Maybe we could have its own module, because there is a custom controller and it's doesn't care about what is indexing anything. By default when you have the Lucene module enabled you have a SearchController under the /search URL. It doesn't have any styling, because there is no customized search page for that in the TheBlogTheme. If you navigate to Configuration -> Settings -> Search you can select which index you want to able to search and the default search fields which are the fields in which we will look for the content you type. If you haven't provided the default search fields, you will get a BadRequest in the front end with a Couldn't execute search. The search index doesn't exist message and also a log entry. But what is Content.ContentItem.FullText? For example, let's check the content type definition of the Article. Here you can see a section called Full-text. Here you can say what should be used to look for the Articles. For instance, by default, we include the display text and the body parts. But you could say I also want to use some more data, like the values of the different fields. You can use Liquid here to provide the values. Future improvements could be to make a custom shape for the search results for the list and for each item. And of course, change the themes to support this page correctly. On Lombiq Orchard Dojo Newsletter Now we have 97 subscribers of the Lombiq's Orchard Dojo Newsletter! 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 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!

This week in Orchard - 04/19/2019

In our post we review the happenings after the Beta 3 release, then head to the open pull request of Orchard Core and see what will be merged soon, that will be available for the next release! On Orchard 1.x Style.Include and Script.Include register the wrong resource key in debug mode When you are injecting resources using the Script.Include or the Style.Include methods, you have to pass the debug version for the first parameter, and the release version for the second parameter. Let's see the following code: Script.Include("webfont.js", "head.deferred.min.js").SetAttribute("defer", "").AtHead();Script.Include("jquery-migrate.js", "head.deferred.min.js").SetAttribute("defer", "").AtHead();Script.Include("slick.js", "head.deferred.min.js").SetAttribute("defer", "").AtHead(); We have 3 separated js files that will be bundled when compiling in release, as a single js file but we want to render them as separated js files when developing/debugging. The ResourceManager.Include method registers the webfont.js as head.deferred.min.js causing the other files (jquery-migrate.js and slick.js) not to be rendered because they use the same key of webfont.js. The ResourceManager.cs has a virtual RequireSettings method, where we return the following value: resourcePath = FixPath(resourcePath, relativeFromPath);resourceDebugPath = FixPath(resourceDebugPath, relativeFromPath);return Require(resourceType, ToAppRelativePath(GetResourceKey(resourcePath, resourceDebugPath))).Define(d => d.SetUrl(resourcePath, resourceDebugPath)); Where a new method, called GetResourceKey has been introduced to decide when we need to return the release or the debug path of the requested resource. Now there is an issue in Orchard Core too, to do the same thing when injecting resources in this way. On Orchard Core Docker images If you navigate to the Docker Hub of Orchard Core you can download the updated docker images. Here you can see that the Windows version of Orchard Core has more than 5.0K downloads and the Linux version has more than 10K downloads! Both of the images have the following supported tags: latest: The latest public release 1.0.0-beta3: The latest release of 1.0.0-beta3 dev: The current development branch NuGet packages If you visit https://www.nuget.org/ and search for orchardcore, you will find a new package called OrchardCore. This is a new package, which is only available since Beta 3. You will see there are two packages because we merged on master and later on a new tag for beta 3 has been created to know which commit was Beta 3. And by creating a tag, AppVeyor restarted the build and republished everything on NuGet. We could change AppVeyor script to do not deploy or build on tags, just on commits on master. The YamlDotNet is still a dependency for Orchard Core Beta 3, but we do not use it anymore. In the next version it will be removed, we just kept it for the migrations from Beta 2 to Beta 3, because we convert all the YAML files to JSON and we still need YAML for the conversion. Open Pull Requests When you navigate to Orchard Core's GitHub page and check out the open PRs, you will see that there are currently more than 50 open PRs waiting to be merged to the dev branch. The reason for being as many open PRs is that these branches containing quite huge changes and by merging these into the dev branch could break some features of the framework. By being careful, we thought it would be better to merge these PRs after Beta 3 has been released. Now the Beta 3 is out, so it's time to merge these pull requests to dev branch! Let's see some of these! Add custom Widget styles and classes with Flow After this PR will be merged you can customize the classes and the styles for each widget in the flow. Technically, this PR provides Classes and Styles fields in the FlowMetadata on a Widget for users to add custom classes and styles to the widget container. Features matrix A list of features of Orchard Core, so people don't have to look for the available features and the ones that are currently in development or excepted for an upcoming version of Orchard Core. It could be good if they compare Orchard Core with other CMSs. Add user avatar to the admin site This PR is about to add the avatar to the top right with the name of the currently authenticated user. It could also be interesting to have a Liquid filter to generate a Gravatar. RTL support for TheAdmin theme This PR is using a Gulp pipeline that will convert the admin.css into RTL, by switching all the left margin to right margin and so on. In this week there was an article about how Spotify implemented to support Arabic. They used a similar technique, but not using the same pipeline from the PR, they used PostCSS-RTL in their build step. It's the same process, but with a different library. It looks like this one solves the part of the issue that exists in the PR. It's not replacing the existing CSS, but extending it with more rules that are specific for RTL. It's one CSS which will adopt the look and feel based on RTL or not. It will let us do it automatically for any CSS that we want to instead of manually specify which CSS we want to include. On Lombiq Orchard Dojo Newsletter Now we have 58 subscribers of the Lombiq's Orchard Dojo Newsletter! 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 every time when a new post 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!

Projector in-depth at Harvest

As you surely know, Projector is the built-in Orchard module that you can use to query content items in many customizable ways. Getting a grasp of Projector is not easy at first however. In the following video, recorded at the first Orchard Harvest conference in 2012 Bertrand Le Roy explains not only how to use Projector but also sheds some light on the programmatic techniques behind it.

Orchard CMS "Jump Start" video series

These videos are not new but are definitely not outdated but still valuable resources: Brent Arias created a 4-part series about the most important concepts of Orchard, covering parts of the dashboard that a user will use most. The below video is just the start; check out Brent's Youtube channel for the other ones!