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

Featured tags

IIS
API
SMS
All tags >

This week in Orchard - 04/26/2019

There was no Orchard Podcast this week, but we have lots of news around Orchard Core and new PRs that will be added to Orchard Core soon! On Orchard Core The Arabic translation for Orchard Core is ready A few weeks ago Hisham Bin Ateya and Abdullah Salem have started to work on the Arabic translation for Orchard Core. Thanks to their hard work, the Arabic translation is now ready! This is the second language that has been completed after the French language, which is the main language for many of the core team. Now it's time to test those translations! Order TimeZone list by name When you would like to set the default time zone for your site under Configuration -> Settings -> General you had to select the preferred timezone from a list that wasn't ordered. Now thanks to this PR you can set the value of the time zone using a list that contains ordered values. New user created event and assign user to role task to workflows Soon you can use two brand new activities when constructing your workflows in Orchard Core. The first one called User created, which is surprisingly fired when a user created. The second one is about assigning a role to a user. Let's say we attached this task after the user created event. In this case, when you edit this task, you can say that assign the Authenticated role for the user that has been created just now. In the following workflow, we do the following and show success or failed notification just for demonstration purposes. GitHub authentication Thanks to Michael Petrinolis when this PR will be merge, you can authenticate yourself in Orchard Core using GitHub, by adding this provider to the list of supported external providers soon. Let's see how this feature will work! First, you need to create a new GitHub App. To do that, head to the GitHub Apps page in the Developer settings and hit New GitHub App. Here you need to provide the name of your GitHub app, the full URL to your GitHub App's website and a user authorization callback URL. Don't forget to generate a private key. After you will get a Client ID and a Client secret. You will need them in the next step. Now you can navigate to Orchard Core admin site and enable the Github Authentication feature. After that, you can notice the Github Authentication option under Github in the menubar. Copy your values here and hit save. Now let's open a new incognito window and navigate to the admin page. Here you can see the GitHub, as another service to log in. Provide the username and the password of a GitHub account to sign in. Now Orchard Core asks you to create a new account based on the user information you have just provided in the previous step. If you click on Register your user account will be created in Orchard Core and you will be able to log in using your newly created account. For note, let's see what happens if a user tries to login with an external provider, and registration is enabled: If the external provider provides an email claim, we search for an existing account with that email. If not found, a new OC Account is created based on the username, email, and password provided by the user. If found, we request the password of the OC Account in order to link the external login. There is a PR that takes into consideration the email must confirmed parameter, if we request a password in order to create a local Account from external login, and also uses the ReCaptcha. There is a front page (OrchardCore.Users/Account/ExternalLogins) where you can link/unlink OC account with external providers. Of course, is not complete, we must decide how this is integrated with profile/account info in admin/front end. Regarding the GitHub, you must select to use your email in public and select which one of the verified emails will be included in the claims. External Login registration without password As you noticed in the previous section when you create a new account using an external login provider you have to provide a password to create the user account in Orchard Core. There is a PR to add a setting to register external users without requesting a local password. In this PR, Michael Petrinolis also implements the way to generate a username instead of parsing claims from external login info and to integrate ReCaptcha in External Login Registration. Facebook module OrchardCore.Facebook provides the following features: Core Components Facebook Login First, you need to enable the Users Registrations module and put a tick in the Users can create new accounts on the site checkbox under Configuration -> Settings -> Registration, because we will create a new user account based on the details provided in the Facebook log in page. To register the Facebook App with the site you need to provide the following settings: AppId: Facebook application id. AppSecret: The application secret. Both settings are available in the Facebook for developers application's page, under Basic Settings. Now enable the Facebook Login module and add these values to Orchard Core. The configuration can be set through the Configuration -> Facebook -> Application menu in the admin dashboard. Now you can log in in your site using a Facebook account, where you can get a familiar screen. After that, you can create your new account in Orchard Core that you can use to log in to Orchard. But the PR is not just about authenticating users from Facebook. If you head to the modules, you will find a feature called Facebook Social Plugins Widgets. Let's enable it! Let's say you installed your site using the Blog recipe. In this case, you have a Page content type with a FlowPart attached to it. Create a new Page and hit on the Add Widget button. Here you will see several new widgets that you can attach to your content type that has a FlowPart attached, like Facebook Comments, Facebook Share, Facebook Like and many more. If you publish or preview your page you will see that the widgets are displayed in your page. 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/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!

This week in Orchard - 03/29/2019

Read our post about tons of new documentation for Orchard Core and the way about how to prevent doc changes from running the CIs. In the current post, you could also learn about how to work with PO files in Orchard Core? On Orchard Core New Orchard Core CMS Guide: Adding a Menu Item to the Admin Navigation from a Module Two weeks ago we talked about a new section called Guides has been added to Orchard Core documentation. Till now there was only one getting started guide in the Guides page, where you can read about how to run tasks on application startup from a module. Now it's time to introduce the second getting started guide about how to add a menu item to the admin navigation from a module. By following this guide you will build a module that will add a menu item at the root level and two child menu items. Each menu item will point to its own view. Preventing doc changes from running the CIs When we push a new changeset to Orchard Core's GitHub repository, the CI builds and redeploys new NuGet packages every time. As you can see, in the last few days we have lots of changesets containing only documentation changes. From now if Travis can't find any change that is not in an .md file/mkdocs file or in the docs folder, then ignores the build, because there is nothing to build, only the documentation has been updated. Same thing for AppVeyor, but in a different way. In this case, we say skip everything that is not in an .md file/mkdocs file or in the docs folder. Let's see an example of this behavior in GitHub. This PR is about to fix a minor typo in the HTML escaping section documentation of OrchardCore.Liquid. The sentence "If you need to render some raw HTML chars you can use the `Raw` filter." was wrong, because here you need to use the raw filter instead of Raw. If you click on the View details button near the merge commit, you will see only 2 checks. The AppVeyor one doesn't appear here and Travis just only has one step, that detects there are no changes and it will do nothing. If you check the Job log of this build in Travis, you will see the message: Not running CI since only docs were changed. Now it will be faster if we do just documentation changes. Adding SVG in allowed media types It's common to upload .svg files and now you can upload .svg by default. Defining Menu parts This is to actually describe the parts as available. They were used, but not declared in the system, so you won't see them in the list of available parts. Now it's working and it's also has a description. You can find the new changes in the menu.recipe.json recipe. Add Crowdin badge to Localization page If you visit the Localization page in ReadTheDocs you can see a badge under the Online translations header. If you click on that badge you will be redirected to the Crowdin page of Orchard Core. How to work with PO files in Orchard Core? The Crowdin page contains all the entries for the languages which we had in Orchard 1.x. Now people can start translating Orchard Core! The files are organized by modules to make you easier to find the text that you want to translate. The next thing is to provide a guide about how to download the .po files and work with them, but it's fairly easy: just select a translation, hit the button with a black cloud icon near the Translate all button to download the translations in a ZIP archive. You can put the .po files from the archive in the Localization folder of the App_Data and then you should enable the given language in the dashboard to pick up the files. Oh wait, the documentation about installing localization files are up now? Yes, the third guide is up, so now nothing can stop you to add your first language to Orchard Core! On Lombiq Orchard Dojo Newsletter Now we have 53 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 - 03/22/2019

Read our post about implementing content type permissions, prevent loading all workflows in the startup and many more. In this week you will also learn about when you should use layers? On Orchard 1.x Orchard 1.10.3 release In case you missed: new Orchard CMS 1.10.3 release is here including PostgresQL support, new C# version support, and static razor compilation.You can download the release from GitHub! On Orchard Core Fixing TenantApiController swagger support When you use Swagger, in the case of the TenantApiController there were name conflicts. Swagger could not figure out which method to call on the GET, so now it's explicitly set. Querying related content items The GraphQL queries section of the Orchard Core documentation has been updated with content about how to get the related content items GraphQL query. Use jsDelivr as the CD for Font Awesome In the past, we used fontawesome.com, but in China, the perf of this CDN is very bad. jsDelivr provides a very good perf in China and everywhere else. Implementing content type permissions Every time we have a content type that is marked as Securable, it will appear in the permissions and you can grant permissions on specific content types. So, you will remove the manage content altogether, like edit content or publish content and then you can provide it at the content type level. It's also unlinking the ownership permissions also, which was not done before either. Meaning you can grant permission on editing on content, which means people can edit own articles. That means they can create articles and edit their own, but not publish them or creating drafts. Prevent loading all workflows in the startup Following nice guide called How to run tasks on application startup from a module, there is a new HttpRequestRouteActivator inheriting from ModularTenantEvents, that will load all the workflow types, that could wait for a webhook and register their route on the route provider. Should I use Layers? When we use the Blog recipe, there is a layer, that will inject the content of the footer from a plain HTML. This is injected by a layer, that is a predicate that could be true or false, that says 'Do I need to inject some HTML based on a condition?'. To evaluate this condition we use JavaScript, so every request, all the layers will be evaluated. It's fast but it's not free. That would be the slowest thing to do in a page. We have some ideas in the future to improve the performance of the layers. Now if you want to make it faster just don't use layers. If you don't need layers, don't use layers. Most of the time when you want to inject something, like a footer and you want to be able to edit it, you can create a custom type called section. This could be a FlowPart, that you could build dynamically with custom widgets. In the layout, you can load this content item by its alias and render it, because you can have a condition about in which page you want to render this content item. So, layers are flexible, but if you don't need them, don't use layers, because it's slower then coding some Liquid or Razor directly. Document OrchardCore.Tenants.FileProvider The Static File Provider feature registers a file provider for each tenant in order to serve custom files per tenant, even if they have the same names. You can find a documentation about the Static File Provider Feature under the Tenants option in ReadTheDocs. On Lombiq Orchard Core Demo in Singapore There was a meetup at March 15, hosted by .NET Developers Community Singapore, about Hastlayer, Posits, and Orchard Core, where three members of Lombiq gave sessions about the mentioned topics. In Benedek Farkas's presentation, you heard the summarized history of the Orchard project and got an introduction to Orchard Core both from a user’s and a developer’s perspective. You can find more about the .NET Developers Community in Singapore on their website. Orchard Dojo Newsletter Now we have 48 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 - 03/15/2019

Orchard 1.10.3 is here! Read our post about adding Guides to the documentation of Orchard Core, improving the liquid encoding, and many more! On Orchard 1.x Orchard 1.10.3 released The latest version of Orchard 1.x has been released on Apr 27, 2017. Now it's time to present Orchard 1.10.3! Last week we wrote about the release notes of this version. The full release notes are available in GitHub, where you can also download the assets of Orchard 1.10.3. On Orchard Core Add Guides section to docs A new section called Guides has been added to Orchard Core documentation. Whatever you're building, these guides are designed to get you productive as quickly as possible – using the latest Orchard Core project releases and techniques as recommended by the Orchard team. The goal is to provide getting started guides and tutorials for the developers using Orchard Core. Getting Started Guides: Designed to be completed in 15-30 minutes, these guides provide quick, hands-on instructions for building the "Hello World" of any development task with Orchard Core. In most cases, the only prerequisites are a .NET SDK and a text editor. Tutorials: Designed to be completed in 2-3 hours, these guides provide deeper, in-context explorations of enterprise application development topics, leaving you ready to implement real-world solutions. There is only one getting started guide now in the Guides page, where you can read about how to run tasks on application startup from a module. There isn't any tutorial right now, but we have two ideas to discuss in the future. One is about building a website from a Web Template, and the second one is about implementing a Self-Service Saas solution. If you have any idea that you can add to the Guides section, don't hesitate to create one! Fixing PluralFormNotFoundException Let's say you set Russian as your default language. This language has more than two plural forms. If you go to the content items page, where we use pluralization for the DateTime, like N minutes ago, the current localization code will throw an exception if you ask for a value that is more than two: H.Plural(time.minutes, "1 minute ago", "{0} minutes ago"); Because for this specific number, it would look for the third plural form, but there is none here. The change is to use the latest plural form and log a warning, saying OK, I could not find a translation for this thing, but instead of failing, I will use the highest form and use the default language. It might be wrongly translated, but at least there will be no exception. UI fixes for content picker Now the content picker using flexbox to align content. Also, have a template to Vue component for adding the ability to translate noResult message. Setting liquid encoding explicitly Sébastien reviewed all the usage of liquid for every component and defined explicitly which encoding we need to use and where to not use the default from Orchard. For instance, the AliasPart is not encoded. When we generate the AliasPart we are not encoding anything. We store whatever is generated, if we want to encode something in the AliasPart, it's up to us to do that. Let's edit a BlogPost content item, which has a Markdown editor! If we type some HTML in Markdown, it will be fine. What is encoded is just the parts that are injected. If we put an hr tag in the HTML encoded section {{ "<hr />" }} it will be encoded. If this value is coming from the outside, this will be safe, because it's HTML encoded. Therefore you cannot inject scripts or whatever because of that. If you really want to inject some HTML, you can use the following syntax: {{ "<hr />" | raw }} In this case, you can see the injected hr. If you trust the source and know it has to be HTML, then you can use the "| raw". There is also a tag for this that you can use in the following way: {% raw %}<h3>A title</h3>{% endraw %} In a workflow, if you inject something that is in Chinese or HTML encoded, the liquid template engine, in this case, was using the default encoding, which is HTML in Orchard. The workflow will create a content item with Chinese chars, which will then be encoded, so the JSON will contain HTML encoded values in their strings, which is wrong. Now imagine a scenario, where the workflow is a webhook on a GET request, and when the webhook is hit, we create some content. The Create Content Task accepts some JavaScript or JSON. In this case, we returning an object, called DisplayText, by injecting the displayText property of the query string. This can be any string, so you could inject some custom text, that could contain double quotes to close the current expression and also pass the Author of the Article because here you can inject JSON as well. Now we are using the JavaScript encoder for this parsing, what will happen is that whatever you type here will be JSON encoded, so if there is a double quote, it will be encoded. Let's get the URL that lets us trigger this workflow by copying it from the Http Request Event. We know that this will accept a displayText property, so let's pass Foo%22bar, where %22 is a quote: https://localhost:44300/workflows/Invoke?token=CfDJ8HJlPWHlP2dHlCgISoLI5HmJ1PGBFCJ44hExwMqWDSH5XQ-hq54vbVUO_jp0IEuOwAnxbW06qOjhJTfDtFUlUmx_hDHBWzmY9fmnnKacVWjatFckF7pBCqfEbdkfoYEQ0tmQdmhcfd-UWnEC0HETh2OWQyUJ-foYSUfKasMH5n3__GYbwHIsVhYFGkimRBc5E-g2UZum3--X9I3R_3pQnReeKKKRgScvhV-klsBLJLiV&displayText=Foo%22bar If we navigate to the list of content items, we will see our Article which has the Foo"bar title. On Lombiq Orchard Dojo Newsletter Now we have 48 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 - 03/08/2019

The release notes for Orchard 1.10.3 is here! Read our post for the latest features that will be available in the Beta 3 release of Orchard Core! On Orchard 1.x Orchard 1.10.3.Release Notes The release notes for the Orchard 1.10.3 release are ready and available on ReadTheDocs! Orchard 1.10.3 fixes bugs and introduces the following notable changes and features: Features Shape placement parsing strategy is now extendable with providers. Added support for static Razor compilation, which also allows the usage for C# 7.3 language features. Added support for Dynamic C# and Razor Compilation to be able to handle C# 7.3 language features. Added support for PostreSQL. Improvements Added the ability for emails sent to notify the sender when the recipient reads the email. build/ClickToBuild.cmd support added for Visual Studio 2017. LifecycleStatus added to FeatureDescriptor, so specific features can be marked as deprecated without marking the whole extension as deprecated. Improved Text Tokens so that all of them are chainable and added TrimStart Token.Added global Media Library permissions: ViewMediaContent, EditMediaContent, DeleteMediaContent, ImportMediaContent. Added support for LocalizationStreamParser to be able to process multi-line PO entries. Added validation to enforce Media folder names that are valid for public URLs. Added scaling option to the Resize Filter in Media Processing. Default ItemController's display type parameter can now be overridden. Updating a content item's Tags received a performance improvement. Added CreatedContent token to be used after submitting a Dynamic Form. Data Migrations now support byte[] columns. Added Workflows Unpublished Event and Unpublish Task. Projection Queries can be configured to use Draft, Published (default) or Latest content versions. A user logging out now takes effect in all sessions. Added CreateContent permission and checking against it when creating content on the Dashboard. Placement configuration provided on the Dashboard only applies to the Dashboard. Added .editorconfig file for Visual Studio 2017 (and above). Added Numberbox (input type="number") editor shape to Orchard.Forms. Deleting Media files now also delete associated files generated by Media Processing in both File System Storage and Azure Blob Storage. Added default connection string for the Azure Storage Emulator to the Orchard.Web's Web.config. For the full notes head to the documentation! On Orchard Core Update content fields The way you access the field properties is changed by duplicating the major properties from the fields. If you are in the field template and render a field, you don't have to use @Model.Field.Text, you can simply use @Model.Text. The previous one is still working, because we still have access to the main field data, but the main properties are also available at the part level, so there are no breaking changes. The documentation also updated with the new behavior. Allow theming for Login/Registration/ResetPassword screens Now the login views (Registration, Login, and ResetPassword) are no more AdminControllers, which means they are not rendered by the admin theme. The UsersThemeSelector sets the admin theme as a default theme for rendering these views. Using settings for these views will let you override this behavior and be able to use these views from your front end theme. So you don't have to create an admin theme just to override these views. But by default, it's using the admin views, so you don't have to theme these pages. If your login experience is part of the front end experience, then you can now enable these settings. You can read more about these settings in our previous post. Refactoring Media validation We have also written about the Media validation refactoring in our previous post, where we mentioned the MaxRequestBodySize and MaxFileSize settings. Now we have the list of extensions you can upload to prevent some exe or whatever malicious files upload. This is a whitelist and we used the same values here as WordPress. Using the configuration you can change the list of extensions you can accept. Disable encoding for templated queries If you are creating SQL or Lucene queries, these queries are actually templated. If you use Liquid inside your query, it will be evaluated and rendered using Liquid. The issue was that the default logic was HTML encode every output tag, which means HTML is not SQL and is not Lucene, so the encoding was wrong. Now there aren't any encoding, but you are supposed to use a new Liquid filter for instance for JSON, that will encode the content into JSON. On Lombiq Orchard Dojo Newsletter Now we have 46 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 - 03/01/2019

A new Metadata module, ways to allow theming for Login/Registration/ResetPassword screens, and adding configurable upload limits are the topics of this week. Check out our current post! On Orchard Core How to edit Orchard Core's documentation Let's say you would like to edit a README.md file in the Orchard Core repository. If you want to add something, you just click edit in GitHub (the pen icon near the trash), and it will fork the repository, let's you edit in place the things. By clicking Preview changes, you will see the changes immediately. Then you can commit the changes right here, that will create a fork and a branch in your fork. If you do one change, then go to another file and edit it too, you can commit the changes to the same branch of your fork. When you are done you can create a pull request directly from the editor. You don't have to clone anything to edit the content, because we have a nice WYSIWYG editor here. It makes super easy to fix typos, add sections to documentation and so on. Adding configurable upload limits When we upload media items by default it' limited to 30 MB, because it's a hard limit in Kestrel and in IIS. This PR has a MediaSizeLimit attribute just for the Upload method. There is also a configuration, which is added to the Media module's configuration: MaxRequestBodySize, which is the maximum payload of an upload action in bytes. MaxFileSize, which is the maximum size of an uploaded file in bytes. Note you might still need to configure the limits in IIS. The default value is 30000000, if you want to accept bigger files, you can redefine it. Allow theming for Login/Registration/ResetPassword screens Right now if you want to customize the Login, Registration or the Reset Password screens, they have to be in the admin theme, because that theme is serving these screens right now. The reasons are that you may not have a front end and you still want to be able to log in. With this PR, you can customize these screens without having to create a custom admin theme. The solution is to create a custom filter called UsersThemeSelector, that will select the front end theme if you go any controller of the mentioned screens above. This way it will select the front end theme to render these pages. If you enable this feature, you will be able to use the views from your front end theme. If you enable the User Registration and User Reset Password modules, you will have a Registration and a Reset password option under Configuration -> Settings (you will see a new Login option here too). If you click one of these options, you will see a checkbox, where you can enable the mentioned behavior. For example in the Registration, you will see the option to Use site theme for registration page. Metadata module supporting base SEO tags, Open Graph, and Twitter tags The Metadata module adds a part that you can set on the content type, so you can define all the SEO custom fields, like description, custom title, Open Graph, and Twitter. Let's add the Metadata part to the Blog Post content type! Then you can edit the Metadata part to what tags and keywords you would like to support. Based on what you have enabled you will see the following screen when creating or editing a Blog Post. Seth Cleaver, the author of this module made a great demo video about the Orchard Core Metadata Module. If you are interested in more news around Orchard, don't forget to check out the recording of this week's Orchard meeting!

This week in Orchard - 02/22/2019

We have no Orchard Podcast this week but don't worry, we can serve with information about new releases. Did I use plural here? Well, yes. On Orchard 1.x Orchard 1.10.3 pre-release The 1.10.3 version of Orchard 1.x is now in the pre-release state. It means this version needs some more testing, before going to production. The documentation and the release notes will arrive soon too! You can find the pre-release here! This version is created by Benedek Farkas from Lombiq! On Orchard Core Added documentation for meta tags Meta tags are available to use in Orchard Core for a while and now you can find documentation in ReadTheDocs about how to use them in Liquid and Razor. A simple meta tag consist of a name and a content. But as you can see in the snip, you can define the http-equiv and the charset attribute of the tag too. And you can use a separator when multiple tags are defined for the same name. The shape_cache liquid tag By using the shape_cache liquid tag, you can set the caching parameters of a shape. Let's say you would like to cache a shape, that has an ID my-shape for 5 minutes. In the screen below, you could see how to do that using liquid. Orchard Core Beta 3 If you head to the GitHub repository of Orchard Core and filter the issues with the beta3 milestone, you will see that there aren't any issues left. Now the community can look into testing and shipping the new release of the CMS. Hope the Beta 3 release will come soon! Updating dependencies The community always try to use the newest version of the ASP.NET Core. For now, the version of the Microsoft.AspNetCore.All package has been updated from 2.2.1. to 2.2.2. On Lombiq Building a website for the Biomedical Optics community - Virtual Photonics Technology Initiative website case study The Virtual Photonics Technology Initiative uses Orchard CMS on DotNest too! See the case study by Lisa Malenfant from the Beckman Laser Institute and Medical Clinic here. New sites added to Show Orchard Added a couple of Orchard sites to the collection in Show Orchard! Check them out at the top showorchard.com. Vita Orthopedics as a manufacturing and importing company specialized in orthopedic and rehabilitation products since 1984. The Port Adelaide Cycling Club (PACC) was established in 1885 and has faithfully and proudly served the Adelaide cycling community for over 130 years. Send in your exemplary Orchard sites to [email protected] and we'll publish them too! Orchard Dojo Newsletter Now we have 45 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!