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 >

Media Profiles, Renamed SummaryAdmin shapes - This week in Orchard (16/10/2020)

Media profiles feature to Orchard Core that allows you to defined preset image resizing and formatting commands! Renamed SummaryAdmin shapes, and new routes to avoid features URL blocking by IIS, and a lot more in our current post! Orchard Core updates Prevent disabling or removing administrator role Let's say you set up your Orchard Core site using the admin as the user name and for some reason, you navigate to Security -> Users to disable your own account. The problem here is that in this case, you are the only user with an Administrator role in the system. From now you can't do that, you will get a warning message saying you cannot disable the only administrator. Go back and edit your own user again and try to edit the user name too. This also triggers a new validation error, because you cannot modify the user name of the currently logged-in user. The last thing here is about removing the Administrator role from your user account. You could do that, but if your user is the only user with the Administrator role assigned, you will get a warning message about you cannot remove the Administrator role from the only administrator. Avoid features URL blocking by IIS IIS has some default filters for security like you can't have specific words in the URL. There are a few words used by us too like .sitemap. IIS also blocks any request ending in .resources by default. The list of blocked extensions includes a bunch of other terms that could conceivably be used in feature IDs such as .master, .browser, .config, .skin, etc. It's possible to override this behavior in the web.config file but this would have to be done on a per-application basis and carries unwanted security implications. The solution is just to put these parts in a different segment. If you want to enable a feature the URL to do that was:https://localhost:5501/Admin/Features/Enable/OrchardCore.Sitemaps Now the new URL is:https://localhost:44300/Admin/Features/OrchardCore.Sitemaps/Enable So the goal of this fix is to use the pattern Admin/Features/{id}/Enable in place of Admin/Features/Enable/{id}. The same goes for when you want to disable a feature. Renamed SummaryAdmin shapes of ContentsDriver These shape names are not compatible when defining custom placement, so they have been renamed. They are admin shapes, so the impact is quite low. If you have your own custom theme and redefined these ones you have to change them. So, the ContentsDriver creates four shapes with different shape types. Shape("Contents_SummaryAdmin__Tags", new ContentItemViewModel(model)).Location("SummaryAdmin", "Tags:10"), Shape("Contents_SummaryAdmin__Meta", new ContentItemViewModel(model)).Location("SummaryAdmin", "Meta:20"), Shape("Contents_SummaryAdmin__Button__Edit", new ContentItemViewModel(model)).Location("SummaryAdmin", "Actions:10"), Shape("Contents_SummaryAdmin__Button__Actions", new ContentItemViewModel(model)).Location("SummaryAdmin", "ActionsMenu:10") However, the actual shape type is considered before __ i.e. all the above shapes are resolved to the same shape type Contents_SummaryAdmin. Renamed these shapes as following to apply a unique placement record for each shape. Contents_SummaryAdmin__Tags renamed to ContentsTags_SummaryAdminContents_SummaryAdmin__Meta renamed to ContentsMeta_SummaryAdminContents_SummaryAdmin__Button__Edit renamed to ContentsButtonEdit_SummaryAdminContents_SummaryAdmin__Button__Actions renamed to ContentsButtonActions_SummaryAdmin So that placement will target a single shape type. { "ContentsButtonActions_SummaryAdmin": [ { "shape":"ContentsButtonEditNoView_SummaryAdmin" } ] } Demos New ImageSharp.Web Features ImageSharp is a new, fully-featured, fully managed, cross-platform, 2D graphics library. Designed to simplify image processing, ImageSharp brings you an incredibly powerful yet beautifully simple API. With the v1.0., ImageSharp has got a bunch of new features and it's now a lot faster. And Orchard Core is also using ImageSharp to work with images. New features included: Format support to the Tag Helpers/Liquid Filters: The slight weirdness with adding this is the file extension on the URL will remain .png, but the image will be returned with the correct mime/type. Quality support to jpg encoding and Tag Helpers/Liquid Filters: The Quality support allows you to specify a quality % to jpg encoding. Note: only jpg encoding is supported, but the Format support allows you to convert an image from saying png to jpg, and then reduce the quality. CurrentCulture/InvariantCulture for query string parameters: Supported through custom ImageSharp configuration, but not integrated into Orchard Core. Basing this decision primarily on the idea that most of our resizing/processing query string building, is done through templates, which are culture invariant. And that's not all of it! There is now a new Media profiles feature in Orchard Core that allowing you to specify resizing options and much other stuff. A profile can then be called with the profile name resize_url: profile: 'banner' rather than having to specify all the resizing options that may apply. But that's enough talk for now, let's see them in action, after all, we are in the Demos section of This week in Orchard, right? Use the latest nightly build of Orchard Core and set up your site using the Agency recipe. Then navigate to the admin UI where you will see a new option in the menu (make sure to enable the Media profiles feature): Configuration -> Media -> Media Profiles. Media Profiles are quite simple, they just have the standard resizing options that we have in ImageSharp. Notice that here you can set the width and the height values only from the supported ones. We add the name md to this media profile, let's note it, we will need it right away. Now navigate to Design -> Templates and edit the predefined Content__LandingPage Liquid template. We will use the newly created image profile when displaying the portfolio images. Just a note here: the home page in this agency is a LandingPage content type that has several Bag Parts attached. The one with the display name Portfolio is about to add Project content types to your LandingPage content type. And the Project content type has a Media Field attached, called Image. In this Liquid template, we will use our newly created md media profile. Here we say use the md media profile when displaying these images and in this particular case we would like to override the resize mode for the processed image. Instead of crop, we would like to stretch these images, but just in this case. When you define a media profile, you can say I don't want to specify the width, the height or the resize mode. In that case, you can set them in your Liquid helper, just as you could do that before. Now, let's just check out how does the home page of our site looks like. Remember that we set a lot of values when setting up our md media profile and we also set the quality percentage for the processed image and we set it as 10. We also change the width and height values and override the resize mode to stretch the images. This result is low quality stretched images in the Portfolio section. Now let's see the source code of this page and check out the img tags using the DevTools of Chrome. As you can see it's not tied to ImageSharp, the logic just converts the media profile into a good query string. This means we can do the override easier and if we change the values the URL will change, and it breaks the cache. When you would like to show the kittens.jpg with 100 width and 100 height, by using the crop resize mode (that resizes the image using the same functionality as max then removes any image area falling outside the bounds of its container) and use only 50% as the quality when compressing the image you would write a Liquid filter like this: {{ 'animals/kittens.jpg' | asset_url | resize_url: width:100, height:240, mode:'crop', quality: 50, format:'jpg' }} The documentation is also updated to help you how to use these new arguments. Don't forget to head to YouTube and watch the recording of this awesome feature! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 162 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!

Distributed cache, YesSql improvements - This week in Orchard (09/10/2020)

Get ready for the upcoming additions of Orchard Core! This week you can see demos about adding distributed cache to Orchard Core and the latest improvements of YesSql! Orchard Core updates Restrict Content Types Admin Node to only create the specified content type Let's say you have a site set up with the Blog recipe and your goal is to add a new admin menu that is about to list all the existing Article content items. To do that you have to navigate to Configuration -> Admin Menu and click on the Add Node button. Here you will need to select the Content Types Admin Node because you would like to add a link for each one of the selected content types from the list. And yes, you will only select the Article content type in the next screen. And that's it, you have created a new admin menu that lists all of the Article content items from the system. If you click on that you will see the list of the Article content items. Note that from now you will not see a filter here to filter by content types because that really doesn't make much sense. You created this Content Types Admin Node to list only the Article content items. If you would like to filter by content type, use the filter in the Content -> Content Items page as you would do it before. Remove ManageOwnMedia permission The ManageOwnMedia permission isn't handled today and we can replace it with the ManageMedia permission. So, now there is no separate permission to manage their own media or manage the media. It will be added back to the system again if the authorization logic is to be able to separate the user's media and the media uploaded by others. Right now, if you head to Security -> Roles and hit the Edit button near one of the Roles, you will see the missing Manage Own Media permission. Use a dropdown menu on the admin top navbar for the user menu The user menu on the admin theme is just about listing the user name of the currently logged-in user with a little icon near it. And there was a Log off link at the right side of the user name. It was just a piece of HTML code in the Layout.cshtml file of the default admin theme. From now the whole user menu gets its own shape, called UserMenu.cshtml. If you would like to override the user menu, you don't need to create a Layout.cshtml file in your admin theme, you just need to override the UserMenu.cshtml file. And if you check out this GIF, you will see that now the content of the user menu is placed in a dropdown instead of having it's content inline. Document release procedure Orchard Core is open-source that means you can check out and request changes to the source code, tell your opinion about it, and update the relevant documentation for that piece of code. Now there is a new page in the Orchard Core Documentation about how to publish a new Orchard Core release. These notes are primarily for Orchard's core contributors to guide them on how to prepare a new release, but if you just take a look at these you can now see what are the steps that need to be done to be able to ship a new release of Orchard Core. Add option to allow Lucene query syntax in the search There is a setting in the Lucene module that you can turn on and whatever you type in the search box won't be parsed as 'these are the words that I need to search on', but parsed as this is a Lucene query. You can use the Lucene query syntax in search forms, like the quotes, plus signs and things like this. But by default, it will still be like today, which is type words and it looks for these words. If you type stuff that has weird characters, they would be ignored. But how can I turn on that feature? Just navigate to the admin UI of Orchard Core, then find the settings in Search -> Settings -> Search (make sure you have enabled the Lucene module). Demos YesSql: Adding support for multi filters on the same table index There is a new method on .IQuery called .Or(), which starts a filter on a distinct table. This can be used for instance when the same index needs to be queried for multiple sets. It will actually add many filters on the same record of the index. With .Or() you can do now filters on different inner joins of the same index. Which means it will do unions of result with the filters. Let's check out the following unit test. [Fact]public async Task ShouldQueryMultipleIndexes(){ // We should be able to query documents on multiple rows in an index. // This mean the same Index table needs to be JOINed. _store.RegisterIndexes<PersonIdentitiesIndexProvider>(); using (var session = _store.CreateSession()) { var hanselman = new Person { Firstname = "Scott", Lastname = "Hanselman" }; var guthrie = new Person { Firstname = "Scott", Lastname = "Guthrie" }; session.Save(hanselman); session.Save(guthrie); } using (var session = _store.CreateSession()) { Assert.Equal(2, await session.Query<Person>() .With<PersonIdentity>(x => x.Identity == "Hanselman") .Or() .With<PersonIdentity>(x => x.Identity == "Guthrie")) .CountAsync()); }} This PersonIdentitiesIndexProvider will just map the first name and the last name of each person. We created two persons here that means the provider will be creating four PersonIdentity records. Two to store the first name and last name for Scott Hanselman and two to store the first name and the last name of Scott Guthrie. If without using the .Or() it will issue a query where the Identity == "Hanselman" AND Identity == "Guthrie", which will return nothing. With the .Or(), it will do an inner join on PersonIdentity with a filter on Identity == "Hanselman" and another inner join on PersonIdentity with a filter on Identity == "Guthrie". In this case, we will get both the two persons. It's like give me any person who's PersonIdentity has a record like Hanselman OR where the PersonIdentity equals Guthrie. Let's see another example! // Creating articles.using (var session = store.CreateSession()){ session.Save(new Article { Content = "This is a green fox" }); session.Save(new Article { Content = "This is a yellow cat" }); session.Save(new Article { Content = "This is a pink elephant" }); session.Save(new Article { Content = "This is a green tiger" });}using (var session = store.CreateSession()){ Console.WriteLine("Boolean query: 'pink or tiger'"); var boolQuery = await session.Query<Article>() .Where(x => x.Word.IsIn(new[] { "pink" })) .Or() .Where(x => x.Word.IsIn(new[] { "tiger" })) .ListAsync();} This is a full-text sample where in this case we can query documents by their content, by their words. If we have the documents as you could see in the code, we are creating an index for all the words pointing to the document, like green and fox points to the first Article. Now the query is about to give me all the documents that have pink in it OR all the documents that have tiger in it. The goal is to get the last two articles in this case. Let's check out this query: var boolQuery = await session.Query<Article, ArticleByWord>().Where(a => a.Word.IsIn(new[] { "white", "fox", "pink" })).ListAsync(); This query will return all the articles that have white AND fox AND pink in it and there is none in this case. You can find the recording of this improvement on YouTube! But wait a minute! Could this syntax be better? When you have a query, you can say .Any() and every predicate will be done in a different table. .Any() being an OR, and .All() being an AND. In this case, we're querying on the same index (ArticleByWord) but each of the calls on .With() will be a different projection, a different inner join in this case. Here we are looking for an article that has the word pink OR the words green AND fox. await session.Query<Article>() .Any( x => x.With<ArticleByWord>(a => a.Word == "pink"), x => x.All( x => x.With<ArticleByWord>(a => a.Word == "green"), x => x.With<ArticleByWord>(a => a.Word == "fox"))).ListAsync(); SELECT DISTINCT Document.* FROM DocumentINNER JOIN ArticleByWord_Document AS [ArticleByWord_Document_a1] ON ArticleByWord_Document_a1.DocumentId = Document.IdINNER JOIN ArticleByWord AS [ArticleByWord_a1] ON [ArticleByWord_a1].Id = ArticleByWord_Document_a1.ArticleByWordIdINNER JOIN ArticleByWord_Document AS [ArticleByWord_Document_a2] ON ArticleByWord_Document_a2.DocumentId = Document.IdINNER JOIN ArticleByWord AS [ArticleByWord_a2] ON [ArticleByWord_a2].Id = ArticleByWord_Document_a2.ArticleByWordIdINNER JOIN ArticleByWord_Document AS [ArticleByWord_Document_a3] ON ArticleByWord_Document_a3.DocumentId = Document.IdINNER JOIN ArticleByWord AS [ArticleByWord_a3] ON [ArticleByWord_a3].Id = ArticleByWord_Document_a3.ArticleByWordIdWHERE ArticleByWord_a1.Word = 'pink' OR ( ArticleByWord_a2.Word = 'green' AND ArticleByWord_a3.Word = 'fox') Here you can also see how does the query look like. That's the current syntax right now. And it's not breaking change because if you had .query.With().With(), it will still behave the same as before. It will be a single projection with two .With(). If you project on the same table it will be an AND on the same table, the same projection.If you would like to know more about the current syntax and the latest features, this is the YouTube video that you are looking for! Distributed Redis Cache There is a huge PR with a great addition to Orchard Core about having Distributed Cache in Orchard Core. In fact, this PR is related to all modules services using cached data that need to be in sync with a shared database, e.g. site settings and other admin settings, templates, queries, layers, and so on. Currently, in the dev branch, this is already the case for most of them but by using local memory cache entries that are invalidated through a distributed signal. This PR has changed this pattern by using a multi-level cache including a distributed cache. And Jean-Thierry Kéchichian made more services to be distributed aware, there are remaining things but could be done in other PRs. And recently he added the ability through a separate feature to also keep in sync tenant states, when you enable/disable/create/setup a tenant. To summarize: All services that were using the memory cache are now using a multi-level cache including a distributed cache, this cache is kept in sync with the database without using a message bus but document identifiers. We have concrete implementations of distributed services based on Redis, Redis cache, Redis data protection, Redis message bus, and Redis lock. In the current code, we never use a message bus/distributed lock. When enabling a concrete distributed cache in the default tenant, we automatically keep all tenants in sync through a hosted service, here also without using a message bus but identifiers. Here a stateless configuration is needed. There is a separate feature (DefaultTenantOnly) to keep tenants in sync. Don't forget to head to YouTube and watch the recording of this upcoming feature! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 160 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!

New custom filters in Fluid, Media options admin page - This week in Orchard (02/10/2020)

We prepared two interesting demos for this week: The first one is about having new useful custom filters in Liquid to make formatting numbers and string easier. The other upcoming feature is about how you can show your settings from your appsettings.json files without having the need to open these files in your file system. Orchard Core updates Restrict Content Type Admin Menus to only create the specified Content Type Several issues fixed regarding creating content items from the admin UI: Restored the new button specific to each content item when user filters by content type or accesses the content item list interface by link for a single content type in the admin menu. Fixed the behavior of the admin menu's links to Menus and Content Items: if they are not defined inside a recipe, they have a dynamic behavior and it causes an issue if the user defines a link for a specific content type inside the admin menu. In the BlogTheme, the Content Items link of the admin menu is defined in the recipe and doesn't have dynamic behavior. See the following GIF here where you can also see the creation of a new content type admin menu node that is about to list the Article content items. The new button under the new Article menu option is just about to create new Article content items. Update Blob Storage to search folder hierarchies The problem is that the method that is responsible to handle Blob Storage items does not correctly implement the includeSubDirectories = true option - it never did. This is because it's not like a normal file system where you can make one request and list everything, so it would have to make recursive requests for every directory it finds. Ironically the media step driver does this recursion already itself, but the recipe step does not when using Include All Media. So the short term workaround should be to specify the attached fields' folder's media fields, rather than Include All Media when creating the step. This issue withincludeSubDirectories = true affects this step, and the GraphQL media query - it's the only place we use it. So, Blob storage never handled searching subfolders correctly, so this should now work for the media step, and better in GraphQL queries (behaves identically to normal file system now). Now if you would like to get the content of the directory including subfolders too, the GetDirectoryContentFlatAsync method in the BlobFileStore class will return the files inside the subfolders too. Rename Smtp admin menu to Email The goal of renaming Smtp to Email is to make sure that you can edit settings related to sending emails even if you don't know what SMTP is (and this screen is also for testing email sending). Toggle password visibility on the login form and on the setup screen The login form and the setup screen now support toggling the password visibility, so can make sure that you typed the correct passwords in these textboxes. Demos Media options admin page In the appsettings.json file, you can define your media-related settings, e.g. change the list of allowed file extensions or the path used when serving media assets. The documentation includes all the default configuration values that can be overridden. The goal of this feature is to have a read-only version of the settings where you can see these configuration values without needing to navigate to your appsettings.json file to see the configured values. Head to YouTube to check out this short recording about this upcoming feature! New custom filters in Fluid Fluid is an open-source .NET templating engine that is as close as possible to the Liquid template language. It's a secure template language that is also very accessible for non-programmer audiences. It also contains an ASP.NET Core MVC View Engine. And of course, Orchard Core is using Fluid too to generate templates. If you would like to render numbers correctly, Fluid just renders them in a format 124456789, but you could not format it like for example 12,445.68 )(and you can't do it in Liquid by default either). We already had the format_date helper in Fluid where we can use the .NET formats, so the new helpers added are format_number and format_string, which are using the .NET format methods. They are not standard in Liquid, but there is nothing in Liquid to help achieving these. format_number: It will format the number with the current culture. If you pass "N", which means number in the standard numeric format strings, then it will use the number format that we have just mentioned above. So, to generate 12,445.68 from the 12445.6789 value, you can do that like 12445.6789 | format_number: "N" You can find a documentation about the standard numeric format strings here. format_string: In this case, you can pass a string with a String.Format inside and after using the format_string you can pass the values. Let's say you have the following expression: "hello {0} {1:C}" | format_string: "world" 123. This would be rendered as hello world $123.00. Notice that here we also used the currency ("C") format specifier to convert a number to a string that represents a currency amount. The documentation of Fluid contains the available custom filters where you can learn more about the other features of Fluid too. Head to YouTube to check out the recording about the new custom filters! News from the community Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 161 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!

Generic Site Settings Deployment Step, Extensible filters for contents admin list - This week in Orchard (17/07/2020)

The community has just released RC 2 a few weeks ago, but ever since Orchard Core has got several new features. This week among others we are going to see the extensible filters for contents admin list and the generic site settings deployment step. Orchard Core updates New column to the media library table view Enter the dashboard of your Orchard Core site and navigate to Content -> Media Library. Here you can view the uploaded files in a list view and in a grid view. You can switch between them using the little icons on the left side of the Filter textbox. If you view the files using the list view you will see a new column called LastModify. You can also sort the items by clicking on the header of the LastModify column. Extensible filters for contents admin list You can extend what filters are available in the contents admin list and each module can provide their own filters. Let's see this feature closely! First, install your site using the Blog recipe. Now, head to Configuration -> Features and enable the Taxonomies Contents List Filters and the Content Localization modules. The Content Localization is about to provide a part that allows localizing content items. The Taxonomies Contents List Filters feature is adding a new option under Configuration -> Settings -> Taxonomy Filters where you can select the taxonomies to filters in the contents list. As you can see, the Blog recipe comes with two predefined taxonomies: Tags and Categories. Let's select both ones. Now, head to Content -> Content Items, where you could see three new drop-downs. Categories and Tags can be used to filter by the values of the Category and the Tag Term content type. Just for the sake of demonstration make the Blog Post content type listable to see the Blog Post content items in the content items list. After if you select to filter for the content items that have the Earth tag, you will see the default one, because that post has each of these three existing posts. And you can easily add your own filters for the content items list! Without going into the details you have to add a new driver by implementing the DisplayDriver<ContentOptionsViewModel> abstract class and implement the IContentsAdminListFilter interface where you can provide the logic for filtering - modify the query (IQuery<ContentItem>) - content items. Check the TaxonomyContentsAdminListDisplayDriver.cs and the TaxonomyContentsAdminListFilter.cs files to see good examples about how to create your own filters. There was a demo about the new content filters and in the case, if you haven't seen it yet, you can watch the recording here. Demo videos in docs From time to time, the members of the community will do demos to show the latest features and improvements of the CMS. These videos are very helpful if you would like to learn a given topic (for example how to create Custom Settings using the admin UI) and you prefer videos. Now every topic in the documentation of Orchard Core containing the recording that is about showing you how to use the given feature. If we stay at the same example we will see the video at the bottom of the Custom Settings page. Add and implement IsJson() string extension method We are sure that you will meet some code in the future that is using JSON in their editor templates and you want to/need to validate that the text supplied in the editor is valid JSON. Now you can find a string extension method called IsJson() in the OrchardCore.Mvc.Utilities classes to do this. Demos Generic Site Settings Deployment Step When you navigate to the GitHub page of Orchard Core and list the open issues you will find one that is about listing the missing deployment steps, which means some settings do not have a deployment step to import and export them. The goal here is to be able to import/export every setting. For that, we have to get familiar with the notion of Generic Site Settings Deployment Step. You will find a new class library called OrchardCore.Settings.Core, where is a folder named Deployment that is containing logic to add site settings to a DeploymentPlanResult, a generic display driver that is responsible for the UI of the deployment plan and many more. Feel free to discover the content of this project! Now let's jump to the OrchardCore.Admin module. If you want to handle the custom settings via the OrchardCore.Settings.Core library, don't forget to reference it in your project. If you do that you can easily import/export the settings in your deployment plan. There is a class called AdminSettings in the OrchardCore.Admin module that contains one DisplayMenuFilter boolean property. Let's make it importable/exportable! Head to the Startup.cs file of the module and check out the DeploymentStartup class of it. Here you can see how you can use the provided generic business logic from the OrchardCore.Settings.Core project. You can see that we created a new deployment plan with the name: Admin settings and the description: Exports the admin settings by just passing these localized strings to the SiteSettingsPropertyDeploymentStepDriver. That's an easy and generic way to implement a deployment plan for your settings in your module! If you would like to know more about the generic site settings deployment step, head to YouTube! News from the community Intensive Orchard Core training for the In Motion team We had the opportunity to provide a five-day intensive Orchard Core training for the In Motion team! Read our post to know more details about the training! Orchard Core workshops The contributors of Orchard Core will hold some unique online workshops in September 2020. So even with Orchard Harvest postponed due to the coronavirus pandemic we'll get some new learning events. Are you looking to get up to speed with Orchard? Check out the workshops' details on the Orchard Core homepage! Orchard Dojo Newsletter Now we have 152 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!

Content Picker Menu Item, Kast case study - This week in Orchard (02/05/2020)

Soon you will able to show content items in your menu easily! How? Check our newest This week in Orchard post and read about an amazing demo to see the new Content Picker Menu Item in action! We published a brand new case study this week on our website about the latest Orchard Core site we developed. By reading that study you can see the possibilities that you can easily achieve by using Orchard Core as your CMS! Don't forget to read our whole post for the most interesting news around the community! Orchard Core updates Added ability to restrict widgets within a flow part You can use the FlowPartSettings to give content managers the capability to restrict which widgets are available within the flow editor. If no widgets have been selected then all widgets will be available, as per the current implementation. Let's see it quickly! Set up a site with the Blog recipe and then edit the content type definition of the Page content type. To do that navigate to Content -> Content Definition -> Content Types and choose the Page. Then find the attached parts and hit Edit near the Flow one. Here you can select which content types this flow can contain. Just for the sake of demonstration, we say that the Flow editor of this page can only accept Liquid widgets. Let's see what will happen when we create a new Page! Hit New -> Page and try to add something to the Flow editor. You will see that only the Liquid one will be on the list because in the previous step we only allowed Liquid widgets. So, when you attach a FlowPart now you can decide what content types you want to be able to use in a FlowPart. It can be useful if you create a form page type with a FlowPart for it. You could then decide just to allow for form widgets. Remember: if you don't select anything you will be able to use any type of content type with the Widget stereotype in your editor. Added support for IN (SELECT) SQL statements You can use a custom SQL statement, that is about to parse for the queries module, the one that uses the generic SQL language and that will be translated to any dialect that the CMS supports (PostgreSQL, MySQL, SQLite, Microsoft SQL Server). If you use this language now you can use the select expression inside an in statement. It's also supporting the not in correctly and the like and not like was not working well, so these are also fixed. Check the new InlineData attributes added to the ShouldParseExpression test method to see some examples with the new expression. Fix shape table providers There was an issue with the way you would be able to override a template from your module, override a template for a dependent module. This change will look for shape templates in a module for any first-level dependencies and it's also improving performance because there would be fewer shape templates loaded in the memory. And if you have a feature depending on another feature then it won't be able to override the second level feature, you have to depend on that. It makes sense because you are creating a template for the second level feature, so you can depend on that because you expected that it would be there. Deployment plans search Let's navigate to Configuration -> Import/Export and create one or more deployment plans. Here you can filter the deployment plans and also do bulk actions. To do bulk actions select two or more deployment plans and after that, you will see the Delete option in the Actions dropdown. Content culture picker shape documentation If you navigate to the Content Localization section in the Orchard Core documentation, you may have noticed that there were no Razor example codes. From now the documentation has been improved with Razor examples! Demos Content Picker Menu Item Let's set up a site with the Blog recipe, create a new Page, and call it My brand new page. Then choose the Main Menu option in the admin UI and hit the Add Menu Item button. Here you could see the Available Menu Items modal window with two options: Link Menu Item and Content Picker Menu Item. Let's choose the second one! The Content Picker Menu Item is about having the ability to choose from the content items available in the CMS with a content picker. There is the Selected ContentItem dropdown, that can be used to select the content item that you would like to show on the menu. You can type to search or just simply select your item from the list. We will select our newly created page here. Publish the menu and navigate to the homepage of your site to see your menu. We placed the new menu item after the About, but of course, it's your choice to set the position of your menu item. If you are interested in the full demo don't forget to watch the recording on YouTube! Note that this feature is under development and can be found in this branch! News from the community Orchard Nuggets: How to add a culture URL segment for localization in Orchard Core So you're building a localized Orchard Core site and want all URLs to be in the form of /culture-name/rest/of/the/url, e.g. /hu-HU/my-page. What do you need to achieve this? In our newest Orchard Nuggets post, we give you the answers! Check out the other posts for more such bite-sized Orchard tips and let us know if you'd have another question! Helping Kast build a multi-tenant platform on Orchard Core Kast is an Australian company and one of their primary goals is to implement the Kast platform with the Kast Group Finder component. We worked together with Seth Cleaver (Co-founder and Director of Kast) on this tool to be able to create an intuitive self-service process that enables people within a church to easily find a suitable group to attend, simplify the administrative processes required for getting people into groups, and provide information to the group co-ordinators that might assist in planning and measuring effectiveness. Check out this case study about how we've developed this multi-tenant social group management platform for churches! 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. Orchard Core Training Demo module: combining ASP.NET Core Options with Orchard Core site settings Our Orchard Core Training Demo module has a new tutorial on combining ASP.NET Core Options with Orchard Core site settings. In the SiteSettingsController you could see how to use the Site Settings to access tenant-level settings and any other custom settings! Orchard Core Training Demo module is a demo Orchard Core 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 including the full source code - which is the recommended way. You can use it as part of a solution the uses Orchard Core NuGet packages, however, it's harder to look under the hood of Orchard Core features. The module assumes that you have a good understanding of basic Orchard concepts and that you can get around the Orchard admin area (the official documentation may help you with that). You should also be familiar with how to use Visual Studio and write C#, as well as the concepts of ASP.NET Core MVC. Bug reports, feature requests, and comments are warmly welcome, please do so via GitHub. Feel free to send pull requests too, no matter which source repository you choose for this purpose. Updated Lombiq Technologies logos You may have noticed that we rolled out our updated logo in the last few days. The spirit is the same: The lab flask with which we distill our IT solutions ("lombik" in Hungarian means lab flask :)). So, please welcome it! Orchard Core workshops The contributors of Orchard Core will hold some unique online workshops in the coming months, between May and September 2020. So even with Orchard Harvest postponed due to the coronavirus pandemic we'll get some new learning events. Lombiq's developers will also give two workshops, on using Orchard from the admin UI and on developing a module. Are you looking to get up to speed with Orchard? Check out the workshops' details on the Orchard Core homepage! Orchard Dojo Newsletter Now we have 140 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!

Error Log Watcher in Lombiq Orchard Visual Studio Extension, Disable and Enable Tasks - This week in Orchard (03/04/2020)

New tasks when working tenants in your workflows, a best practice about how to validate your ViewModel using a service and a spectacular and fun demo about a nice addition to our Orchard Visual Studio Extension! Read our current post for more! Orchard Core updates Tenant Workflows: Disable and Enable Tasks Now you have workflow tasks to Disable or Enable tenants to support tenant management using with Forms or any external services. With these you have four events to manipulate tenants: Create Tenant Enable Tenant Disable Tenant Setup Tenant From now, you can use the workflows to create, setup and then enable the tenants, because we have tasks to cover the whole process. In our case, we created a workflow called Add tenant and used these activities to fire up a tenant from scratch by the values provided by the users in a form. Search inputs Antoine Griffard updated all the search inputs in admin to use autofocus and type="search". This is a way to let the browser display these inputs with better hints. You can even predefine a list of common search inputs if you want. It's not used here, but we could also extend these to do that or show a list of historical data that you put in that textbox. Validating ViewModels We would like to mention this because by reading this solution you could get a nice best practice about how to validate something with a service if you are in a ViewModel. In this current issue, we would like to validate the value of an email address by using the RegisterExternalLoginViewModel. If you would like to validate an object using a ViewModel, you have to implement the IValidatableObject interface which will give you a Validate method. And in this method, you can use whatever service you want. When you create a new instance of your ViewModel, you can pass your service to it in a parameter by using constructor dependency injection. In this current example, we could see the passing of the IEmailAddressValidator to the RegisterExternalLoginViewModel. And in the RegisterExternalLoginViewModel you can use the service in the Validate method injected using the constructor. But, if you see the changes below, you could notice that by using the ValidationContext, you can get your service from the IServiceProvider by calling validationContext.GetService<T>(). In this case, you don't have to pass anything using the constructor when creating a new instance of your ViewModel, just simply resolve your service using the ValidationContext. A new section in the Orchard Core documentation: Resources Now when you open the documentation of Orchard Core, you will find a new item on the menu, called Resources. The goal of the Resources page is to collect any external resources that are available to teach you how to develop with Orchard Core. Our Orchard Core Training Demo module has been added as the first demo project for this page. And you can also found some lines about our newsletter here and the URL where you can sign up for our newsletter! New favicon for the Orchard Core documentation If you check the previous screen again, you will see that the snip contains the title bar of the window too. That's because when you visit the documentation page of Orchard Core, you will face a new blueish favicon, that looks nicer in a browser that uses a darker theme too. Demos Adding BlinkStick support to Lombiq Orchard Visual Studio Extension Orchard Error Log Watcher feature Lombiq Orchard Visual Studio Extension is a Visual Studio extension with many features and templates frequently used by Lombiq developers. It contains Orchard-related (including Orchard Core) as well as generic goodies. This extension has an Orchard Log Watcher feature, that alerts you when you have any new entry in the log file. When you install this extension, you will see a new button on the Orchard Log Watcher toolbar. The button of this toolbar will be enabled when you have unread entries in the error log files. If you click on this button, the log file will be opened with the editor assigned to open .log files. When you navigate to Tools -> Options -> Lombiq Orchard Visual Studio Extension -> Orchard Log Watcher you can enable or disable this feature. You can also set the log file folder path. The path can be anything, so, you can set custom paths as well. The default path here supports the default path of the log files in the case of an Orchard Core and an Orchard 1.x solution too. And here comes the fun part: you can also set to blink or light up continuously a BlinkStick LED stick when a new entry is detected. BlinkStick brings colorful notifications to your computer and wide range programming language implementations give you the power to control LEDs without the need to program a microcontroller and you can choose from different kinds of products. Furthermore, you can also set the color for the LED by providing a hex value or the name of the color. You can find the list of the supported colors here. You just need to plug this device into your USB port and the extension will recognize it! Here you can download this free, open-source extension. In GitHub, you can find the extension's Readme with release notes too. Also, if you encountered bugs or have a feature request please add it on the GitHub page as well. And don't forget to watch the full demo on YouTube! News from the community Training Demo updated: how to add an ASP.NET Core middleware to your Orchard Core application? Orchard Core Training Demo module is a demo Orchard Core 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 including the full source code - which is the recommended way. You can use it as part of a solution the uses Orchard Core NuGet packages, however, it's harder to look under the hood of Orchard Core features. The module assumes that you have a good understanding of basic Orchard concepts and that you can get around the Orchard admin area (the official documentation may help you with that). You should also be familiar with how to use Visual Studio and write C#, as well as the concepts of ASP.NET Core MVC. We have just added a new section to our module about how to implement an ASP.NET Core middleware in your Orchard Core application. Take a look at the RequestLoggingMiddleware.cs file! Orchard Dojo Newsletter Now we have 130 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!

User disabled/enabled events, filter admin menu - This week in Orchard (07/02/2020)

Orchard Core has got several new features and fixes this week! With many others, we will see the new user disabled/enabled events, the new IAreaControllerRouteMapper implementation, the way how you can filter the admin menu then show you a demo about how to integrate stripe.js in your Orchard Core application with workflows. And finally, say some words about a new tentative date and location for the upcoming Harvest! Orchard Core updates Reduce the length of indexes for Content Fields Indexing Let's focus on the LinkFieldIndex and check these two columns: the Url and the BigUrl. The Url is the one that is trimmed and indexed, and the BigUrl is the original data that is not indexed. If you are using MySQL, the maximum length that this provider can support in an index under UTF8 collection is 768. Now we set the maximum length of the indexed columns is to not be longer than the supported length. Do not check "Include all content types" in deployment step by default When you create a content type deployment step, the default is to export all types. Now, this is unchecked by default. Adding User Disabled/Enabled Events The IUserCreatedEventHandler is changed to IUserEventHandler and there are two new events: DisabledAsync and EnabledAsync events. These two new events now triggered in the UserDisplayDriver that will trigger the two newly created workflow events to make it work in your workflows. Adding IAreaControllerRouteMapper Now there is an updated way how the admin prefix is applied by using custom convention and constraint that will ensure that the admin URLs start with the admin prefix. And also ensure that it is done correctly for the controllers that are named AdminController, not the ones that start with admin. Before every controller that starts with admin could be an admin controller, but now with this new convention, it has been decided that only controllers named AdminController can be an admin controller. For example, a controller named AdminItemController doesn't fall into this category, so it can't be an admin controller. A concrete implementation being AdminAreaControllerRouteMapper that uses AdminOptions to provide a default route pattern that is used in the OrchardCore.MVC startup. Just as a reminder, if you have admin controllers you have to name them AdminController or have the Admin attribute on that. This will ensure that the URL is strictly using the admin prefix (or whatever you set it), and the user has the admin permission and this will also apply the admin theme to the views from this controller. Filter admin menu Head to Configuration -> Settings -> Admin and put a tick near the Enable Admin Menu filter checkbox. Now you will have a new textbox at the top of the admin menu with a Filter placeholder text inside it. If you type something here you can filter the menu items and could find easier the option you want. And if you hit CTRL+SHIFT+F, this textbox will get the focus and you can type the menu option that you are looking for without needing to click into this textbox. Add menus content listing and create option If you navigate to the Content option of the admin menu you will find a new one, called Menus. This feature is listing all the menus of the system, and if you can see, there is a new button, called New Menu. By clicking on this button you can create a new Menu without needed the Menu content type to be creatable. Make lists sortable with ordering setting A few weeks ago we write about a way how you can make sortable lists using the Enable Ordering setting of the ListPart and you can also find a demo on YouTube about this feature. The good news is this feature is now merged to the dev branch of Orchard Core! Checkout to the latest changeset of the dev branch and try this feature now. Then don't forget to tell your opinion about it in the comments section! Razor Helpers documentation Now there is a new page in the Orchard Core documentation that contains the extension methods that are available in Razor using @Orchard. This documentation also contains the way how to use an extension method in a view and in a controller too. Demos Stripe.js and Workflows You can use Stripe.js’ APIs to tokenize customer information, collect sensitive card data using customizable Stripe Elements, and accept payments with browser payment APIs like Apple Pay and the Payment Request API. And of course, you can add Stripe.js to your Orchard Core site too! Let's create a registration form where users can register and after successful registration, they can pay the fee for a ticket. After the user submits the form, here comes a huge workflow, that will validate all the fields of the form. Here you can see the several validations, and when there is no error, the workflow will send an email, create an Enrollment in Orchard Core and redirect the user to stripe using a Fork. And there will be another workflow that will validate the payment using the response that Orchard Core will get from stripe.js. Now let's take a closer look at the Create Content Task that creates a new Enrollment content type. When you are creating a new content type using this task, you have to write the properties of the content. This is the JSON that is used to construct the given content item. As you can see, here you can use different Liquid expressions as well, for example, we could use the data coming from the form. You can see the website using this registration form under this URL. Here just click on the Register at the top right and select from the listed options. If you would like to see the whole demo just head to YouTube and watch the recording! News from the community A new tentative date and location for the next Harvest We have another tentative date for the next Harvest: the last week of June. In this date, we could do it in Europe and in a location that is easier to go from the USA too. London and Amsterdam have airports that can be reached easily from several other countries as well. What do you think about the new date and locations? Orchard Dojo Newsletter Now we have 114 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/27/2019

New deployment step for Open ID Server, a new multi-tenant platform built with Orchard Core and a very interesting demo about a custom admin tree module with taxonomy terms menu are waiting for you among other exciting news in this year's last This week in Orchard post! On Orchard Core Allow replacing a Liquid filter Orchard Core has several built-in Liquid filters. You can make your own Liquid filter if you implement the ILiquidFilter interface. However, it could be a valid use case if you would like to change the behavior of one of the predefined built-in filters and replace it with your own one. When registering a Liquid Filter to the service container, you have to do it in the ConfigureServices method of your Startup.cs file: public override void ConfigureServices(IServiceCollection services){ services.AddLiquidFilter<BuildDisplayFilter>("shape_build_display"); services.AddLiquidFilter<ContentItemFilter>("content_item_id");} Here you can see how to register the shape_build_display and content_item_id filters. But let's have a closer look at that AddLiquidFilter extension method! public static IServiceCollection AddLiquidFilter<T>(this IServiceCollection services, string name) where T : class, ILiquidFilter{ services.Configure<LiquidOptions>(options => options.FilterRegistrations.Add(name, typeof(T))); services.AddScoped<T>(); return services;} You could see that every time when you call AddLiquidFilter it adds your filter to the FilterRegistrations Dictionary. To be able to override an existing Liquid filter with your own, Jean-Thierry Kéchichian had to change this extension method a little bit and instead of adding the new filter to this Dictionary, just overwrite an existing one. public static IServiceCollection AddLiquidFilter<T>(this IServiceCollection services, string name) where T : class, ILiquidFilter{ services.Configure<LiquidOptions>(options => options.FilterRegistrations[name] = typeof(T)); services.AddScoped<T>(); return services;} Delete role should warn the user if the role has associated users Let's create a custom role and let's name it Blogger. Now let's create a new user and add the Blogger role to it. Now go back to the Roles page and delete the Blogger role. If you hit the Delete button you will see a warning message, that says this role is associated to existing user(s). Prefix resource manager definitions for sample themes When you would like to register your resource using the ResourceManifest, you have to do something similar: manifest .DefineScript("vendor-bootstrap") .SetDependencies("vendor-jQuery") .SetUrl("~/TheBlogTheme/vendor/bootstrap/js/bootstrap.min.js", "~/TheBlogTheme/vendor/bootstrap/js/bootstrap.js") .SetCdn("https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js", "https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.js") .SetCdnIntegrity("sha384-JjSmVgy...", "sha384-rkSXwmdF/9eRLkw/gNZG+1...") .SetVersion("4.3.1"); But what if you want to register Bootstrap again in your custom theme? You can do that of course, but when there are multiple resources with the same name, the resource manager takes the one with the highest version. // Use the highest version of all matchesif (resource == null || (resourceDefinition.Version != null && new Version(resource.Version) < version)){ resource = resourceDefinition;} To make things easier every predefined resource in the themes available in Orchard Core now has prefixes, which is the name of the theme. As you can see in the following code snippet, we registered the script for Bootstrap in the Blog theme with the name: TheBlogTheme-vendor-bootstrap. manifest .DefineScript("TheBlogTheme-vendor-bootstrap") .SetDependencies("TheBlogTheme-vendor-jQuery") .SetUrl("~/TheBlogTheme/vendor/bootstrap/js/bootstrap.min.js", "~/TheBlogTheme/vendor/bootstrap/js/bootstrap.js") .SetCdn("https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js", "https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.js") .SetCdnIntegrity("sha384-JjSmV6OrQ6VrjIEaF...", "sha384-rkSGcqMuXXwmdF/9eRLkw/gNZG+1zYut...") .SetVersion("4.3.1"); Deployment step for Open ID Server Head to Configuration -> Features and enable the OpenID Authorization Server module. Then you will get a new OpenID Connect option under the Security menu, where you can set up the authorization server, application, and scopes. If you set up the server in a way (the way how it's not important right now) you can import the settings of your server if you create a new deployment plan under Configuration -> Import/Export -> Deployment Plans. If you select the OpenID Server step, that will export all the Open ID Server settings. Just execute the deployment plan locally. After if you open the Recipe.json file in the zip you will find a section called OpenIdServer in the steps section. "steps": [ { "name": "OpenIdServer", "OpenIdServer": { "AccessTokenFormat": 0, "Authority": null, "CertificateStoreLocation": null, "CertificateStoreName": null, "CertificateThumbprint": null, "AuthorizationEndpointPath": "/connect/authorize", "LogoutEndpointPath": "/connect/logout", "TokenEndpointPath": "/connect/token", "UserinfoEndpointPath": "/connect/userinfo", "GrantTypes": [ "authorization_code", "refresh_token" ], "UseRollingTokens": false } }] In the specific content type list only allow the creation of the new content item of the selected type In the admin page, you have a Content Types submenu under the Content menu, where you can list all of the content items. If you click on one of those (for example the Article) there was a green New button where you can create any type of content item that is creatable. Now with a new improvement, the UI responds to the type of the selected content type and (if the Content Type is marked as creatable) you can create only a new content item of the selected type. Here you could see the green button has a text: New Article. New multi-tenant Orchard Core platform GovBuilt has over 30 years of government software experience. They worked with government employees, contractors, and citizens to build a best-in-class online solution that streamlines the permitting and licensing process. They offer a GovBuilt Platform built for Government. And they are using Orchard Core to build their solution! They have several tenants, and https://pottcounty.govbuilt.com/ is one of that! Demos Custom Admin Tree module with taxonomy terms menu You can find a new module in this repository called ThisNetWorks.OrchardCore.AdminTree and a new theme here, called ThisNetWorks.OrchardCore.Themes. If you clone these repositories and add them to your Orchard Core solution you will see a new module under Configuration -> Fetaures called ThisNetWorks Admin Tree Menus. ThisNetWorks Admin Tree module displays content items based on a URL tree or taxonomy structure. This module presents a taxonomy and it's associated terms in a tree menu. The primary purpose of this menu is intended to provide a way to manage complex taxonomies, in combination with a navigation system that makes manages those terms, and content items easier. Let's enable this feature! Now go Design -> Themes and make the ThisNetWorks Admin Theme as the current theme. This adapts the default admin theme to support the menu's on the left sidebar to include clickable entries on tree nodes (i.e. nodes that contain child items can also contain a link to an entry). To be able to test the current capabilities of this solution quickly, you can use a recipe (Configuration -> Recipes) called Categories, that contains sample content items and taxonomy for a taxonomy menu tree. After you run this recipe you should see the following admin menu structure. Here you can see a Categories option with several sub-items. Categories is a taxonomy with the Category term content type and this admin menu shows you the structure of the Categories taxonomy in a clickable way. For example, if you select Motorbike, the site lists you all the content items that have this taxonomy and the category of that is Motorbike. If you click on the blue Create Leaf Article button you can create a content item that has a permalink and the Categories taxonomy will be set to Motorbike by default. Let's see what will happen if you click on the View button near the Articles content item, that is the root term content item of the Categories taxonomy. As you can see, users in the front-end can navigate between the different levels of terms and when navigating between the different content items, you can use different kinds of badges to show the terms and of course, the URL reflects this change as well. This feature is under development and we hope that this will be part of Orchard Core soon! If you are interested in this demo don't forget to check this video on YouTube! On Lombiq Orchard Dojo Newsletter Now we have 108 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!

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!

This week in Orchard - 12/13/2019

Improving user management by having a way to log in users without password during external login and be able to disable users in Orchard Core. Brand new look for the Flow editor UI and fix the accessibility issues in your Orchard Core site using Accessibility Insights for Web! Oh, and our improved Avatars Orchard module is waiting for you in our post! On Orchard Core External Login registration without password Navigate to Login Settings page by heading to Security -> Settings -> Login from the admin UI. Here you will see a brand new page with several options. Let's see what are these for! Use external provider for login: if only one external provider is defined and this option is checked, the external provider is automatically challenged. Disable local password login: prevents users from logging in with their local credentials. Only external providers are displayed in the login screen unless the above option is set. Use a script to set user roles based on external provider claims: if checked, the above handlers are not invoked and instead the script executes. Here we have to mention the IExternalLoginEventHandler interface, with the UpdateRoles and GenerateUserName methods. Any module can define logic to perform the mapping and generate usernames. And take a look at the UserLoggedInEvent workflow event too! The event is triggered after the above logic and provides the username, the roles, the login provider and the external claims as Input. If the login was for the local users, the login provider and the external claims are null. If you enable the Users Registration module you can find a Registration Settings page under Security -> Settings -> Registration. Let's see what you can set on this page! Configure users registration: define if new users are allowed to register. Use a script to generate userName based on external provider claims: if not selected, when a new user is registering, the registered IExternalLoginEventHandlers are invoked in order to provide a username. If more than one handlers are defined, the first one wins. If you use a script to generate the userName, the above handlers are not triggered. Do not ask username: if checked, no user name is requested in the registration form. Do not ask email address: if checked, no email address is requested in the registration form. Do not create local password: if checked, no password is requested in the registration form. If all of the above is true, no registration form is displayed to the user. Disable a user account Now you have the ability to disable a user account. When you navigate to Security -> Users and hit Edit near one of the users, you will see a new Is enabled? switch that you can uncheck to disable the given account. Now when you list the users you will see a little red badge with a Disabled text near the user that is disabled. But what that really mean? With a disabled account, users can' log in to the site. If they want to log in they will face the following error message. New blog post: Orchard Core, Open ID, and GraphQL Sipke Schoorstra published a new blog post about how to invoke Orchard Core’s GraphQL API endpoint using Postman. His objectives are to: Expose a GraphQL endpoint from Orchard to allow content querying. Invoke the GraphQL endpoint from a client application. This could be plain vanilla JS, Angular, React, Blazor, and so on. He's just gonna use Postman to try out the GraphQL endpoint. Once that works, he can do it from any other client application. Read his post for a long and interesting journey to learn about these features! New Orchard Core site Borne out of a passion for travel, and a belief that bridging cultures can only happen with global mobility, flyEgypt started operations in 2015 as a small but ambitious charter airline. Their website is now live, including a comprehensive help center and online booking and payment functionality. And they are using Orchard Core! 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. Demos Flow editor UI improvements Set up your site using the Blog recipe. This recipe contains a Page content type with an attached Flow Part. Let's create a new page using the admin UI. Here you will see a brand new UI when editing the Flow Part of the page. You will see a blue line with a plus sign and an arrow of the center of it. Clicking on these you can add new widgets to your Flow Part by choosing them from the context menu. If you hover over your newly added widget you can set the alignment and the percentage of the item just like you can do it before. If you add a new widget that can contain other items (for example a Container) you can hover over the body of the widget and use the blue line inside it to populate it with other new content! You can also watch a great detailed demo on YouTube about the Flow editor UI improvements. Find and fix the accessibility issues in your Orchard Core site using Accessibility Insights for Web Accessibility Insights for Web is an extension for Chrome and Microsoft Edge Insider that helps developers find and fix accessibility issues in web apps and sites. The tool supports two primary scenarios: FastPass is a lightweight, two-step process that helps developers identify common, high-impact accessibility issues in less than five minutes. Automated checks: the tool automatically checks for compliance with approximately 50 accessibility requirements. Tab stops: the tool provides clear instructions and a visual helper that makes it easy to identify critical accessibility issues related to keyboard access, such as missing tab stops, keyboard traps, and incorrect tab order. Assessment allows anyone with HTML skills to verify that a web app or web site is compliant with Web Content Accessibility Guidelines (WCAG) 2.1 Level AA. Automated checks: the tool automatically checks for compliance with approximately 50 accessibility requirements. Manual tests: the tool provides step-by-step instructions, examples, and how-to-fix guidance for approximately 20 tests; many tests are "assisted", which means that the tool identifies the test instances or provides a visual helper. If you add this extension to Google Chrome, you will see a new dark blue heart icon with a magnifying glass at the right top corner of your browser. If you click on it and select the FastPass option, you can check for common issues of accessibility. If you try it on the admin page, you will see some red exclamation marks that show you some common accessibility problems such as missing or invalid properties. For example, you could see a message that Buttons must have a discernible text. If you click on one of those red exclamation marks you will get a longer explanation of what is the issue with the given item. It says fix one of the following from the list and there are many ways to fix the issue. The issue is that we have a little expand here, which is a button without a text. If there is a button without a text, people with disabilities would not be able to see what the button does, so we need to fix that. Let's use the aria-label attribute to fix the issue. <button class="btn-nostyle" aria-label="expand"> <span class="collapse-icon"> ... </span></button> By going through these failures you can detect and fix the accessibility problems on your site. You can also watch a great detailed demo on YouTube about how to use the Accessibility Insight for Web in your Orchard Core application. On Lombiq The first Orchard Nuggets post Instead of lengthy tutorials short question-based blog posts on Orchard Dojo about solving specific Orchard problems can be very useful for community members as a learning resource. An Orchard Nuggets blogpost's topic is a single question on how to achieve something in Orchard (be it 1.x or Core) and it focuses solely on an answer to this question. The topic can be not just about development questions but user-facing features too. In our first post, we wrote about how to register your content part in the service container. We have many topics to write about but we are happy if you'd have questions about Orchard and Orchard Core that we can write about! Improving our Avatars Orchard module The aim of our Avatars Orchard module is to bring avatars to the platform. This week we have added two new features to this module: Piedone.Avatars.Blogs: adds Avatars to Blog Posts in Detail view. Piedone.Avatars.Comments: adds Avatars to comments from logged in users. If you enable both of them, the Avatar Part will automatically be attached to the Blog Post and Comment content types to present the avatar of the author user if any. We updated this module in Orchard Dojo too, if you check the screen of the first Orchard Nuggets post you will now see the name of the author and the avatar of the author under the title of the blog post. Thanks for the great contribution to Gábor Pór from Lombiq Technologies! Orchard Dojo Newsletter Now we have 108 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!