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 - 04/19/2019

In our post we review the happenings after the Beta 3 release, then head to the open pull request of Orchard Core and see what will be merged soon, that will be available for the next release! On Orchard 1.x Style.Include and Script.Include register the wrong resource key in debug mode When you are injecting resources using the Script.Include or the Style.Include methods, you have to pass the debug version for the first parameter, and the release version for the second parameter. Let's see the following code: Script.Include("webfont.js", "head.deferred.min.js").SetAttribute("defer", "").AtHead();Script.Include("jquery-migrate.js", "head.deferred.min.js").SetAttribute("defer", "").AtHead();Script.Include("slick.js", "head.deferred.min.js").SetAttribute("defer", "").AtHead(); We have 3 separated js files that will be bundled when compiling in release, as a single js file but we want to render them as separated js files when developing/debugging. The ResourceManager.Include method registers the webfont.js as head.deferred.min.js causing the other files (jquery-migrate.js and slick.js) not to be rendered because they use the same key of webfont.js. The ResourceManager.cs has a virtual RequireSettings method, where we return the following value: resourcePath = FixPath(resourcePath, relativeFromPath);resourceDebugPath = FixPath(resourceDebugPath, relativeFromPath);return Require(resourceType, ToAppRelativePath(GetResourceKey(resourcePath, resourceDebugPath))).Define(d => d.SetUrl(resourcePath, resourceDebugPath)); Where a new method, called GetResourceKey has been introduced to decide when we need to return the release or the debug path of the requested resource. Now there is an issue in Orchard Core too, to do the same thing when injecting resources in this way. On Orchard Core Docker images If you navigate to the Docker Hub of Orchard Core you can download the updated docker images. Here you can see that the Windows version of Orchard Core has more than 5.0K downloads and the Linux version has more than 10K downloads! Both of the images have the following supported tags: latest: The latest public release 1.0.0-beta3: The latest release of 1.0.0-beta3 dev: The current development branch NuGet packages If you visit https://www.nuget.org/ and search for orchardcore, you will find a new package called OrchardCore. This is a new package, which is only available since Beta 3. You will see there are two packages because we merged on master and later on a new tag for beta 3 has been created to know which commit was Beta 3. And by creating a tag, AppVeyor restarted the build and republished everything on NuGet. We could change AppVeyor script to do not deploy or build on tags, just on commits on master. The YamlDotNet is still a dependency for Orchard Core Beta 3, but we do not use it anymore. In the next version it will be removed, we just kept it for the migrations from Beta 2 to Beta 3, because we convert all the YAML files to JSON and we still need YAML for the conversion. Open Pull Requests When you navigate to Orchard Core's GitHub page and check out the open PRs, you will see that there are currently more than 50 open PRs waiting to be merged to the dev branch. The reason for being as many open PRs is that these branches containing quite huge changes and by merging these into the dev branch could break some features of the framework. By being careful, we thought it would be better to merge these PRs after Beta 3 has been released. Now the Beta 3 is out, so it's time to merge these pull requests to dev branch! Let's see some of these! Add custom Widget styles and classes with Flow After this PR will be merged you can customize the classes and the styles for each widget in the flow. Technically, this PR provides Classes and Styles fields in the FlowMetadata on a Widget for users to add custom classes and styles to the widget container. Features matrix A list of features of Orchard Core, so people don't have to look for the available features and the ones that are currently in development or excepted for an upcoming version of Orchard Core. It could be good if they compare Orchard Core with other CMSs. Add user avatar to the admin site This PR is about to add the avatar to the top right with the name of the currently authenticated user. It could also be interesting to have a Liquid filter to generate a Gravatar. RTL support for TheAdmin theme This PR is using a Gulp pipeline that will convert the admin.css into RTL, by switching all the left margin to right margin and so on. In this week there was an article about how Spotify implemented to support Arabic. They used a similar technique, but not using the same pipeline from the PR, they used PostCSS-RTL in their build step. It's the same process, but with a different library. It looks like this one solves the part of the issue that exists in the PR. It's not replacing the existing CSS, but extending it with more rules that are specific for RTL. It's one CSS which will adopt the look and feel based on RTL or not. It will let us do it automatically for any CSS that we want to instead of manually specify which CSS we want to include. On Lombiq Orchard Dojo Newsletter Now we have 58 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! 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 - 04/12/2019

There was no Orchard Podcast this week, but we have lots of news around Orchard Core and the Orchard Core Beta 3 release! On Orchard Core Updated website for the Orchard Core Beta 3 release The community has been developing Orchard Core for more than 3 years now, but the official website of Orchard hasn't provided much information about Orchard Core. For the Beta 3 release, orchardproject.net got a huge update to focus on Orchard Core instead of the Legacy CMS. However, if you are interested in the 1.x of Orchard, you can still reach the old page by clicking on the Legacy Orchard option from the menu. In the new page, when you click on the Try Orchard button, you will be navigated to https://try.orchardproject.net/, under the Getting started section you can try our Docker images, and the Portfolio is also filled with websites created using Orchard Core. In the Features section you can see we mentioned that you can use Orchard Core as a full, decoupled, or headless CMS and thanks to ASP.NET Core, you get one of the fastest CMS solutions you have ever tried on any OS (Windows, Linux, MacOS). Visit orchardproject.net now! A new website using Orchard Core California School Information Services has a website which runs on Orchard Core! Check out this site to see the loads of capabilities that you can achieve using the CMS. 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. Customize Login and Registration pages in Orchard Core CMS A few weeks ago we wrote about Orchard Core now allows theming for Login/Registration/ResetPassword screens. In this post, David Hayden wrote about how to display the login and registration pages using the active site theme. If you have created an Orchard Core CMS site using The Blog theme, you could see what the Login Page looks like now with the setting enabled. We see the consistent header, footer, and copyright of the site theme along with the login form. Normally it's just a login form. Custom Admin Menus in Orchard Core CMS One of the new features in The Blog Theme and its setup recipe is the use of the Admin Menus module to add custom menu items to Orchard Core's Dashboard. In this post, David wrote about how he changed the admin menu using the Admin Menus module. Portfolio Widget - Orchard Core Theme Development In this post, David wrote about which new features of Orchard Core he used to build a new portfolio widget for his themes using the liquid template language instead of Razor, where you can create, modify and override templates in the Orchard Dashboard using the Templates module. Orchard Core Blog Recipe and Running Custom Recipes Orchard Core Themes come with a setup recipe, but an Orchard Core CMS Developer is not limited to setup recipes. There can be custom recipes that are part of the theme or module that are not setup recipes and add functionality on-the-fly. Read David's post about what you can achieve using separate custom recipes that can be run on demand. Create an Orchard Core CMS Website using Orchard Core Code Generation Templates The Orchard Core Code Generation Templates that work with the .NET Core CLI make it really easy to create a website, Orchard Core Module, Orchard Core Theme, and even a modular .NET Core MVC Website. Here is a quick Orchard Core CMS Tutorial that shows you how to create an Orchard Core CMS Website. Modern Business theme Last September we had a demo about how to create a decoupled theme based on the Modern Business one. Thanks to Sijmen Koffeman the theme for Orchard Core is available in this repository. To use this theme in a solution that uses the full Orchard Core source (not NuGet packages), you have to do the following set up, after copying the source to your themes folder: Add this theme as an existing project to your solution. Reference ModernBusiness to OrchardCore.Application.Cms.Targets project. Remove the referenced NuGet packages and add them as a ProjectReference. Now head to the admin site and make this theme as default. When you set up your site using The Blog recipe and open a blog post, you will see your blog post as in this screen: You can also take a look at Start Bootstrap's Modern Business Theme for Orchard Core as a decoupled Razor Pages Module. On Lombiq Orchard Dojo Newsletter Now we have 57 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 - 04/05/2019

Orchard Core Beta 3 is here! Read our post about the latest improvements of the new release and a way about how we could store static media files in the future using Orchard Core! On Orchard Core Orchard Core Beta 3 release We are proudly announcing that the community shipped Orchard Core Beta 3 release! Head to the GitHub page of Orchard Core to download the assets of the new release, where you can also find the list of changes for this release! Fixing DataAnnotations localization Using the PO file string localizer, users can't localize data annotations. When you have a model with some Required or DisplayName attributes, the value of the Error Message will be translated automatically using the StringLocalizer. In Orchard 1.x it never worked, but in Orchard Core, it supposed to work because it's using the correct service for translating which Orchard implements. The IStringLocalizer is created by a StringLocalizerFactory. The question is should a StringLocalizer know about the culture supposed to render or is it when we call _localizer.GetString that we should check what is the current culture? Our assumption was that the localizer should be localize for a specific culture because it had a method called WithCulture to return a new one for another culture. But actually, it's not working in this way. In our case is that we were creating a localizer for the current culture (like English, because it's our default), then we go on a page for Spanish, and it will still reuse the same localizer. Now we do the culture resolution when the GetString is called on the instance. It worked in the case of views, because the views get a new StringLocalizer instance every time they rendered, but not when the attributes are evaluated. It's important because this package is not just for the Orchard Core Framework or the CMS, it's a NuGet package, that anyone can use to localize their ASP.NET applications based on PO files. We support pluralization and dynamic PO files too. How to create Media content items in Orchard Core? In Orchard Core media are not content items, they are just files with a path. The Media Field is just a list of path to a file that is handled by the media storage. Most of the time we don't need a content item for the media. It's faster to store just the path and then to load the content item to store the data and render an image. But we can have Media content items by just create a content type (call it Image, Video or whatever) and attach a Media Field to that. Then you can have content pickers on your other content items to select this kind of media. Localization files guide Last week we wrote about that the new localization guide has been added to Orchard Core documentation. And we have good progress on some translations! As you can see, the Arabic is over 40%, the Chinese more than 80% ready! And we have just added the Orchard Core project to Crowdin! The documentation just has the dev version Now when you visit the ReadTheDocs page of Orchard Core, you will not see the option to read the latest or the dev version of the documentation, only the dev version is available. There can't be any misunderstanding about which branch you are targeting, we always show the latest branch (dev branch), and if we have documentation that only relates to the dev branch, we should make some notes in the documentation to say this won't work with the master. Improve the create button on List Part When you have only one content type attached to a List Part, then instead of having a drop down to select it, there is a button to create the given content type. Storing static Media By using the IFileStore, you can get files, store documents into a file store, etc. The IMediaFileStore implements IFileStore and provides two additional methods: MapPathToPublicUrlKnowing a path for media (like /images/thumbnail.png), this method will return the public URL that we need to render when we render a media. This file store can serve the correct media when it's requested. It's a bridge between an HTTP request to the file that is contained by the store. The default one is using the file system implementation (the folder), so it's just saying whenever you want to access /images/thumbnail.png, it will return /media/images/thumbnail.png. MapPublicUrlToPathThis is the opposite. When we have a public URL, can you guess which image it will present? This is done for a very specific reason. If we have an Azure Blob Storage, we want to render not the local path to the image, but the path to Azure Blob Storage. When we have an image to the media manager, it will store the image for example on Azure Blob Storage and then when we get the path for this media from a content item we need to find what is the public URL of this media in Azure. So the custom implementation for Azure Blob Storage will return http://mystorageaccount.blob.core.windows.net/mycontainer/myblob. The next step would be to remove the whole IMediaFileStore interface. Therefore we don't have to care about where publicly the media is accessible.What about serving the Blob Storage from our web server? When we go in /media/myimage.png, the path will be: "myimage.png". In case of an Azure Blob Storage, the public URL will be http://mystorageaccount.blob.core.windows.net/mycontainer/myimage.png. This is the URL, where the browser finds the image. When /media/myimage.png is requested, Orchard will download the blob (corresponding to that from Azure, and either render it directly on the request or save it as a cache locally) and serve it for the next request without having to ask for Azure. In terms of perf, it won't be slow and it opens other possibilities: 1. Resizing images If we do a resize, we could use the following URL: http://mystorageaccount.blob.core.windows.net/mycontainer/myimage.png?width=123 But this won't work, because if we do something like this, the server of Azure doesn't know about ImageSharp or whatever. This thing can only be done if we server the image by ourself. To be able to resize images, we need to process them, that means we need to load them and serve them not from a public URL. 2. CDNs Content Delivery Networks are local caches of the files we request. Some people use Azure Blob Storage because they want CDNs. But we can use CDNs even for our local images. The idea is to use CDNs even for Blob Storage. We could say that yes, we have Blob Storage, but just for storage, it's not for serving the images. We could also make it completely private, so nobody can access our Azure Blob Storage. It's the Orchard web server that will download the media, serve it in a way (/media/images/thumbnail.png) and if we have a CDN, then the CDN itself is responsible for asking us for the media (which will download from Blog Storage, so it will be slower for the first time), but then every time the users will hit the CDN, then they will get the image from the CDN, not from us. We won't even serve the image. Instead of having an interface, that gives us a public URL, every time we render a media is to have a configuration setting with the public CDN prefix for media files. In this configuration, we would define //myownsite.azurecdn.com. What you would do is configure Azure CDN to be a CDN on your website which is mywebsite.com. And whenever we render a media file, we would prefix the URL with that. The browser will ask the CDN for the resource, which will itself ask our site for the resource and then get the blob storage thing. We serve it, that means it will be resizeable, even with a CDN. If we make a request like //myownsite.azurecdn.com/foo.png?width=123, it will request that on our server, so we can resize everything. That would work with any CDN, like Azure CDN, Akamai, Horizon, CloudFlare, etc. Another option is to add a configuration setting with public CDN for resources. When we define a resource, we can set the debug version and the minified version, and also the CDN version. And we also have a setting to say I want to use a CDN version of my resources instead of the local ones (if they are available). We could also be able to set the CDN prefix for these files too, and then they would be also cached by a full CDN and the site would be much faster. However, we need to purge ImageSharp cache automatically with some thresholds. If we cache media items, need to have a way to purge. That's doable because every time we store a media we can store how much data we already stored like in a file that is also on the file system. There are many ways to do that. There is a website using the Blog recipe under sebastienrosdotcom.azurewebsites.net. It's hosted on the east coast, if we look at the Network tab using Google Chrome Developer Tools, it takes about 150 ms to render the page in Hungary, plus the static files, which are either in CDN or loaded by Orchard Core. Seb enabled the CDN and mapped this website to cdn.sebastienros.com. In the first time, it will be slower, but after if you hit F5, it takes less ms. On Lombiq Orchard Dojo Newsletter Now we have 56 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! 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!

Dojo Course will start very soon!

UPDATE (2017-11-22): Dojo Course 2 is released with new, updated videos! First of all thank you all for the enrollments into the Dojo Course! It's great to see you wanting to deep-dive into Orchard! (If you enrolled and haven't received a confirmation, don't be afraid: we don't send confirmations not to clog your mailbox. If you sent the form you'll all set.) So the Course starts in just a couple of hours now! This week we already had the second lesson on the university, so there are two tutorials in the tube. Enroll now if you'd like to and keep an eye on Orchard Dojo!

Dojo Course opened! Learn Orchard with us!

UPDATE (2017-11-22): Dojo Course 2 is released with new, updated videos! Our new free and open online Orchard course Dojo Course just opened! Do you want to learn how to use and extend Orchard from the ground up? Would you like us to review what you create and help you to make it better? Enroll in the course and join us for a semester of Orchard!

The Orchard test instance updated in Dojo Library

We upgraded the Orchard test instance in the Orchard Dojo Library to version 1.7. Also the Training Demo module got a corresponding update and since the Orchard Mini Profiler is now compatible with the latest release we updated that in the solution as well.

Orchard Dojo opened!

What Orchard missed till now is a place where the various pieces of knowledge related to it are stored in a structured, accessible form. We aim to provide a solution for this with Orchard Dojo: a website dedicated to learning Orchard. On Orchard Dojo we want to gather all the information related to Orchard in a well-structured and well-presented form so nothing worth while gets lost. We also created the Orchard Dojo Library, a nice big package of various Orchard goodies, including development guidelines and best practices, a wiki, Visual Studio code snippets and more. Also with Orchard Dojo we'd like to bring our Orchard trainings what we've done through Orchard Hungary to the next level. We really hope you'll learn a lot on Orchard Dojo!