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 >

This week in Orchard - 08/09/2019

Getting closer and closer to the release of .NET Core 3.0 and Orchard Core RC! What do we need to ship the new version and what are the newest features of Orchard Core? Find out now! On Orchard Core Updating YesSql In SQL server it was not working correctly if you pass the parameter as the limit value. You can do SELECT * FROM FOO @limit, where the @limit is the parameter. That will be converted to SELECT TOP @limit FROM FOO in SQL server, but that doesn't work. When you use a variable like this it needs parenthesis. Now every time when we render it in YesSQL, it's in parenthesis: SELECT TOP (@limit) FROM FOO.You can also find a xUnit test in the SqlParserTests.cs file, where the parameters of the InlineData attributes are also using parenthesis. Ability to extend/clear ContainedContentTypes Now if you want to update the ContainedContentTypes of the Container Part then you can do that. Before that, if you add a type it removes the old one. Now you can choose to merge it with the existing one. And by using the ClearContainedContentTypes extension method, you can also clear the ContainedContentTypes. Remove JSON specifier from GraphQL MD code blocks The documentation used the JSON highlighting for the GraphQL queries, which is the closest to a GraphQL query, but it's wrong. It could show some wrong colors, so now it's just doing nothing. A GraphQL query is not a JSON payload, just the result of the query. .NET Conf 2019 There will be the .NET Conf next month, which is a 3-day virtual developer event co-organized by the .NET community and Microsoft. Sébastien is submitting a talk about Orchard Core modularity and multitenancy. We hope that he will able to get a talk! On these days they launch .NET Core 3.0, which is the 23rd of September. A plan is to ship Orchard Core RC on the day after the .NET Core 3.0 and the builds are available. Upgrading an Orchard Core site that using .NET Core 2.2: it's non-breaking in terms of database or recipes and everything. We are just upgrading the APIs from 2.2 to 3.0. So, in theory, if we take a site that has been built with 2.2 and we just upgrade to the branch that using 3.0, then it should not change anything. The only thing it should change hopefully is the performance of the site because .NET Core 3.0 is much faster and use less memory than 2.2. The image of .NET 3.0 will also be available on Docker. To ship Orchard Core RC, we only need to have finalized all the things for localization. We have most everything we need, instead of the field syncing. Let's have a look at our Roadmap! You can see that everything is implemented from the backlog. Adding more localization packages will not be that hard, the repositories are already done for these packages. And we have PRs for almost every bonus features that listed in the roadmap. We also need to focus on every issue in GitHub that marked for RC and has a priority tag on it. A new website using Orchard Core Patient Access connects you to healthcare services when you need them most. Book GP appointments, order repeat prescriptions and explore your local pharmacy services. This site is running on Docker for Linux on Azure as an Azure Docker Service on Linux. It's based on GraphQL. For example, when you navigate to Pharmacy services and searching for healthcare services, then it's GraphQL. If you search for Hay fever treatments and using S66 as the postcode, the results that you got is returned by GraphQL. 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. On Lombiq Orchard Dojo Newsletter Now we have 88 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 - 07/12/2019

Lots of new features and improvements and a very interesting demo about the Content Culture Picker is waiting for you in our current post! Oh, and of course our Orchard Core Training Demo Module has got a huge update too! On Orchard Core Set Content Types during Azure Blob creation When uploading a file, for example, a PDF into Orchard the Content Type is set to "application/octet-stream" on the Azure Blob when it should be "application/pdf" (this is the content type that Azure itself picks when you upload a PDF directly). Now Orchard Core has the fix that sets the blob properties during creation. Improve ImageSharp Middleware Processing Speed Because /Media is a well-known location we could improve the processing speed of the ImageSharp middleware and reduce the allocations it makes on every request. At the moment the MediaFileProvider returns IsValidRequest which is the first opportunity for ImageSharp to drop out of the processing pipeline. The first check in IsValidRequest checks for a valid image extension in the URL using Request.GetDisplayUrl(). If we check Request.Path for contains Media first we can bypass all the allocations from Request.GetDisplayUrl() and _formatUtilities.GetExtensionFromUri(...). Let' see the MediaFileProvider now! The IsValidRequest method here first checks that the first segment of the path is equal with the Startup.AssetsRequestPath. The AssetsRequestPath contains PathString("/media"). Add grouping of widgets to their site layer The GraphQL siteLayers query enhanced to group widgets into their layers. In the following screen, you can see that there are two widgets in the Always layer and one on the Homepage layer. Add PathBase PathBase may contain a virtual folder and, before the execution of the tenant pipeline (e.g. when executing a middleware configured at the app level), it doesn't contain the tenant prefix yet. PathBase = /{virtualFolder} - Path = /{tenantPrefix}/somePath// If no value => {}, converting the PathString to a string results in an empty string. Then, when we are in the tenant pipeline (e.g. when executing a middleware configured at the tenant level e.g. by a module), the tenant prefix (null for the default tenant) has been moved to the PathBase. PathBase = /{virtualFolder}/{tenantPrefix} - Path = /somePath In some contexts, we don't have to care about this e.g. when using the URL helper for an action, but here, how we build URLs, this is not the case. So, here it was not working under a virtual folder, the fix is to use PathBase but without reusing the tenant prefix. _contentItemlistUrl = httpContextAccessor.HttpContext.Request.PathBase + "/Admin/Contents/ContentItems1/";var formActionWithoutTypeName = Context.Request.PathBase + "/Admin/Contents/ContentItems"; LocalizationSettings recipe step documentation The Localization section in ReadTheDocs of Orchard Core has been updated with how to add cultures with recipes using the settings step. Demos Content Culture Picker When you enable the Content Culture Picker module, you will get a culture picker shape for the frontend. The Content Culture Picker module helps you manage cultures for the frontend. This uses a dropdown listing all the supported cultures and you select which culture you want to see when you are on the website. The Content Culture Picker selects the URL to redirect to like: if the ContentItem has a related ContentItem for the selected culture, it redirects to that Item if a HomePage is specified, finds the ContentItem that is set as the Homepage and attempt to find a Localization of this ContentItem for the current culture or a NotFound() page Let's see how it works! To create localizable content items, you have to enable the Content Localization module. This module will provide you the LocalizationPart, that you can attach to your content type. For the sake of the demo, we set up the site with the Blog recipe and attached the LocalizationPart to the Blog Post Content Type. Then head to Configuration -> Settings -> Localization to add more supported cultures. Now head to the editor of a content item that has LocalizationPart attached and save or publish it. You can see that our default culture is English and we added 3 other supported ones. If you click one of the cultures, the localized version of the content will be created. We created slightly modified blog posts for each culture to be able to see the differences between them. Now it's time to use the Content Culture Picker! You can find detailed documentation on ReadTheDocs about how to use the picker and what shapes are available for the frontend theme. For now, let's just simply modify the Layout.liquid file of the TheBlogTheme and using the liquid syntax, use the shape shape tag to create and render the ContentCulturePicker shape. We added a white background behind the picker to see it better. Now if you visit one of the blog posts you can switch between them using the content culture picker. On Lombiq Orchard Core Training Demo Module V2 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. Now, this module has got a huge update with new tutorials: permissions, admin menus, site settings, caching, file management, background tasks, and VueJS! In the StartLearningHere.md you can find all the training sections to easily navigate to the topic that you are interested in. Orchard Dojo Newsletter Now we have 78 subscribers of the Lombiq's Orchard Dojo Newsletter! We have started this newsletter to inform the community around Orchard with the latest news about the platform. By subscribing to this newsletter, you will get an e-mail every time when a new post published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who you think would like to read our weekly articles? Tell them to subscribe here!

This week in Orchard - 06/28/2019

New queries for GraphQL to return all the configured layers and their widgets and to have access to the site's configured culture settings, and other smaller changes and fixes for Orchard Core are waiting for you in the current post! On Orchard Core Package.json or package.json? If you are using Orchard Core in a Windows environment, you should not to be worried about you have a Package.json or a package.json file. But if you run npm install for example on a Linux operation system, this command will fail because Package.json had the wrong case. So, instead of Package.json, you should call your file to package.json to work with every environment. WYSIWYG editor converts <div> to <p> tag Orchard Core uses Trumbowyg, that is a lightweight WYSIWYG editor when you would like to create a new content item using the dashboard. By using Trumbowyg, you can view and edit the HTML source too. When you edited the source and used <div> tags, the <div> tags automatically converted to <p> tags. In the trumbowyg.js file, you can find an array, called DEFAULT_SEMANTIC_MAP. Semantic generates a better, more semantic oriented HTML (i.e. <em> instead of <i>, <strong> instead of <b>, etc.). Since 2.12.0 you can also put an object to customize the semantic tag mapping for each one of these tags: <b>, <i>, <s>, <strike>, <div>. The issue was in this map, the <div> was converted to <p>. Now it has been fixed. Top Open Source Asp.net Core Content Management Systems (CMS) DotTutorials was developed to give .Net Developers a place to find step by step solutions for their coding problems. They plan to provide the solutions of some of the common & unique programming problems with complete source code for educational & commercial purposes, and in addition, helping developers stay up to date with the latest DotNet Libraries. They have an article in which they list down some top Content Management Systems (CMS) available for .Net Core Developers. And as you can see, Orchard Core is in the list too! Creating an Orchard Core .NET Core Project From Scratch Hofmeister Christian wrote a blog post about how to create an Orchard Core project from scratch. In this guide, he shows how to set up a custom Orchard Core CMS Web Project. He wrote the blog post in German, so if you speak this language, head to his site and read the post! Implemented siteLayers GraphQL query You have a new query that will return all the configured layers and their widgets. This could be useful for defining header/footer content on GatsbyJS or similar sites. Let's see how you can use it with the GraphiQL Explorer! You can see that you can get the description, the name and the layer rule of your layers. If you place widgets in those layers, you can get the details of them too! Using siteLayer you can create more complex queries like: query LayersQuery { siteLayers { description name rule widgets(status: DRAFT) { widget { contentType ... on Markdown { markdownBody { html markdown } } } position renderTitle zone } }} Implemented siteCultures GraphQL query If you use the siteCultures query, you can have access to the site's configured culture settings. We defined 4 supported cultures and made the Hungarian as the default. Now let's run this query using the GraphiQL Explorer! You can see that the default shows that the Hungarian localization is the default one. On Lombiq Orchard Dojo Newsletter Now we have 76 subscribers of the Lombiq's Orchard Dojo Newsletter! We have started this newsletter to inform the community around Orchard with the latest news about the platform. By subscribing to this newsletter, you will get an e-mail every time when a new post published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who you think would like to read our weekly articles? Tell them to subscribe here! There will be no 'This week in Orchard' post next week because of vacation, so see you in two weeks!

Checking your infoset data consistency after upgrading from 1.x to 1.8+

Many Orchard developers, including ourselves act as early adopters of the Orchard source and use the code from the 1.x and other work-in-progress branches. While it gives us the opportunity to try the new features and get the latest bugfixes, some changes introduce important bugs every now and then. That was the case lately on the 1.x branch, when a problem surfaced regarding the infoset storage: for shifted, versionable content parts the infoset data was not saved in the ContentItemVersionRecord table, but into the ContentItemRecord table instead. Sébastien discovered this issue before 1.8 release and provided a method to fix it. At this moment, we are in the middle of upgrading all our sites to Orchard 1.8+ (+ means we are running 1.x, of course) and after careful testing in our local and staging environments we'll soon hit the big red button to make it go live: every Lombiq-related website will run on the latest source, that includes every DotNest tenant too! While upgrading your sites and testing the fix for the infoset storage, you may need to check if your data was really restored to its desired state, so here's a little help: below is an SQL-script that you can run against your DB, which checks if there's any corrupted infoset entry left, so you can verify if the upgrade mechanism worked. USE [MyDatabase]GOSELECT Item.Id AS ItemId, VersionItem.Id AS VersionItemId FROM [dbo].[MyPrefix_Orchard_Framework_ContentItemRecord] AS Item INNER JOIN [dbo].[MyPrefix_Orchard_Framework_ContentItemVersionRecord] AS VersionItem ON Item.Id = VersionItem.ContentItemRecord_id WHERE VersionItem.Latest = 1 AND VersionItem.Data IS NULL AND Item.Data IS NOT NULL ORDER BY Item.IdGO Happy upgrading!