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

Featured tags

IIS
API
All tags >

Improved Feature Profiles feature, self-service tenant registration - This week in Orchard (03/03/2023)

Add placement example for dynamic parts, responsive Admin Theme, improve the Feature Profiles feature, and a demo about self-service tenant registration! Check out our post for the details! Orchard Core updates Added placement example for dynamic parts We have an article on the Orchard Core Documentation site that is about display management and placement files. Any module or theme can contain an optional placement.json file providing custom placement logic. This article describes the format of the placement.json file, how to render a shape, editor shape placement, and so on. Now you can see a new section here as well, telling you the structure of the placement file when you are working with dynamic parts. Responsive Admin Theme Last November, we mentioned that a huge improvement is coming to Orchard Core that makes the Admin Theme responsive. Note, that it's an option that is disabled by default, and you have to do some modifications in the appsettings.json file to make this work (under the StyleSettings section), and after that, your custom editors rendered in the admin have to support this, by utilizing the necessary helpers, like Orchard.GetEndCssClasses(). You can read more about how to set up the TheAdmin theme in the Change Logs of the upcoming release. Improve the Feature Profiles feature If a Feature Profile is renamed, it'll break existing tenants since the name is stored in the appsettings.json file, and also, other modules are not able to contribute to the Feature Profiles setup. We have had Feature Profiles for a long time now in Orchard Core, and if you haven't heard about it, you can check out a demo in this post. In a nutshell, this is about using app settings/configuration to add the ability to restrict the features and/or themes that are available to either a tenant and/or all tenants or a mix of both. You can add Feature Profiles under Configuration -> Tenant Feature Profiles once the Tenant Feature Profiles module is enabled. Here you can set the rules that you want to use. By default, you can have an Include and an Exclude rule. By using these, you can easily say that I don't want to allow the given feature for the assigned tenants or I want to allow my custom feature to the given tenants. The Expression contains the name of the feature, but it can include stars like OrchardCore.*Templates that will match the OrchardCore.Templates, OrchardCore.AdminTemplates and OrchardCore.ShortCodes.Templates feature as well. Let's say that we don't want to allow the TheAgencyTheme and the features with names that start with OrchardCore. and end with .Templates. And if you create a tenant, you can optionally specify which Feature Profile should be applied to the given tenant. You can rename the Feature Profile if you want, and renaming it could cause some issues. So, from now on when using Feature Profiles, we add an ID to the profile instead of using the existing editable name. This way renaming the profile won't break anything. To keep it backward compatible, we treat the current name as the ID for old entries. Note renaming old entries won't cause any issues since we consider the ID as the name before the new name is saved. If you check out the appsettings.json file of this tenant, you will see the ID here. And also, we allow the user to have multiple profiles more than explained in In a SaaS setup, how can the SaaS admin/owner manage the tenant features? Demos Self-service tenant registration In this demo, we can see a module created by Niraj Soni. He provides you with a new way to implement a site sign-up, so you actually create steps for someone to sign up, pay and get access to the tenant in a SaaS environment and everything happens right away. If you install the module, you will see a Registration Pages option in the menu under Multi Tenancy, where you can actually create the flow of the sign-up process. Here is a page called School, where you can capture school-related information using widgets during the sign-up process, like address, city, state, zip, etc. On another page, you can capture information to create an admin account, like user name, password, and email. There is also a step to verify email and capture payment. This contains integration with Stripe, so this will be utilizing Stripe. And finally, you can review and finish the whole process. Using this feature, you can add any page you want; you can remove a page if you want. And that's just the surface! If you would like to see this in action, check out this recording on YouTube! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 406 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!

Creating ContentPart_Edit Shape using ShapeResult to support placement, Swagger module - This week in Orchard (14/04/2022)

This week you can read about updating the Roles module documentation, creating ContentPart_Edit Shape using ShapeResult to support placement, fixing an NRE when trying to save an empty LinkField and a demo of a Swagger module for Orchard Core! Are you interested in the details? Check out this post for more! Orchard Core updates Update Roles module documentation Orchard doesn't actually "come with predefined roles". The roles themselves are actually not created anywhere by default. Permissions corresponding to them are but without roles, they don't do anything. The roles all just come from recipes. Szabolcs Deme updated the description of the documentation to reflect that. Create ContentPart_Edit Shape using ShapeResult to support the placement In the past, when the placement was defined for ContentPart_Edit none of the following applied. { "ContentPart_Edit": [ { "place": "-", "contentType": [ "Container" ] } ], "BackgroundColor_Edit": [ { "place": "-", "contentType": [ "Container" ] } ], "BootstrapColor_Edit": [ { "place": "-", "contentType": [ "Container" ] } ]} If you want to reproduce the behavior, you can follow these steps: Create part BootstrapColor with TextField with PredefinedList as editor. Select Reusable. Add BootstrapColor Part as named part to Container content type with name BackgroundColor. Add any of the following placement rules in placement.json to hide:"ContentPart_Edit": [ { "place": "-", "contentType": [ "Container"], "contentPart" : ["BootstrapColor"], "differentiator": "BackgroundColor" } ] OR"BootstrapColor_Edit": [ { "place": "-", "contentType": [ "Container"], "contentPart" : ["BootstrapColor"], "differentiator": "BackgroundColor" } ] OR"BootstrapColor": [ { "place": "-", "displayType": "Edit", "contentType": [ "Container"], "contentPart" : ["BootstrapColor"], "differentiator": "BackgroundColor" } ] See part is still visible while editing and placement rule is not applied, but the expected behavior is the placement should apply. So, this is about creating ContentPart Shape using ShapeResult to support placement and alternates. Now, placement can be applied to dynamic named parts as follows: { "ContentPart_Edit": [ { "place": "Parts#HTML Attributes", "differentiator": "Container-BackgroundColor", "contentType": ["Container"], "contentPart": ["BootstrapColor"] }]} and shape can be overridden using alternates, eg. ContentPart-Container-BackgroundColor.Edit.cshtml. Fix NRE when trying to save an empty LinkField Content items with optional Link Fields don't allow the Link Field URL to be cleared once saved due to a Null exception in the display driver. The expected behavior would be when a Link Field that is set to Optional has its values cleared, the Link Field should remain empty when saved. You could reproduce the behavior by following these steps: Create a content type with a Link Field and leave it Optional. Create a new instance of that type and fill in a URL and Link Text then save. Edit the previously created instance, clear the URL and Link Text, and then save again. Edit the previously saved instance, and the URL and Link Text will still be there. Check the Orchard logs - there will be a Null exception from the display driver. As you can see from the changes below, now we only validate the URL if it exists. Demos Swagger 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. This demo is about checking how you can use the Swagger Module. Swagger is an Interface Description Language for describing RESTful APIs expressed using JSON. Swagger is used together with a set of open-source software tools to design, build, document, and use RESTful web services. Swagger includes automated documentation, code generation (into many programming languages), and test-case generation. The point here is that this module provides easy integration. So, if you add the OrchardCoreContrib.Apis.Swagger NuGet package to your Orchard Core host project and run your application, you will find two new features if you search for the swagger word in the Configuration -> Features screen. If you enable them then you get a Swagger JSON-based API documentation by visiting the Swagger end-point by append /swagger/v1.0.0/swagger.json to the URL. And the same thing is also available under the /swagger/index.html URL with a nice Swagger UI. This - just as Swagger does - automatically shows all registered API endpoints, so if you add documentation to them, those will show up here. And of course, you can play with them as you can do with Swagger in any context. If you would like to know more, head to YouTube for a short demonstration of this module! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 247 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!

Placements module, Admin UI improvements - This week in Orchard (17/01/2021)

This time we would like to show you the new features of the Placements module, drop a few lines about the 1.0 version of the Shortcodes module and give a recap about the latest improvements of the admin UI. Check out our post for more! Orchard Core updates Placements module V2 We can do quite everything without creating any module or theme, but it's not possible to override default placement. It could be helpful to have a UI where you can easily define placement rules. Either we can add this to Part/Field settings or add a distinct UI (like the "Templates" one) where we can define a list of placement rules. The Placements module adds an optional feature that lets the user define custom placements rules in the admin UI. This V2 of the module is a rewrite of the original one, it uses IShapePlacementProvider to provide placements at runtime. The IShapePlacementProvider interface allows to asynchronously (useful if it relies on an async placement store) build an IPlacementInfoResolver for each IBuildShapeContext. The IPlacementInfoResolver implementation keeps placement rules for the current IBuildShapeContext to be able to quickly resolve shape placements synchronously. But don't go into too many technical details right now, lets's see how you can use this feature! Set up your site using the Blank site recipe then head to Configuration -> Features to enable the Placements module. Now you will find a new option under Design, called Placement. But don't go that far! We set up our site using the Blank site recipe so we don't really have much content on our site. To test out that feature we will need to define at least one content type. Let's do it quickly! We have just created a new Page content type, added a Link Field to it, and some Parts: the Title Part, the Flow Part, and the HtmlBody Part. Let's create a new Page content item and preview it! You should see something like that: the title of the page content item, the link field, the widgets in the Flow Part, and the content of the HtmlBody Part. Now it's time to go back to our Placements module. Let's say we would like to hide the LinkField of our page. To do that, navigate to Design -> Placements and add a new placement. Call it LinkField because we would like to modify that field right now. And the Placement rules text is prepopulated with null values. To hide the Link Field, just simply modify the place value to "-". Note that this will hide every Link Field of the site! But sometimes it's not obvious how to write the placement rules correctly for the first time. You have to know some words about the content templates, shape differentiators, content part and field differentiators, and so on. And here comes another great feature of the Placements module! Let's say we would like to hide the editor of the link field. Navigate to Content -> Content Definition -> Content Types and select the Page. Hit Edit and Edit again near the Link Field. Here you will find a new Edit placements button that contains some predefined placements for our Link Field (named Source). If you click some of those, a new placement will be created. Let's select Placement in admin editor for the Source field in a Page. This will generate the following placement: As you can see here, the type of shape is LinkField_Edit and the differentiator has the Page-Source value. That means to target the editor of the Link Field called Source of the Page content type. If you say "-" for the place, it will hide the editor of the Link Field when creating or editing Page content items. New IsImageFile Orchard helper Instead of using a RegEx or something like that, there is now a new IsImageFile Orchard helper that uses a static HashSet that contains the possible allowed file extensions that an image file could have. Just use this helper to determine if a path is an image file. Shortcodes 1.0.0 is here There is a Shortcodes module in GitHub created by Sébastien Ros that is a shortcodes processor for .NET with a focus on performance and simplicity. It allows text content editors to inject specialized content blocks using custom arguments, like images, Twitter embeds, youtube videos, only with simple blocks like [video 123]. It has several features, like supporting async shortcode to execute database queries and async operations more efficiently under load or supporting named and positioned arguments. And this is the library that is integrated into Orchard Core to be able to work with shortcodes. We mentioned the Shortcodes feature of the CMS several times in This week in Orchard, for example here, now let's focus on the latest changes of the module. The big news is now this module was come out from the beta version! Let's mention the biggest change of this new version. David Hayden was trying to write a blog post with some C# code inside and in the C# code there were some attributes and there were some Shortcodes in the attributes. When you evaluate a Shortcode using this library it just outputs to nothing if it's unknown. This means all the attributes from the code were removed. From now if there is an unknown Shortcode or it can't be parsed, the module will just output it as is. AutoroutesEntries Atomicity and Size This allows for synchronization between multiple nodes of a cluster, specifically for AutoRoutes. If you are on one node and you create a new AutoRoute, then the other nodes will update their AutoRoute mapping for the new AutoRoute. It's not just about data to load, it's also updating the resolution list: a dictionary that maps content items to routes. There is an AutoRoutePartIndex that is used to detect what had changed since the synchronization of the last element. Every YesSql index is updating things with an incremental identifier so, if there is a change on one AutoRoutePart it's not updating the previous indexes, it's just adding new indexes and removing the previous one. Now, this index is used to just sync every node to the new state. It's like a synchronous pattern, the index just shows the new things that happened on the AutoRouteParts, and then it's applied directly to the AutoroutesEntries structure. Check out the AutoroutePartIndexProvider class in the dev branch! Demos Admin UI improvements The admin UI of Orchard Core got several improvements lately. In the demo of our current post, we will check out the updated UI. Let's start! When you navigate to the admin UI of your site you can see the Orchard logo and the name of your site on the left side of the top bar. From now if you click on it, it will navigate to the home page of the admin theme. But don't worry, you can still easily navigate to your site, just use the little arrow at the right of the top bar. Oh, and one more thing: if you click on that little user icon on the right, you can see the user name of the currently logged-in user. If you have the Tenants feature enabled you can add tenants to your site. The list of the tenants is now a little bit different. You can see the name of the database preset, the description, the used recipe, and the state of the tenant. Now let's navigate to the content items list to check out the new design there too. You can see that every line start with the display text of the content item, followed by the content type, the status of the content item, the date of the latest modification, and the author of the content item. You can see that the About article has a draft and a published version too. And lastly, go to the Design -> Widgets page and check out the design there. You could see we have two widgets right now, the one with the display text My widget is a content type of Container that has two versions and associated with the Homepage layer. The other one is placed on the Always layer. And that's not all of the improvements and more are just on the way! Check out this recording on YouTube to know more! News from the community Work with us! You've completed the Dojo Course, congratulations! You’re now officially an Orchard Core developer. Would you like to work on a variety of challenging Orchard Core projects with the biggest Orchard team in the world? Work with us! Just send us an e-mail to crew at lombiq.com. Please include what you’re most interested in professionally and attach around 100 lines of any kind of code that you’re especially proud of or just link to the favorite open-source project of your own on GitHub or else. Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 184 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 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!

Tabs, Cards, and Columns for the Admin, RenderTitle option - This week in Orchard (03/07/2020)

Heads up, several improvements coming this week! Editor shapes now support grouping placement, which allows you to group editor shapes, to create a variety of content editor layouts. The Title Part now has a Render Title option to show or hide the value of the Title. And last week we did an Orchard Core workshop about module development. Check out our current post for more! Orchard Core updates TitlePart with RenderTitle option and Placement for Form, Label Let's say you set up your site using the Blog recipe and want to edit the content definition of the Blog Post. If you edit the definition of the attached Title Part, you will find a new option that you can use called Render Title. With this option, you can enable or disable rendering the value of the Title Part in Detail and Summary display types. The Blog recipe using the TheBlogTheme by default where we override the content of the Blog Post (Content-BlogPost.liquid) and displaying the DisplayText of the content item whether the Render Title option is on or off. So, to see this in action we should use a theme where there is no override for the Blog Post content items. Let's navigate to Design -> Themes and make the Default Theme as the current for now. After that, you will be able to see the differences. The upper window here is about to render the title, but under that, you can see the default blog post without displaying the value of the title. We have some content types where is no need to display the title by default. These types are the Form and the Label. If you check the migration of the Label for example you will see how you can use the TitlePartSettings to hide the title by default. Fix jsonparse Liquid filter to supports arrays The jsonparse Liquid filter converts a JSON string to a JObject. This can be useful to build collections and iterate over the values in Liquid. Now, this filter is about to support arrays. To do that the community had to use the JToken.Parse method instead of the JObject.Parse one as you can see in the JsonParseFilter class. Add menu display text (differentiator) classes to menu shapes When using multiple menus on a site it is possible to do a lot of the styling with CSS, which can avoid having many, many templates. Now Orchard Core will add the menu differentiator (which is calculated from the display text) as an additional class on the menu. So out of the box, you will get: class="menu menu-main-menu". Demos Tabs, Cards, and Columns for the Admin We are able to use placement to move some of the fields/parts into a tab in the admin area. The new thing is now you can use Bootsrap Collape to organize your content into cards. And now you can also move fields into columns, in that case, you can have a Media Field near to the HTML Body Part for example. But after this intro let's go deeper and see some examples of placement. Modifier for tabs remains #, but now supports ; before as a position modifier for the tab grouping. Modifier for cards is %, also supports ; as a position modifier. Modifier for columns is |, supports ;, and _ as a column modifier, _9 will be applied as col-md-9 automatically, or _lg-9 which will be applied as col-lg-9. _9 should be sufficient for most, as it will by default break at md. ; must be immediately after , whereas : is the shape placement, and applies anywhere in the placement string. So, in nutshell the normal tab modifier is a #, the card modifier is a %, and the column modifier is a |. The column has a name and another modifier that allows you to say how big you want the column to be. Now try out these in your Orchard Core site! We will use the Orchard Core source to set up a site and we will modify the content of the placement.json file in the OrchardCore.Contents module. In the following example we place the MediaField_Edit shape in a tab called Media, and position the Media tab first, and the Content tab second. The Html Field goes first in the Content tab and the rest goes under the Html Field. Let's play with this a little bit more! Now we place the MediaField_Edit shape in a card called Media, and position the Media card first, and the Content card second. And lastly, we are playing a little bit with the columns. In the following example we place the MediaField_Edit shape in a column called Media, and position the Media column first, and the Content column second. We also specify that the Content column will take 9 columns, of the default 12 column grid. By default, the columns will break responsively at the md breakpoint, and a modifier will be parsed to col-md-9. If you want to change the breakpoint, you could also specify Content_lg-9, which is parsed to col-lg-9. If you want to know more check out the official documentation and don't forget to watch the video about the new features of the placement! News from the community Orchard Core RC 2 on ASP.NET Blog You can find a new blog post in the ASP.NET Blog that telling you the Orchard Core Release Candidate 2 now available! In this post you will learn how to create an Orchard CMS website using the templates, you will see the notable improvements and you can check out the development plan of Orchard Core! Module Development - Orchard Core Workshop 4 We had some great crowd at the Orchard Core module development workshop on Saturday, thanks all for coming! Would you like to attend a workshop too? Other community members will hold ones soon: https://orchardcore.net/workshops. Are you interested in something else? Leave a comment below! Orchard Dojo Newsletter Now we have 151 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! There will be no This week in Orchard post next week because of vacation, so see you in two weeks!