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

Featured tags

IIS
API
SMS
All tags >

Fixing in the ContentPickerFieldIndexProvider, Lombiq Base Theme for Orchard Core - This week in Orchard (13/05/2022)

Fixing that unpublishing and editing content item with uninitialized ContentPickerField breaks, renaming ReverseProxySettings permission to ManageReverseProxySettings, and our Base Theme for Orchard Core is officially released! Check out our current post to read about the details! Orchard Core updates Rename ReverseProxySettings permission to ManageReverseProxySettings The Reverse Proxy Configuration module enables the configuration of hosting scenarios with a reverse proxy, like enabling the forwarding of the HTTP header X-Forwarded-For and so on. You can manage these options under Configuration -> Settings -> Reverse Proxy, but you need to have the proper permission to do that. Now this permission has a new name, called Manage Reverse Proxy Settings, that you can manage for every role under Security -> Roles. Unpublishing and editing the content item with an uninitialized ContentPickerField breaks If you have a custom ContentPart that contains a ContentPickerField and it's not initialized (so null) and you try to unpublish the content type, it will say it was unpublished, but that won't be true. If you try to edit and publish the same content item, you will get "An unhandled exception occurred while processing the request." error. Dávid El-Saig realized this can be avoided by giving the field a default value (public ContentPickerField Related { get; set; } = new();), but it's easy to miss, and the resulting symptoms are not easy to connect with the true problem. Steps to reproduce the behavior: Create a content type via migration. Start and set up the web app. Create a new content item of the content type. Add a part (e.g. public class RelatedPart : ContentPart { public ContentPickerField Related { get; set; } }) via migration update step. Start up the web app again. Try to unpublish or edit the content item created in step 3. Experience the bug described above. The expected behavior would be that the unpublishing or editing should be successful. And the problem was the following: the if (jPart == null) and if (jField == null) will never be true because if the value is JSON null, it will be a JValue type, so the cast on the preceding line will cause the exception as you can see on the screenshot. This can be fixed if type matching is used instead of casting. And as you can see, there is a new GetContentFields extension that uses the GetContentField extension which contains using the type matching instead of casting. News from the community Lombiq Base Theme for Orchard Core is officially released Our Base Theme for Orchard Core is now officially released! It contains all the foundations to build Orchard themes efficiently with included detailed samples. It can contain any shared content that is not specific to a specific project's theme. You can find the sample module with a commented walkthrough in this repository here. If you want to quickly try out this project and see it in action, clone our Open-Source Orchard Core Extensions full Orchard Core solution and also see our other useful Orchard Core-related open-source projects! We will clone the Lombiq's Open-Source Orchard Core Extensions repository for this demo as well. If you remember, two weeks ago, we mentioned that the Lombiq Helpful Libraries contains an abstract class called MainMenuNavigationProviderBase for creating a home page menu structure using the main navigation name. If you use the Lombiq.BaseTheme, it automatically displays the generated menu as a widget in the Navigation zone. Now it's time to see it in action! Just run our Open-Source Orchard Core Extensions solution and set up your site using the Agency recipe, for example. After that, you can navigate to Design -> Themes and enable the Lombiq Base Theme and Lombiq Base Theme - Samples themes. You can also make the Samples one as the current site theme. Now let's enable some features. Our home page menu structure will display as a widget in the Navigation zone. To have the MenuWidget, we need to enable the Lombiq Helpful Extensions - Helpful Widgets feature. The HelpfulLibrariesNavigationProvider sits in the Samples project of Helpful Libraries, so we have to enable the Lombiq Helpful Libraries - Samples feature as well. Now we can navigate to the home page of our site. The styling looks quite awful, but that's not the point here. As you can see, the Helpful Libraries drop-down now appears with the submenu items that we defined in the Build method. You can see the special LINQ to DB label, and the divider as well. And of course, you have the option to navigate to the given actions to test out the LinqToDbSamplesController that provides some examples of querying the database with Lombiq.HelpfulLibraries.LinqToDb and the TypedRouteController. 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!

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!

Monaco editor supports preview, Vue.js Single File Components in Lombiq Vue.js module - This week in Orchard (25/02/2022)

This week you can read about updating the Monaco editor to support preview, improving the documentation of Orchard Core, search form improvements, and a demo about using Vue.js Single File Components in Lombiq Vue.js module for Orchard Core! Are you interested in the details? Check out this post for more! Orchard Core updates Make the Monaco editor Field support preview Now the Monaco editor Field correctly supports the content preview feature on every change. To test this out, you just need to have a content type with a Text Field attached. Don't forget to set the editor type to Monaco editor for that field. Documentation improvements The documentation of Orchard Core has been improved. Documentation for the Audit Trail, SEO Meta, Deployment, Remote Deployment, Redis modules have been added, and there were some missing Orchard Core Demo YouTube videos that are now embedded into the corresponding page of the documentation. Search Form: allow to override Index used Let's say you have a content type, called Blog. Inside that, there are a lot of blog posts, and there is a need to search inside of that content type of Blog. The question is, how can you limit the full-text search based on that content type? Well, from now there is a new feature that allows passing a QueryString param in the search form page to override the current default Index used for displaying results. This can also be set as a hidden form input fixed value if used from a different form. These Indices are protected by permissions, so it should be fine to allow to do this, instead of needing to create a different controller per index required to be searched from. You can use this in the following way: /search?Terms=moon&Index=BlogIndex Demos Vue.js Single File Components in Lombiq Vue.js module for Orchard Core The Lombiq Vue.js module for Orchard Core is an Orchard Core module, that contains Vue.js and commonly used Vue.js components to be used in other Vue.js apps as dependencies. Provides extensibility to create Vue.js component templates as Orchard Core shapes making them able to override in themes or modules. And from now, you have the option to use Vue.js Single File Components! The module identifies Single File Components in the Assets/Scripts/VueComponents directory and harvests them as shapes. They have a custom .vue file renderer that displays the content of the <template> element after applying localization for the custom [[ ... ]] expression that calls IStringLocalizer. Besides that, it's pure Vue, yet you can still make use of shape overriding if needed. You can read more about it in the module's readme file. Now it's time to see it in action! You will find a Lombiq.VueJs.Samples project in the repository that contains some Vue files. The module now supports these special files (where you can put the template and the script in the same file) and harvest these as shapes. If you open up the demo-sfc.vue file, you can see one unique solution for localization. As we mentioned, by using the [[ ... ]] syntax, you can perform localization via IStringLocalizer at runtime. Let's run the Vue.js Single File Component sample in the Lombiq.VueJs.Samples module! As you can see, this sample is about providing a table with some data and a pager that you can use to navigate between the pages of the table with the help of the Single File Components. And we are just scratching the surface here! If you would like to know more about using Vue.js Single File Components with the help of the Lombiq Vue.js module, check out this recording on YouTube! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 237 subscribers! We have started this newsletter to inform the community around Orchard with the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post is published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who you think would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news around Orchard and the details of the topics above, don't forget to check out the recording of this week's Orchard meeting!

Sitemap deployment plans and recipes, Device Preview module - This week in Orchard (04/11/2021)

Sitemap deployment plans and recipes, improve reset password email experience, a new Device Preview module, and many more coming this week! Do you want to know more? Then don't forget to check out our current post! Orchard Core updates Sitemap deployment plans and recipes A sitemap is a file where you provide information about the pages, videos, and other files on your site, and the relationships between them. Search engines like Google read this file to more intelligently crawl your site. A sitemap tells the crawler which files you think are important in your site, and also provides valuable information about these files: for example, for pages, when the page was last updated, how often the page is changed, and any alternate language versions of a page. You can learn more about that module in this post where you can also see a demo of the feature. Let's assume that we have already created a sitemap that contains the blog posts of the site. Now let's navigate to Configuration -> Import/Export -> Deployment Plans and create a new deployment plan. If you add a new deployment step to your plan you will see a new plan, called All Sitemaps. Choose this one and execute the plan by downloading the given zip file to the computer. If you check out the Recipe.json file inside the zip, you will see a step called Sitemaps which contains the sitemap and the sitemap index itself. Improve reset password email experience You can allow users to reset their passwords. If they do that, they will get an email with a link that allows resetting the password. To prevent any misusage, the wording of that email has been changed like "Someone recently requested a password reset" instead of "Dear user" and "if you did not request a password reset, please ignore this email." Fix user picker field ordering We have a field in Orchard Core called the user picker field, which field allows you to connect users with a content item. If you haven't heard about that field yet, check out this post with a nice demo. If you edit the content definition of the user picker field, you can allow multiple elements to be selected and allow the picker to display users from multiple roles. There was an issue when the user picker resets the order of selected users when saving because it comes back in database order. Now, if you add multiple users to the user picker field and hit save, the system will keep the ordering of the users. News from the community Device Preview module This repository contains premium modules for the Orchard Core CMS. The Device Preview module in this repository adds a live preview to your production-ready pages on different devices. It previews your content in various form factors and tests without leaving the content editor screen. The Device Preview module enables live content preview on Smartphones, Tablets, Laptops, and Desktops.The Readme.MD file of the module contains some lines on how you can add this module to your solution and how to include it in your recipe to enable the feature by default. New Lombiq team member: Bálint Aracsi Please welcome our new Orchard Core developer colleague, Bálint Aracsi! See his full bio here, where you can find out which part of IT he likes most, and the color of his toothbrush :)! You can check out his full bio here! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 232 subscribers! We have started this newsletter to inform the community around Orchard with the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post is published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who you think would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news around Orchard and the details of the topics above, don't forget to check out the recording of this week's Orchard meeting!

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

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

Fixing rendering of helper and block tag helper, Bynder for Orchard Core - This week in Orchard (21/10/2021)

Fixing rendering of helper and block tag helper, documentation for the Feature Profiles, OpenID improvements, and demo about a module that integrates Bynder for Orchard Core! Don't forget to check out our current post to know more! Orchard Core updates Documentation for Feature Profiles Last week we had a demo about the new Feature Profiles feature. If you haven't seen the demo video about that feature or you haven't read about it yet, you should check out our previous post! In the meantime, the Tenants page of the Orchard Core documentation has a new section that describes everything you need to know to use the Feature Profiles feature. Fixing rendering of helper and block tag helper We had an issue in Orchard Core when using Tag Helpers in Liquid. You can write a tag like a block that will implicitly invoke ASP.NET Tag Helpers and try to map the provided name and properties to the given Tag Helper. In this case, we say to invoke the anchor Tag Helper and with the provided action, class, and route_todoid properties. Here you can see a nice example in the OrchardCore.Demo module to see how you can call an ASP.NET Tag Helper using Liquid. OpenID Recipes: use step model instead of the view model, support update Orchard Core got several updates related to the OpenID feature. The changes in this addition are: Add unit tests for OpenID scopes. Add unit tests for OpenID apps. Replace OpenIdScopeStepViewModel with OpenIdScopeStepModel in recipe. Replace CreateOpenIdApplicationViewModel with OpenIdApplicationStepModel in recipe. Adjust OpenIdScopeStep to support update. Adjust OpenIdApplicationStep to support update. Adjust OpenIdApplicationStep to include importing scopes, which were not imported before. If you check out the code of the OpenIdApplicationStep, (which is a recipe step that adds an OpenID Connect app), you will see that now it's using a new OpenIdApplicationStepModel instead of the CreateOpenIdApplicationViewModel to serialize the data coming from a recipe file. Refactor IQueryResult usage This addition contains several changes: Moving LuceneQueryResults to OrchardCore.Lucene.Abstractions. Moving SqlQueryResult to OrchardCore.Data.Abstractions. Adding OrchardCore.Queries.Abstractions to both these projects to use the IQueryResults interface. This means now, if you would like to use the LuceneQueryResults in your solution, you will find that class in the OrchardCore.Lucene.Abstractions project, under the OrchardCore.Lucene namespace. The old LuceneQueryResults class is marked as obsolete to do not break your code when you will update your solution to the upcoming Orchard Core 1.1. Demos Bynder for Orchard Core This demo is about an Orchard Core module for integrating with the digital asset management platform Bynder. Foremost, it provides the Bynder Field content field that can be added to content parts so Bynder resources can be browsed and attached. But what is Bynder? Bynder’s digital asset management platform enables teams to collaborate in the cloud, get content to market faster, and maximize the impact of marketing assets. It's pretty much a media gallery for bigger companies or for governments used mostly by marketing people. You can upload images and else into Bynder and then everybody from marking will access and use them when publishing materials. If you are interested, you can easily create your 30-day trial here. This module adds a media picker field for Bynder into the Orchard admin. Let's see it in action! In this demo, we will go with a quicker way and use our Open-Source Orchard Core Extensions full Orchard Core solution. We just clone the repository of the Bynder module too and add it to this solution. You have to do one thing before using the module. You need to configure your Bynder Portal's URL to be used in all Bynder Fields via the BynderOptions see its definition. It means that you need to add the PortalUrl to the appsettings.json file. Now, let's set up a site using the Blog recipe. After, we need to enable the module. To do that, head to Configuration -> Features and find the one called CSM.Bynder. Let's say that we want to extend the content definition of the Blog Post by adding the Bynder Field to it (Content -> Content Definition -> Content Types -> Blog Post -> Add Field). Now we have the Bynder Field added to the Blog Post content type, let's see what will happen if we would like to edit the predefined blog post! You will find a new button called Browse Bynder. And if you click on that button, you have the ability to browse some images. Here you can see the dialog provided by the Bynder SDK where you can see all of the assets under the specific collection of the given company. The field is currently configured for allowing multiple of these pictures so we will be able to select more than one. And that's not all of it! If you would like to know more about this module developed by Lombiq Technologies, just head to YouTube for a recording! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 229 subscribers! We have started this newsletter to inform the community around Orchard with the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post is published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who you think would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news around Orchard and the details of the topics above, don't forget to check out the recording of this week's Orchard meeting!

URI components Liquid accessors, Lombiq JSON Editor - This week in Orchard (15/09/2021)

Add Cc and Bcc to Workflow Email Task, URI components Liquid accessors, Lombiq JSON editor, and many more coming this week! Do you want to know more? Then it's time to check out our current post! Orchard Core updates Add Cc and Bcc to Workflow Email Task If you would like to send an email using Workflows, you can use the Email Task to achieve your goal. Simply navigate to the admin UI of Orchard Core and go to Workflows (don't forget to enable the Workflows and the Email features) to create a new workflow. If you add a new Email Task to your workflow, you will see that this task has now two new fields: the Cc and the Bcc. RegisterUserTask: Subject & Template for confirmation email should not be required if Send Email is unchecked And while we are talking about the workflows, let's check out another workflow task, the Register User Task which registers users from form fields. When adding this task to your workflow, you can easily say that I want to send a confirmation email to the newly registered user with this subject and template. The issue was that the subject and the template for the confirmation email were required even if Send Confirmation Email is not checked. URI components Liquid accessors By default, the Liquid templates have access to a common set of objects. You can easily access the properties of the content item that is currently being rendered, the authenticated user for the current request, the current site settings, and the current request itself of course. Check out this page of the Orchard Core documentation to see all of the available properties on the Request object. If you use the Request object quite often, you will notice that this table now has new properties, like the QueryString, UriQueryString, Path, UriPath, PathBase, UriPathBase, Host, and UriHost. Generate Rule Condition TargetUrl in a correct location The rules module was designed with extensibility in mind; however, there is one line that is in the view for it, setting the TargetUrl property of the modal picker to the layers controller. It needs to be moved out of the view, and into the Layers controller so that the view can be used by other modules, pointing to different controllers. Demos Lombiq JSON Editor The Lombiq JSON Editor is our Orchard Core module for displaying a JSON Editor like on jsoneditoronline.org. You can easily clone or download the module from this GitHub repository. If you want to quickly try out this project and see it in action, check it out in our Open-Source Orchard Core Extensions full Orchard Core solution and also see our other useful Orchard Core-related open-source projects! In this demo, we will go with the quicker way and use our Open-Source Orchard Core Extensions full Orchard Core solution. If you clone that repository and set up your site using any setup recipe, let's just navigate to the admin UI of Orchard Core, and under Configuration -> Recipes, you will find one called Lombiq Open Source Orchard Core Extensions - JSON Editor Sample that is about demoing the Lombiq JSON Editor module. Let's run the recipe! Now let's see the list of the content items where you will find a new one called JSON Example Page. This page has a JSON Field which comes from the Lombiq JSON Editor module. It's using a tree editor by default that you can use to manipulate the content of the JSON inside. But of course, you can have other types of editor for your JSON if you want, like you can have a code editor with numbered lines with syntax highlighting or you can just use a pure text editor and so on. Using a simple json-editor tag helper you can easily render the JSON editor. You can pass a string value to the editor that will contain the JSON itself, pass the JsonEditorOptions class that contains several configuration values like EscapeUnicode, SortObjectKeys, and so on. And you have several other options and use-cases for this JSON field. The JSON Example Page, which comes from the recipe, has a Liquid Part too that reads the values from the JSON field and prints the values in a simple list by using Liquid and JavaScript. Here is the display view of the JSON Example Page. If you would like to know more about this new field, head to YouTube for a recording! News from the community New GraphQL sample in the Lombiq Training Demo for Orchard Core The Lombiq Training Demo for Orchard Core is a demo Orchard Core CMS module for training purposes guiding you to become an Orchard developer. You can use this module as part of a vanilla Orchard Core source that includes the full source code - which is the recommended way. You can also use it as part of a solution that uses Orchard Core NuGet packages; however, it's harder to look under the hood of Orchard Core features. And the module just got a new little GraphQL sample! Check it out if you would like to know more about Orchard Core's GraphQL module and learn how to extend the Orchard GraphQL APIs! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 226 subscribers! We have started this newsletter to inform the community around Orchard with the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post is published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who you think would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news around Orchard and the details of the topics above, don't forget to check out the recording of this week's Orchard meeting!

Include or exclude tenant features and/or themes, allow editing Time Field seconds and milliseconds - This week in Orchard (07/09/2021)

Allow to edit Time Field seconds and milliseconds, document dependency version selection in ResourceManagementOptionsConfiguration class, demo about a feature to include or exclude tenant features and/or themes, and many more coming this week! Check out our post for more! Orchard Core updates Document dependency version selection in ResourceManagementOptionsConfiguration class Let's say that in the theme layout, you want to enforce Bootstrap 4.6 and added this <script asp-name="bootstrap" version="4" at="Foot"></script> which includes Bootstrap 4 as desired. Now let's have a custom module that allows converting a select-menu to a searchable-menu. This module depends on Bootstrap and jQuery to be able to function. So in the ResourceManagementOptionsConfiguration class, we need to define the dependencies like this: _manifest.DefineScript("SearchableDropdown") .SetUrl("~/SearchableDropdowns/bootstrap-select.min.js", "~/SearchableDropdowns/bootstrap-select.js") .SetDependencies("jquery", "bootstrap") .SetVersion("1.0.0"); _manifest.DefineStyle("SearchableDropdown") .SetUrl("~/SearchableDropdowns/bootstrap-select.min.css", "~/SearchableDropdowns/bootstrap-select.css") .SetDependencies("bootstrap") .SetVersion("1.0.0"); Unfortunately, the SetDependencies("bootstrap") call here forces to include Bootstrap 5, which will cause Bootstrap 4 and 5 to be included! Obviously, this is a problem. But you can easily solve this problem. You can use the SetDependencies method to ensure the script or style is loaded after their dependency, where you can set a specific version of your choice or the latest version available. Check out this new section in the Orchard Core documentation where we used SetDependencies("bootstrap:4") to say that we would like to define a style that depends on Bootstrap version 4. Allow editing Time Field seconds and milliseconds Let's take a quick look at the improvements of the Time Field. In our example, we have set up our Orchard Core site using the Blog recipe and modified the content definition of the Blog Post content type by adding a new Time Field to it. When you navigate to the settings of the Time Field, you will see a new setting here, called Step. This is just about manipulating the value of the step attribute of the time input type. You can read a lot about the step attribute here, now we just want to show you a small example of how you can use this new option. Let's say we want to allow to be able to edit the seconds for the Time Field too, but not the milliseconds. If we type 15 for the Step here, users can choose from the following values when setting the seconds: 0, 15, 30, and 45. It means, setting the value of this field to 03:39:15 PM would be suitable. If the user would like to create a new blog post and enter an invalid value for the Time Field, they would see the following message by showing some suggestions about the nearest valid values. Do not enable OrchardCore.Feeds by default in standard recipes By default by enabling the OrcardCore.Feeds module your lists will have feeds capabilities but for the Blank and the Agency recipe. This doesn't make any sense because we don't have any lists defined by default in these recipes. The change here is the Blank and the Agency recipes now will not enable the Feeds module by default. Demos Include or exclude tenant features and/or themes This upcoming feature is about through app settings/configuration adds 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. If you checkout to the deanmarcussen/excludefeatures branch, you will see a new OrchardCore_Features section in the appsettings.json file where you can see rules that you can apply to the various features. The idea here is that you can have the rule to either exclude or include a given expression based on the feature name. By default, the OrchardCore.Templates feature and the TheAgencyTheme are excluded for all tenants, but the default tenant has an include rule with a "*" expression which means that tenant gets everything. Now let's see this in practice! Let's set up a site using the Software as a Service recipe to get the Tenants feature enabled by default. If you navigate to Configuration -> Features on the admin UI, you will see that the Templates feature is available with the TheAgencyTheme as well (Design -> Themes). But if you have a tenant called blog1 and search for templates on the Features page, you will only find the Shortcode Templates one because the Templates feature is excluded for this tenant. And the same will apply if you navigate to Design -> Themes and try to find The Agency Theme. A nice additional feature would be to have a UI, where you can specify what kind of features and/or themes would like to exclude or include for the given tenant. But we are just scratching the surface of this upcoming feature. If you would like to know more, don't forget to head to YouTube for a recording to learn more! News from the community Helping the City of Santa Monica with Orchard Core consulting A few weeks ago we mentioned a new website using Orchard Core: the site of the City of Santa Monica, which you can find on Show Orchard as well! Show Orchard is a website for showing representative Orchard CMS (and now Orchard Core) websites all around the internet. It was started by Ryan Drew Burnett, but since he doesn't work with Orchard anymore, as announced earlier, it is now maintained by our team at Lombiq Technologies. Santa Monica is a beachside city of 8.3 square miles on the westside of Los Angeles County. Offering an environment of unparalleled natural beauty, the city is home to a mix of residential communities, commercial districts, and recreational venues. And we actually had a small part in this by helping the creation of this site with some Orchard Core consulting. If you would like to know more, check out the case study on our site here. Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 224 subscribers! We have started this newsletter to inform the community around Orchard with the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post is published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who you think would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news around Orchard and the details of the topics above, don't forget to check out the recording of this week's Orchard meeting!

Media search indexing, code analysis - This week in Orchard (14/06/2021)

Improving the code quality of Orchard Core by code analysis, supporting multiple translation providers, and adding a media search indexing feature to Orchard Core! Check out our post now for more! Orchard Core updates Code analysis Software is critical in all aspects of our lives. From entertainment, shopping, and dating to business-critical systems and software where human lives are at stake. And yet, security bugs are all too frequent, mainly because the process of finding vulnerabilities is manual, tedious, and repetitive, and because the expertise is not shared with other security researchers or with developers. LGTM seeks to address this situation. If you open up that site and enter Orchard Core to the search box on the top, you will see the active alerts for this repository. So, this site will go on GitHub and analyze the source of the projects. It's like a static analyzer for the code that finds potential issues, like this variable is never used, or here you are throwing an exception where you should not, and so on. We can also filter by language to see the alerts related to the C# code of the repository. Based on these issues, some fixes have been made to the source code. For example, we could remove some unused variables to make the code cleaner. Do you know that our Lombiq .NET Analyzers repository contains .NET code analyzers and code convention settings for Lombiq projects? We use these to enforce common standards across all our .NET projects, including e.g. in all of our open-source Orchard Core extensions. If you contribute to our open-source projects while using that solution, you'll be guided by these rules too. If you are interested in how to add these analyzers to your solution too, check out This week in Orchard post, but if you prefer videos, you can find a short presentation about how to use those on YouTube! Support multiple translation providers The localization manager should be able to handle multiple instances of ITranslationProvider. This feature is about supporting multiple translation providers. This way, we can create more methods for storing translations, like filesystem plus database. Right now, we have only one ITranslationProvider implementation in Orchard Core, the PoFilesTranslationProvider. This provider is part of the Localization module, which module provides the infrastructure necessary to support the PO (Portable Object) localization file format. As you can see, the LocalizationManager now injects a list of available ITranslationProvider implementations and calls the LoadTranslations method of every provider to load the translations to the CultureDictionary. Recipes Dropdown focus during setup Let's say you want to set up your Orchard Core site, or you just want to add a new tenant to it. When you move the focus from site name to recipe combo box and press Arrow Down the recipe list pops up. But when you commit your choice via Enter, focus resets to the first item on the page. Not it's fixed. It's a nice to have feature because there are people who prefer using the keyboard to navigate on the site instead of using the mouse. Serve module compile view for package reference If a module is referenced as a NuGet package e.g., OrchardCore.Application.Cms.Targets and if the NuGet package includes precompiled Views.dll, in development views are not served from the Views.dll, instead, it re-compiles all embedded cshtml resulted in a slow start in development. This code is to just ensure that it doesn't try to recompile if it finds the correct DLLs. Demos Media search indexing The idea here was to allow to search for content in files. This demo shows a feature that provides a simple implementation to index media for search. More precisely, it indexes media files related to content items, so said content items will turn up in search when one of their media files matches the search query. The following data can be indexed for each file referenced from a Media Field: Media Text The textual content of PDF files To index the textual content of the PDF files, the pull request uses the PdfPig library, which allows users to read and extract text and other content from PDF files. In addition, the library can be used to create simple PDF documents containing text and geometrical shapes. First of all, let's set up your site using the Blog recipe. This recipe constructs the Blog Post content type that has a Media Field called Banner Image. Let's say we would like to search by using the media text of the Banner Image field. To allow that, open the settings of the Banner Image (Content -> Content Definition -> Content Types -> Blog Post -> Banner Image) and put a tick in the Include this element in the index checkbox. After that, you have to do some configuration for the search fields. If you navigate to Search -> Settings -> Search, you can find the comma-separated list of fields to use for search pages. You can see the Content.ContentItem.FullText value there by default. Here we need to add the BlogPost.Image one. BlogPost is the technical name of the content type (and in this case of the content part too) and Image is the technical name of the Banner Image Media Field. Let's try out this feature quickly! Let's say we just want to edit the predefined blog post with the title Man must explore, and this is exploration at its greatest. Select the browsed image of the Banner Image field and add a media text to it. Now let's navigate to the predefined search form (https://yoursite.com/search) and try to search for the Astronaut word. This is the one that we have just added as the media text to our blog post. Astronaut is not a word that would actually show up anywhere in the body. As you can see, our blog post has just appeared as a result of the search. If you attach a PDF file to the Banner Image media field and try to search for a word or a phrase that is inside the PDF file, the query will return that content item too. This feature is still under development by Zoltán Lehóczky from Lombiq and as we mentioned you can find the PR containing the code here. If you would like to know more about it, don't forget to check out the following recording on YouTube! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 203 subscribers! We have started this newsletter to inform the community around Orchard with the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post is published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who you think would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news around Orchard and the details of the topics above, don't forget to check out the recording of this week's Orchard meeting!

Spatial Search, 5000+ Stargazers - This week in Orchard (02/05/2021)

This week you could see a demo about an upcoming Spatial Search feature for Orchard Core! Do you know that Orchard Core's repository now has more than 5000+ stargazers? Check out our post for more! Orchard Core updates Map Shape's public properties You could not do stuff like Shape.Classes, Shape.TagName, etc. in your Liquid templates. It was broken by the upgrade to Fluid 2.0. In Fluid, Shape, and ZoneHoldings uses ShapeAccessor which didn't map all properties (ie: Id, TagName, HasItems, Attributes, and Classes). Now it's fixed. Workflow CommitTransaction in a separate Workflow Feature Head to the admin UI of Orchard Core then navigate to Configuration -> Features. If you type the Workflows word in the search bar, you will get all the features that are related to Workflows. Now you will find a new one here called Session Workflows Activities. But there isn't anything new here really, it's just about having the Commit Transaction task in a new feature, because for some security reasons and usually, we don't need to use it quite often. If you miss that activity, now you will know where you can find it. :) Fix notification locale when the site is restarted There could be scenarios where there are multiple notifications in the same controller. But if we are restarting the shell meanwhile in the controller, we could face some issues. This fixes an old localization bug, especially when the default culture is set, some of the notifications are localized with the culture before the new culture is taking a place. Demos Spatial Search Let's set up a site using the Blog recipe. Now go to the admin UI of Orchard Core and first, enable the feature called Spatial. This feature provides the ability to add spatial locations to content items. Let's try that out now! For the sake of demonstration, we will create a new content type called Venue. Let's say that our goal, for now, is to be able to query nearby venues. The Venue content type will have a Title Part and an Html Body Part. But that doesn't really matter right now. Apart from that, we will add a new field to our content type, which will be a Geo Point Field. The Geo Point field can have a Leaflet editor type. Let's keep the other content type settings as default. Now let's see what kind of editor we will have if we open up the editor of our content type. As you can see, you can use a nice editor for the Geo Point Field to set up the Latitude and Latitude coordinates. This means you can simply enter them in the text boxes with these labels or you can just click on the map which will place a marker there with the given coordinates. Of course, you can zoom in and out using the plus or minus icons on the top-left of the map or just by simply scrolling. When you persist this content item, the position will be indexed in Lucene. Lucene now has some spatial search features which this PR implements. Now let's navigate to Search -> Queries -> All queries and add a new query. Select Lucene from the available query types. In the following example, we have just created a query that returns Venue content items based on a given location. You can see a geo_bounding_box filter here, which is about to return Venues where the location is within the boundaries of the given box. You can set the top, left, bottom, and right parameters of the box by using a JSON object. And that object contains parameter values for this query, which will be the parameters of the box in this case. But we are just scratching the surface of the upcoming Spatial Search feature of Orchard Core here. If you would like to know more, check out this recording on YouTube! News from the community Orchard Core repository: 5000+ stargazers and almost 200 contributors If you have visited the Orchard Core repository nowadays, you may notice that Orchard Core has almost gained 200 contributors! Right now the project has 197 contributors! Users on the GitHub website are able to "star" other people's repositories, thereby saving them in their list of Starred Repos. Some people use "stars" to indicate that they like a project, other people use them as bookmarks so they can follow what's going on with the repo later. And if you check out the number of Stargazers you will see that Orchard Core now has more than 5000 stargazers! Decoupled CMS Orchard Core tutorial for the Dojo Course After a long wait, last December we released the new Orchard Core version of our legendary Dojo Course tutorial series, the Dojo Course 3! Are you a newcomer and want to learn Orchard Core from the ground up, both from a user's and a developer's perspective? Are you somewhat familiar with Orchard Core but would like to get up to speed and become an Orchard pro? Look no further, check out Dojo Course 3! Dojo Course 3 guides you from the very basics of Orchard Core all up to be able to write your own themes and modules, utilizing various APIs of Orchard. Here you can check out the Dojo Course 3 YouTube playlist. All the video tutorials are here, in the recommended viewing order. Note that the video descriptions contain links if any were mentioned in the video. And now we are thinking about making a decoupled CMS Orchard Core tutorial for the Dojo Course to extend it a little bit. Orchard for the admin and content store, Razor Pages for the frontend. What do you think about this one? Are you interested? If yes, please tell us your opinion under this Tweet to be able to create that kind of tutorial in the future that you would love to see! Consultant needed for scalable TeamCity+Azure setup Do you have a lot of experience in configuring and operating TeamCity, hosting apps in Azure, and building a scalable Continous Integration environment? We're looking for you! Check the details here! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 197 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!