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

Featured tags

IIS
API
SMS
SEO
All tags >

Taxonomy and contained content items routing, new options for TitlePart and AliasPart - This week in Orchard (28/02/2020)

New options for TitlePart and AliasPart, adding CodeMirror support for HtmlBodyPart and HtmlField, the Pager shape and demo about the taxonomy and contained content items routing are waiting for you in our upcoming post with many other cool features! And about the news from the community: there is a new Orchard Core website, news about the upcoming Harvest and welcome a new team member in Lombiq Technologies! Orchard Core updates Disable feature confirmation messages When we disable a feature we will get a warning that says that the feature that you would like to disable has dependent features that are enabled. Let's disable the Widgets feature. In this case, we will get the following warning message, because Flows and Layers are built on the Widgets module. New options for TitlePart and AliasPart There is a new setting, called AliasPartOptions. Using this new option you can define that the alias can be editable when editing a content item from the admin UI or make it disabled, which means it will be generated automatically using the defined pattern. And when using the TitlePart, you will also find a new option there, called EditableRequired. This means admins can edit the title of the content item and it needs to have a value because it's required. Html mode for CodeMirror on HtmlField and HtmlBodyPart standard editors CodeMirror is a versatile text editor implemented in JavaScript for the browser. It is specialized for editing code and comes with a number of language modes and addons that implement more advanced editing functionality. And now if you set up your site using the Blog recipe and create a new article, the editor of the HtmlBodyPart will come with the CodeMirror support! Furthermore, the Standard editor mode of the HtmlField is also got the CodeMirror support. Moreover, Orchard Core using the latest version of CodeMirror, which is 5.52.0. Pager shape At the bottom of the documentation of OrchardCore.Navigation you will find code examples both for C# and Liquid about how to use the Pager shape in Orchard Core. Add a recipe step to create scope for OpenID Now you can set the connect scope of the OpenID using recipe steps, that you can do in the following way, that could be found in the documentation of OrchardCore.OpenId. There is also a possibility to set the Token Validation Settings with recipe steps. Here you have to provide: Name: unique name of the validation settings. Audience: defines the intended recipient of the token that must be checked. Authority: the address of the remote OpenID Connect server that issued the token. Filter deployment steps There is a new search box on the UI for the deployment steps to filter the list of the available steps. To check out this feature create a new deployment plan under Configuration -> Import/Export -> Deployment Plans then add a new step to it. In this modal window, you will find the textbox with the Filter placeholder text in it. In our case, we typed settings, which means these three steps will be the results of our search. Sitemaps module We wrote about a very cool feature for Orchard Core, which is the Sitemaps support three times now: here, here and here. In every post, we described the features of this module and showed the way how you can use them. And you can also find a recording of this feature on YouTube. The reason why we mentioned that is because this feature is now merged in the dev branch of Orchard Core, thanks to Dean Marcussen! He also added nice documentation about how to create sitemaps, localize sitemaps, cache sitemaps and so on. Setting and Removing HttpContext.Items from Liquid template Now there is a new Liquid filter called httpcontext_add_items, that adds key/value to the HttpContext.Items collection. And you can also remove items from the HttpContext by using the httpcontext_remove_items Liquid filter. You can read more about these two new Liquid filters in the documentation. Do note though that there are possible security implications to this, see the discussion under the pull request. Support most commonly used error pages According to Pingdom research, the top 5 most common errors are 401, 400, 404, 403, 500. So, this is about adding more custom views for error codes that you can change in your themes. Check the content of the DiagnosticsController.cs in the OrchardCore.Diagnostics module. Demos Taxonomy and contained content items routing The main issue is that currently we don't have routing for taxonomies or contained content items. The taxonomy routing is about we would able to route an item inside a taxonomy for a term. The goal is to be able to list all the things that are associated with this term. The issue is that in the case of BagParts or anything that is contained in a content item can't be routed right now, because Autoroute doesn't work on sub-content items. The second thing we looked at was the dynamic routing to be able to define a patterned route in a content item. In this case, multiple URLs would match the same content item and the content item could use these route values to render something differently or do queries. These are two different things, but we are talking about them at the same time. If you are interested in how to do that in Orchard Core check out the following demo on YouTube about this upcoming feature! News from the community A new website using Orchard Core Luxury Card is a global leader in the premium credit card market. From patented metal cards to a 24/7 Concierge service and app, their mission is to shape the industry with innovation, value, and service. With leading airfare and cashback redemption rates along with first-class benefits, they believe your credit card can pay for itself. If you are interested in more websites using Orchard and Orchard Core, don't forget to visit Show Orchard. 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. Freshest news about the next Harvest We have a room booked for the dates June 22-24. This is the reserved interval that we will have for sure now. The maximum people can fit in the room is 50 people. The only concern is that it could be not enough, it would be nice to know how many people are interested in coming to the next Harvest. There will be a questionnaire or something to be able to measure somehow the number of people who could be the possible attendees at the next conference. New team member in Lombiq We have a new team member, Gábor! Turned from English studies to competitive gaming to software development and Orchard Core. Check out his bio on our About us page! Orchard Dojo Newsletter Now we have 119 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!

Display mode options to Parts, Search views for themes - This week in Orchard (14/02/2020)

Display mode options to Content Parts, adding search views for themes, import recipe from a JSON file and many other changes and new features come in our current post. After we will see a real-world example about how to use Orchard Core in production. Then check a new website built with Orchard Core and finally let's talk about the latest news about the Harvest! Orchard Core updates Add revision date in the documentation Now each page of the documentation will display the revision date of the current page. Open any page of the documentation and scroll down to the bottom of it. There you will see the date of the last update. Use ControllerModelUpdater on controller instead of implementing IUpdateModel When you want to Build, Update or Validate your model from controllers, you don't have to implement IUpdateModel, because each of them can be resolved by injecting the IUpdateModelAccessor. Here you can see the NodeController, where we need to build the display for the AdminNode using the TreeThumbnail display type (line 74). Instead of passing this, we can pass the _updateModelAccessor.ModelUpdater. Only show fields in Summary and Detail display types In the past, if you added a field (or a few fields) to a blog it's SummaryAdmin view shows in the list of blog posts. That's because the fields are automatically displayed in SummaryAdmin. Now, this feature prevents to display all the fields automatically in the SummaryAdmin. If you check out a driver of a field, you will see that the values of the Location now changed everywhere in the case of the Initialize method. Add display mode option to parts Now we can have custom display modes for Content Parts too! For example, now you could define which tag would you like for the title and the name of the tag could be the display mode of the TitlePart. Fix themes search views fix Changing all the themes to provide a nice view for the search feature. There was a default version of it, but now each theme has it's own and now it looks great in every built-in theme. If you want to change the look of the search form, you would override the SearchForm template, if you would like to override the search results page, the SearchResults template will be the one you are looking for. But of course, you can override the whole look and feel of the search template just by overriding the Search template. Here you could see the Agency theme with the search form and search results. And you could find really great and detailed documentation about how to implement a website full-text search and everything about the new templates. YesSQL: when to call Session.Save? You can call _session.Save(contentItem) as many times as you want, it's free. It's just marking a content item to be saved once the session will be disposed. There will nothing happen when you call _session.Save(contentItem). If you call it multiple times, the first time it will mark it, the second time it will say: It's already in the dictionary of things to be saved. It will be just a dictionary lookup. Call _session.Save(contentItem) when you think the thing should be saved once the session or the request is done. And if multiple things update a content item and you need to tell the session to save it, they can all call _session.Save(contentItem). Import recipe from a JSON file When you are importing a recipe, you have to upload a ZIP file. The logic then extracted that file and found the JSON file in it. From now you can pass a JSON file when importing a deployment package, not just a ZIP. Recipes documentation And if we are talking about that you can import a recipe from a JSON file, we also need to mention that the documentation of Orchard Core has got a great detailed page about the recipes. Here you could see the format of the recipe, the possible steps of the recipe and see samples about each of the steps (Roles Step, Queries Step, Media Step, Layers Step, etc.). RequireUniqueEmail message Now when you would like to register a new user with an email address, that already exists in the system, you will get an error message says that the email is already used. Demos SaaS and OpenID: a real-world example There is a solution called Trivest Connect (an Enterprise Resource Planning application) that currently includes five different companies. One problem that Trivest solves that everybody sends messages to each other and there is no standardization, that is not so optimal. In the use of Trives Connect with many other features there is a standard document format and with that, it is easier to exchange orders, invoices, VIA, etc. Trivest Connect is based on Orchard Core installed with the Software as a Service recipe that is using the built-in Open ID Server. Here you could see that there are really just a few modules enabled in the admin UI. What customers can do is they can send messages to other customers. This is just an administrator portal because, in reality, this is all done behind the scenes in the ERPs. If you would like to see the whole demo of this real-world example just head to YouTube and watch the recording! News from the community A new website using Orchard Core RA Capital Management is a multi-stage investment manager dedicated to evidence-based investing in public and private healthcare and life science companies developing drugs, medical devices, and diagnostics. And they decided to use Orchard Core to implement their website! If you are interested in more websites using Orchard and Orchard Core, don't forget to visit Show Orchard. 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. Latest news about the Harvest There is a new offer from someone from the UK to host Harvest in their offices. They mention 50 people fit in the office. This office is located in London. The possible date for hold the Harvest is the last full week of June. We have to decide the length of the conference and talk about holding a workshop during Harvest. By the past, we have usually done it at the beginning of the week, because this way you can arrive at the weekend, take your time or get back from jetlag or do some tourism. And then if you want you can extend your stay to the week. So 22-23-24 might be the tentative dates. Usually, 2 days are too short and 3 days are too long, but we will see. What do you think about June 22-23? Feel free to comment on that on Gitter too! Orchard Dojo Newsletter Now we have 116 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!

Sitemaps, headless recipe, jsonparse Liquid filter - This week in Orchard (24/01/2020)

With many more features and updates, this week we check out the new headless recipe, the new jsonparse Liquid filter and the updates of the Orchard Core documentation. We show you a demo about the Sitemaps feature and write about when to ship version 1.0 of Orchard Core! Orchard Core updates Add Headless recipe Now you can find a new recipe called Headless. This is a new setup recipe that sets up a headless site that consists of CMS modules with GraphQL and OpenID. If you want to build a headless site, you will need to set up your site using this recipe. By the past, we were suggesting users do an empty site using the Blank recipe (empty.recipe.json) and then to enable OpenID and the needed modules. By using this recipe these modules are enabled by default. If you haven't seen it yet: there is a great detailed demo on YouTube about what will you get if you install your site using the Headless recipe. Documentation for recipes and starter themes included with Orchard Core Orchard Core is available for use via two different NuGet meta-packages: OrchardCore.Application.Cms.Core.Targets OrchardCore.Application.Cms.Targets You can also use several built-in themes: The Blog theme The Admin theme The Agency theme The Coming Soon theme The Theme And choose from different kind of recipes: Empty recipe Blog recipe Headless recipe Agency recipe Coming Soon recipe Saas recipe These themes and recipes include different configurations, different range of Content Types, Widgets and so on. There is a new getting started guide that lists what will you get if you install your site with one of the built-in recipes. If you are new to Orchard Core this guide will help you a lot to choose the recipe that fits the best for you. Fix previewing When you preview a content item we create a transient content item in the server-side memory and then we asked it to be rendered. Then we send the rendering to the client. That's how the preview feature works. Every time when you do a keystroke, we fake like it's a real content item, ask the server to create it in memory and to render it in HTML and send us back by the HTML. The issue was when we create it on the server-side it's like a real creation including indexing. Lucene will be like: there is a new content item to index, so let's index it! And then it will appear in the index, but it's just a preview. The idea is to find a way to mark it. A possible solution is to check the ID of the content item and if it's -1 (it's a logical value that we set for the content item to say it's transient), it's not a real content item, so just ignore it. Update "Creating a modular ASP.NET Core application" guide The section called Registering a custom route in the Creating a modular ASP.NET Core application is out of date with code generation templates and implementation since the upgrade to .Net Core 3.0. Generation templates create a Configure() method which accepts an IEndpointRouteBuilder (formerly IRouteBuilder), which does not have a MapAreaRoute() method. MapAreaControllerRoute() is the method to use here. Get draft content item by the alias Before we just indexed the published version of the aliases. If you are following the Creating a new decoupled CMS Website guide it tells you how to get a preview of a content item using an alias in a custom Razor Page. The issue is that it would not work if you were creating a new item and then previewing it, because there would be no published version of the content item, so it would not be able to find the content item by its alias. Now we are indexing the alias for both for the latest and published versions of a content item. The latest version can be the published one if there is no draft. Add jsonparse Liquid filter Let's say you would like to be able to pass a custom JSON using Liquid. Before that, we have to create a string separated by commas and then split it and then you will have an array. And then do it for each property you want, because you wanted to generate tables based on existing values you had. In the documentation, you can see an array of objects captured to a variable named someCollection. Using that, someCollection becomes a string variable that contains that JSON document. By calling the jsonparse using the someCollection you will get a JObject and then it can be iterated on and accessed by the key and value properties. This filter is enabled by default when you do Liquid. When to ship Orchard Core 1.0? We have issues labeled with P0 and P1. These issues should be fixed to ship version 1.0. We can't ship the new version without fixing these issues. The more the community works on these ones, the quicker we can release 1.0. Feel free to grab from these to be able to release sooner! Demos Sitemaps module revisited Let's set up a site using the Blog recipe. Then head to Configuration - > Features and enable the Sitemaps module. To use this module you need to set up the Base URL of your site under Configuration -> Settings -> General. After you have typed a fully qualified base URL of the web site, head to Configuration again, where you will see a new submenu called Sitemaps with two options: Sitemaps and Sitemap Index. Choose the Sitemaps one and click on the Add Sitemap button. Here you can see an Enabled checkbox, that gives you the ability to enable or disable your sitemap. If you uncheck this, you can disable the routing to the sitemap. If you are in the middle of constructing your sitemap or you don't want to publish it for some reason, you can uncheck this box. Give your sitemap a likable name and hit Create. Now you can add sources to your sitemap using the Add Source button. Here you can add Sitemap content types, that are entries for each one of the selected content types. Here you have the possibility to index all content types or just the selected ones. You can also limit the number of content items to provide from this source. Let's say we want to include the first 50000 blog posts to this sitemap source. After you hit Save, you can view your sitemap. To create a sitemap index, select the Sitemap Index option. Here you can set the URL of the sitemap index and the sitemaps this index contains. We have only one sitemap, so, select that one. When you enabled the Sitemaps feature, you could see another related one in the Features list, called Localized Content Items Sitemaps. If you enable this module and have localized content items, you can build localized content items sitemaps. Let's see how a sitemap like this looks like! Here you can see the language of the given content item inside the hreflang elements of the XHTML tags. The content with the primary culture of your site goes first, which is en-US in this case. In the screen below you can see a sitemap that contains one blog post, that has a Hungarian localization too. And that's not all! If you would like to know more about sitemaps, head to YouTube, where you can find the full demo about sitemaps! This feature is still under development, but you can check the PR here. News from the community Tell us about your .NET performance challenges! - Hastlayer developer survey Help us build the nerdiest .NET thing, Hastlayer: It turns performance-critical sections of .NET programs into computer chips! If you fill out our short questionnaire you can win a cool compute accelerator board worth $265! Check it out here: https://forms.office.com/Pages/ResponsePage.aspx?id=Wt6elek45kStyIVVO-uCIMkFNjqW2E1Pm4v3YMcflMNUOVlDNUE3MlpDS044VDI1OEFSMUgxUkxSTC4u The reason we're asking this is that we're building a .NET hardware accelerator, Hastlayer (https://github.com/Lombiq/Hastlayer-SDK it turns your program into a chip!) and want to better understand what other developers do. Thank you in advance! Orchard Dojo Newsletter Now we have 113 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!

Sortable lists, IScopedDistributedCache - This week in Orchard (17/01/2020)

Get ready for a deep dive! In our post, we will introduce the IScopedDitributedCache service and show how to use it in the RoleStore. And we are going to solve the mystery about do you need the Model prefix to access different kinds of properties of a model in Liquid and in Razor too? Orchard Core updates Document recipes new Lucene settings There is new documentation on the updated Lucene index settings. Now to create an index from a recipe, it's not just about passing the name of the analyzer. You have to provide the following: AnalyzerName: the name of the analyzer, that you want to use. IndexLatest: a boolean value that indicates that if you want to index the latest or just the published versions. IndexedContentTypes: the list of types you want to index. Re-use in some places the ContentItem Liquid property There was a change in the Liquid TemplateContext, that broke some properties, that are available in the templates. If your AliasPart, AutoroutePart or Workflows patterns don't work anymore, it's because of the previous change. Now, this issue has been fixed. For example in an Autoroute pattern that used to render the custom URL of the content type you could do something like: {{ ContentItem.DisplayText | slugify }} That will generate a nice text for your routes. But in some cases, you have to write {{ Model.ContentItem.DisplayText | slugify }}. Maybe using the Model prefix is collateral damage, but maybe it has a purpose. Anytime we have a Liquid template for a shape we do Model.ContentItem to get the ContentItem. In Razor everything is Model.Something. It has to be because in Razor we are doing C# and the current context is the page and the page is a class that doesn't have our properties like @ContentItem. So the only thing we could get is the @Model that is typed to the generic type of the RazorPage and Model will provide all the properties like the ContentItem. Because we do too much Razor, it could be possible that we reused this approach into some Liquid patterns. In Liquid it's not necessary to have the Model prefix. But it appears that there is already a way in Fluid to use a first-level model without a custom prefix (so we don't need a Model prefix), by setting the TemplateContext.Model property. In conclusion: in Liquid that is easier to write {{ ContentItem.DisplayText }}, you don't need the Model prefix. But in Razor, you have to use the Model prefix. Constraint admin controllers to mapped routes Since we can change the prefix of the admin route, we have to ensure that every admin controller's actions have the correct prefix to use. There is an implementation of the IActionConstraint, called AdminActionConstraint, that checks if we are in the admin and the route doesn't start with the admin URL prefix (_adminUrlPrefix), then it will create a warning log entry. So, the AdminActionConstraint applies a convention that restraints all AdminControllers or [Admin] controllers to use the mapped route only, and not the default route applied by MVC. Fix the recipes not found bug in the documentation We have a guide about how to create a new decoupled CMS Website using Orchard Core. It told you to add the OrchardCore.Application.Cms.Core.Targets NuGet package to your new ASP.NET Core project, because this package won't contain the themes. And when you do a decoupled CMS site you will don't need the themes, because you want to create your own front end. The issue is with this package on the master branch is that the setup doesn't contain any recipe in the RC1 version. The community fixed that bug for now, but it's just in the dev branch yet. So, if you follow the guide and you using the RC1 version of that package, when you arrive at the setup screen you will not be able to set up the site because there will be no recipe to choose from. Mitigation is to use the OrchardCore.Application.Cms.Targets package, that contains all the themes and recipes. Of course, in this case, you will get several unwanted themes, but you will not be blocked to continue following the guide. So, it's not the perfect solution, but when there will be a new version of Orchard Core, we can rewrite this back to use the OrchardCore.Application.Cms.Core.Targets NuGet. There is also a hint about if you are using the nightly builds of Orchard Core then you should use the Core package instead. Creating IScopedDitributedCache The main goal is to increase the performance of Orchard Core and try to make it faster from time to time. To measure that, check the blog posts Liquid template page and start to remove everything from there. Just to see how fast could be the performance if we didn't render anything. Then start to remove stuff from the controller that displays content. For example, let's take a look at the ItemController. This is the controller, that renders content items by default. Take a closer look at the Display method of this controller! It first loads the content item. If it's not there, we return a 404. Then we check the ViewContent permission for this content item for the current user. We return Forbid if they authenticated but don't have the proper permission, or return Challange if the user is anonymous. Now let's build the display! That will build a shape containing all the part shapes and everything for this content item. So, it will render the display of this content item and we send this shape to a view that will just call Display of the shape. That's what we do in this method. The thing that made it slow actually is that one which checks the permissions, the _authorizationService.AuthorizeAsync. The user is anonymous and checking that the anonymous users could see something was the bottleneck of the performance. For each display of the site, there would be a database query just to authorize the anonymous user to be able to see something. This is actually a regression. Once you remove this code the controller will be much faster. An authenticated user would have added Claims cached in the User object. But in the case of an anonymous user, nothing was cached. Each request for an anonymous user would ask the permission for the anonymous user from the RoleStore. The RoleStore would do a query all the time. There is a new service, called ScopedDistributedCache. The idea is to use a distributed cache, such that we would store the Roles document in memory if we have a single node or in a store that is shared across every node if you have multiple nodes. Scoped means if you do multiple queries on the same cache entry for the same request, then we will load it from the DistributedCache only once. That will be much faster if you have multiple queries. You can see the usage of the ScopedDistributedCache in the RoleStore. Instead of injecting the IMemoryCache (that puts everything in the memory that shared by all the request) here comes the IScopedDitributedCache. The code is much simpler with that: you just pass it an object. Check the GetRolesAsync and the UpdateRolesAsync methods of the RoleStore. Demos Make lists sortable with ordering setting Let's say you have a site that you set up using the Blog recipe. In that recipe you can find a Blog content type, that is used as a container of the Blog Post content items. To behave the Blog content type this way, you need to add the ListPart to it, which will add the list behavior. Here you could see a new option before the Contained Content Types list, called Enable Ordering. If you check this option you will enable the manual ordering of the items. Let's put a tick here! Now head to the Content -> Content Items page and select the one named Blog (or just simply hit Blog from the menu). Here you can see the list of the blog posts contained in this blog content item. Let's add more posts to it to see the power of this new feature! By using a simple drag and drop, you can set the order of the different items and save it on the fly. Check out the following GIF to see how the reordering works! This feature is under development, but you can find the code in this pull request. And don't forget to watch the recording about this demo, where you can also hear an informative discussion about some interesting questions to solve, for example, what about reordering content items that have a published and a draft version too? News from the community New Orchard Core site: Buzz Interactive Buzz believes that great digital products are built on intelligent strategy and outstanding technical abilities. They partner with vibrant clients and help them create future-proof platforms for web, app, and VR. And they use Orchard Core for their site! If you are interested in more websites using Orchard and Orchard Core, don't forget to visit Show Orchard. 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. Tell us about your .NET performance challenges! - Hastlayer developer survey Help us build the nerdiest .NET thing, Hastlayer: It turns performance-critical sections of .NET programs into computer chips! If you fill out our short questionnaire you can win a cool compute accelerator board worth $265! Check it out here: https://forms.office.com/Pages/ResponsePage.aspx?id=Wt6elek45kStyIVVO-uCIMkFNjqW2E1Pm4v3YMcflMNUOVlDNUE3MlpDS044VDI1OEFSMUgxUkxSTC4u The reason we're asking this is that we're building a .NET hardware accelerator, Hastlayer (https://github.com/Lombiq/Hastlayer-SDK it turns your program into a chip!) and want to better understand what other developers do. Thank you in advance! Orchard Dojo Newsletter Now we have 113 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 - 12/20/2019

Custom parameters support in recipes, new Retrieve Content task, improved Roles UI, a new post about Orchard Core, demos about the Open Tags and the headless recipe for Orchard Core! Should I continue? Many news is waiting for you in our current post and for closing, we would like to show you some nice pics about our Christmas event! On Orchard Core Custom parameters support in recipes From now you can set custom parameters in the appsettings.json file that can be passed and used in a recipe. As you can see in the documentation, you can access a parameter value like [js: configuration('CustomParameterKey')]. For this, there is a new ConfigurationMethodProvider that receives the ShellSettings and retrieve the value to replace by ShellSettings.ShellConfiguration["CustomPropertyKey"]. Add version and target framework variables in .props Hisham Bin Ateya refactored the Dependencies.AspNetCore.props file and created a new variable named AspNetCoreTargetFramework, which contains netcoreapp3.0. Now when there will be updates on ASP.NET Core we just only need to pick this up more easily. This will simplify the process when we need to update the AspNetCore version. Here is a snippet from the Dependencies.AspNetCore.props file: <Project> <PropertyGroup> <AspNetCoreVersion>3.0.0</AspNetCoreVersion> <AspNetCoreTargetFramework>netcoreapp3.0</AspNetCoreTargetFramework> </PropertyGroup> <ItemGroup> <PackageManagement Include="Microsoft.AspNetCore.Authentication.AzureAD.UI" Version="$(AspNetCoreVersion)" /> <PackageManagement Include="Microsoft.AspNetCore.Authentication.Facebook" Version="$(AspNetCoreVersion)" /> <PackageManagement Include="Microsoft.AspNetCore.Authentication.Google" Version="$(AspNetCoreVersion)" /> ... </ItemGroup></Project> And here is a snippet from one of the modules where we use the AspNetCoreTargetFramework variable: <Project Sdk="Microsoft.NET.Sdk.Razor"> <PropertyGroup> <TargetFramework>$(AspNetCoreTargetFramework)</TargetFramework> <AddRazorSupportForMvc>true</AddRazorSupportForMvc> </PropertyGroup> ...</Project> New Retrieve Content workflow task There is a new task called Retrieve Content that tries and evaluates a content item ID from a JavaScript expression if provided. Let's see a sample workflow that has this new task in it. Here we have an HTTP Request Event as a start activity that creates a blog post that has a DisplayText: My blog post using the Create Content Task when someone invokes the URL with a GET method. The Create Content Task sets the WorkflowExecutionContext.CorrelationId (the correlation ID can be used to resume workflows that are associated with specific objects, such as content items) with the newly created content item's ID. As we mentioned, the Retrieve Content Task accepts a JavaScript expression, so here we used the correlationId() method to get the ID. The Retrieve Content Task returns the content item by it's ID and sets the WorkflowExecutionContext.LastResult with the retrieved content item. Now by adding a Notify Task, we can use a Liquid expression to display the DisplayText property of the newly created blog post content item. Finally, make a redirect to the admin page using an HTTP Redirect Task to see the displayed notification. Using custom admin URLs There is a new AdminOptions defined in the OrchardCore.Admin.Abstractions module. It tries to configure the prefix of the admin URL from the configuration and then it's creating a property called AdminUrlPrefix that is by default admin. You can change the prefix for all the admin pages. All you need to do is to add the following section to appsettings.json inside the section called OrchardCore: "OrchardCore.Admin": { "AdminUrlPrefix": "dashboard"} When you are creating a route to your AdminController, don't forget to change the route template of your controller to use this prefix like in the following snippet, which code can be found in the OrchardCore.AdminMenu module. public override void Configure(IApplicationBuilder builder, IEndpointRouteBuilder routes, IServiceProvider serviceProvider){ // Menu var menuControllerName = typeof(MenuController).ControllerName(); routes.MapAreaControllerRoute( name: "AdminMenuList", areaName: "OrchardCore.AdminMenu", pattern: _adminOptions.AdminUrlPrefix + "/AdminMenu/List", defaults: new { controller = menuControllerName, action = nameof(MenuController.List) } ); ...} Roles UI and default description We have role descriptions, but the default roles don't have any descriptions. This opens a great opportunity to improve the UI of the index and the edit pages of the Roles. In the index page, you can find the description of every role under its name and the Search box with a new UI. When you add a new role you can set its name and description. And when you edit an existing one, you can also edit its description. Here you can also find some hints about what is the difference between the Allow and Effective permissions. New post: Lucene, GraphQL and Orchard Core Sipke Schoorstra has published a nice article again in medium.com to guide people on how to implement Search using Orchard Core, Lucene and GraphQL. Read his interesting and easy to follow article about how to enable Lucene, set up a Lucene Query and consume the available APIs from Postman using Lucene and GraphQL, allowing us to use a consistent API from our applications. Demos Orchard Core headless recipe The idea of the headless recipe is to provide a recipe that sets up GraphQL, queries, and everything that has an API interface and restrict the interface down a little bit. The recipe has no home page, so when you set up your site using the recipe, you will see the login page first. And in the admin page, you will see only those options in the menu, that are related to the API interfaces. You can also watch a great detailed demo on YouTube about what will you get if you install your site using the headless recipe! Orchard Core Open Tags Last month you could see a great demo about how to work with tags using taxonomies in Orchard Core. Here we mentioned that when you add a taxonomy field to a content type with a Tags editor type and you type something in the field, you can't create a new tag that should be added to the list of tags, because that feature was under development that time. Now thanks to Dean Marcussen this is not an issue anymore. Let's see how he solved this problem! We have a site with the Blog recipe installed. Add a taxonomy field called Tags to the Blog Post content type using a Tags taxonomy with a Tag content type that has just a simple Title Part. Here use the Tags editor type with the Tags display mode. And here you could notice a new checkbox, called Open. As the hint says, if you put a tick here, you can create tags inline when editing or creating blog posts. Put a tick here and let's edit the predefined blog post! When typing something in the Tags editor and hit enter (or just click on it), you can add new tags to the Tags taxonomy and to this blog post as well. If you edit the Tags taxonomy using the dashboard you will see that the new tag has been created and the title of that tag is the value that we have just entered when editing the given blog post. If you checked the editor of the blog post well you could see that there is a section called Category with two radio buttons. But what are these for? The Category is also a taxonomy field added to the blog post with the standard editor and display mode. It uses the Categories taxonomy with the Category content type as the term. But this time the content type that is used as a term is not just about having a Title Part, but it also has a Text Field with an Icon picker editor. This means when you add Category term content types to the Categories taxonomy you can also set an icon for this term. And if you override this shape using a Liquid template or a Razor view, you can display the Font Awesome icon near the name of the term! You can also watch a nice demo on YouTube about the Open Tags for Orchard Core! On Lombiq Orchard Nuggets: How to use the same version of Orchard Core NuGet packages in every project across my solution? You have your own ASP.NET Core project that using Orchard Core NuGet packages, but every time when you update them you have to do it one-by-one across the whole solution? In our second Orchard Nuggets post, we show you a way how to update the packages easily! Check out the other posts for more such bite-sized Orchard tips and let us know if you'd have another question! Christmas in Lombiq Sometimes we do stuff. Together. Not (just) in front of computer screens. These are some usual events in Lombiq that are all announced and arranged in advance. We periodically have an event called RnDay: this is a few hours long event where we share with each other what we recently worked on and what we plan to do. E.g. if we recently finished a project then the project's team members demo what they've done. Last week we had our last RnDay for this year in the Loffice Budapest, which is a coworking office with an event space where we held this event. And at the end of the day, we visited a nearby restaurant to have dinner together. We would like to thank you all for reading our posts and making the Orchard community stronger together with us! We hope that we could give you valuable news and demos about the happenings around Orchard and Orchard Core from time to time by reading our posts and of course the This week in Orchard newsletter. We would like to wish everyone a Merry Christmas with some photos of our latest event! Orchard Dojo Newsletter Now we have 109 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!