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 - 11/05/2018

Interested in the new features of the GraphQL Explorer or the GraphQL API? Or the announcement of the Orchard Core Commerce: The commerce module for Orchard Core? On Orchard Core First let us to mention you some of the newest posts from David Hayden's blog! Overriding Theme Shapes with Templates in Orchard Core CMS The Blog Theme in Orchard Core has a Content-Article.liquid file. This is the shape responsible for displaying an article. In this post he shows how to change the hardcoded background image of the article by adding a Media Field to the Article content type to be able the users to select any image. Adding a New Zone to The Blog Theme Layout in Orchard Core CMS In this tutorial, he shows how to add a new Zone, called Messages to the Blog Theme. Now can add any widgets to the Zone in the Orchard Core CMS website. Develop a Custom Widget In Orchard Core CMS In this tutorial you can read about how to create a new widget, called Alert Widget, that will allow one to easily display a Bootstrap alert on the website using the previously crated Messages Zone. If you would like to read more exciting blog posts about Orchard and Orchard Core, don't forget to check out Orchard Blogs: the heartbeat of the Orchard CMS community: blog posts from Orchard-related blogs, scraped automatically. Created by Lombiq. Orchard Core Commerce: The commerce module for Orchard Core Orchard Core Commerce will be an Orchard port and partial rewrite of the open source Nwazet Commerce module that was built for Orchard CMS 1.x. Nwazet Commerce was initially built in 2012 by Bertrand Le Roy, loosely based on a commerce sample by Sipke Shoorstra. The initial goal of Nwazet Commerce was to power the web site of the hardware startup Nwazet. While Nwazet is no longer operating, the Nwazet Commerce project went on, and was further developed by a group of passionate contributors who are using the platform for their own, and their customer's web sites. Like Orchard, Nwazet Commerce was built with extensibility in mind, and as such it has its own extensions (typical examples include local tax and shipping modules). It's also pure, idiomatic Orchard. Orchard Core represents a major evolution of the Orchard design principles, and is sufficiently different that running Nwazet Commerce on it will necessitate significant work. As such, the team decided that starting from a blank slate was the best way to go, so they will port Nwazet Commerce piece by piece, being careful to accurately apply Orchard Core's new design principles. They also decided to adopt a new name, that gets rid of the now obsolete origins, and establishes their ambition for the module to become the go-to commerce module for Orchard Core. This work is in its initial design phases. There's a lot of work to do, and yes, the team do welcome participation in any shape or form. If you would like to help to improve the Orchard Core Commerce module head to GitHub and check the available Issues! Demos GraphQL Explorer and GraphQL API We mentioned the GraphQL feature earlier in this post and last week we saw how to Test the new tenant APIs using GraphQL. Now let's see the newest improvements of the GraphQL and the GraphQL API! For the following demo we set up the site using the Blog recipe. We added several fields to the Article content type to demonstrate the capabilities of the GraphQL Explorer: a Link Field called Link, a Markdown Field called Description, a Media Field called Images, and a Content Picker Field called Posts. When you enable the GraphQL module, you can go to admin/graphql, where you can find the GraphQL Explorer. You can use CTRL+Space to have an intellisense. You don't need to click the play button every time you want to run your query, you can hit CTRL+Enter to do the same. In the Explorer you also have access to fields not just the parts. The Subtitle is a Text Field, that you can reach by simply type the name of the field. The Link Field called Link has two properties: text and url. You can get the HTML content of the HtmlBodyPart as well. The field called Description is a Markdown Field. By accessing the html property of that field you can get the value of the markdown transformed to HTML. The Images here is a Media Field. It's provide the URLs of the images that stored in the database and represents the media in the assets. But if you want to render these elements you need the public URL to point to this media. So instead of paths you can call urls. When accessing a Content Picker Field (Posts in this case) you can get the contentItemIds or the content item itself. But let's say you have many related content items and you just need the first one. By typing contentitems(first: 1) you will get only the wanted item. You can skip the first one by typing contentItems(skip: 1). You can also do that with the collection of urls of the Media Field. You have the ability to write if statements here. If the content item is a BlogPost, then give me the MarkdownBodyPart, but the HTML of the markdown. To do that on a collection of content items, you need to type ... on BlogPost {} and in the bracket you can define what would you like to query on. You can write more complex queries like give me the blog posts and order them by their displayText or by the createdUtc. So you can order by properties. You can also combine this query by using the first or skip keyword here. You can use the where keyword with several filters. For example, by using the displayText_contains, you can filter for a post that display text starts with a given query. Hit CTLR+SPACE to see what options are available. With parameterized queries you can say that list me that blog posts where the display text starts with the value of the parameter. Now this query is parameterized by something, so you can reuse it or separate the query from the values. In the previous post we mentioned how to use Orchard Core's authentication server to authenticate yourself when making a call to Orchard Core APIs. Now you can use the GraphQL API to make those requests. On Lombiq Mega Millions on Show Orchard Show Orchard is an Orchard CMS showcase, displaying only the best Orchard CMS powered sites from around the web. The Mega Millions Jackpot website runs on Orchard too! So, added it to Show Orchard! We just scratched the surface of the topics that the community had this week. If you are interested in the whole conversation, don't forget to head to YouTube for the recording of the current podcast!

This week in Orchard - 10/26/2018

Interested in what will be the Orchard Core Cluster feature? Or the improvements of the Orchard Core APIs? If yes, you will love this post! On Orchard Core New Bootstrap checkboxes Orchard Core will have a new Bootstrap checkboxes soon. Orchard Core Cluster feature Why don't we do a feature that will support clustering in a better way? Today what we have is a Redis Cluster. Redis Cluster works as a fail over/replica or a shard/partition. When you have multiple nodes of Redis you can define which nodes are slaves or masters, which are actually fail overs. But you can also define Redis nodes as partitions. The idea with the fail over is that all the data replicated on two different nodes, so if one node go down, the other one will take over.The shard/partition strategy is to be able to scale out the memory, so if you have too much data to put once on a server then you create another one to share the data across the servers. Each node will be responsible for a partition of data. How it works is for each key that you store in Redis, the key will be hashed using the CRC(16) and it does a modulo of this hash 16384 and then you get a number which will be obviously between 0 and 16383. Any key will be mapped to a number like this randomly because it's using a hash code. This key will be like the slot that you want to put your key on. Each node in a Redis cluster is responsible for n slots. When you configure your Redis cluster you say my Redis instance A will be responsible from the slots 0-4000. Than the node B will be responsible for the slots 4001-9000. So, you define n nodes, each node you need to configure which slot it should use and when a key sent to Redis, it will compute the slot that should go in based on a hash code. Then it knows that which instance has to handle this slot, so the key will be deterministically sent to a specific node. So, when you look for a key you know where to look for, because you know which slot it should be in, which Redis instance is to ask for. That's how Redis works. Why not do the same thing for Orchard? Why not have Orchard to natively support the sharding/partitioning of nodes? Every Orchard instance could be configured to use the same Redis database with to able to send "Hi" message and everyone will get it using the message bus. When everyone gets the "Hi" message from a new instance joining the node then they can send the "Meet" message. Then everyone will know about every other instance on a cluster. By doing that we can decide (once a tenant is created or activated) which node will handle that using the same logic as the hash. They can communicate directly using REST APIs to say: "Please enable this tenant" and the other node will enable the tenant. So, each node is an Orchard Core application with the Orchard Cluster module enabled. It works like the Tenants module and allows to communicate with other nodes. When a new node is created, it can join to a cluster by connecting to a common Redis database (no need for custom cluster name for simplification). When a node joins a cluster, it sends a "HI" message for all other nodes to be informed of the newly added node (including the address it can be contacted at). They then respond with a "MEET" message (including the address they can be contacted at). About the Proxying: Each default tenant is able to forward the request to the correct node (relay mode). Generate a routing table each time a new tenant is added. Use a deterministic distribution. Use alphabetical distribution (from domain, or tenant name). Be able to configure the hashing logic on the proxy. Build a custom proxy module that is used as the reverse proxy. Should be able to download the routing file for any node, every minute. If the map is out of date, the relay will be used until the routing table is refreshed (HAProxy can do that https://www.haproxy.com/blog/web-application-name-to-backend-mapping-in-haproxy/) The default tenants need to be able to provide the routing table from an HTTP request. Custom modules can implement the routing table in custom formats (HAProxy). Test the new tenant APIs using GraphQL The ShouldListAllBlogs() method in BlogPostTests.cs calles BlogContext.InitializeBlogAsync(). The BlogContext is inheriting from SiteContext and calling some GraphQL APIs to build something, like add a field to the blog. In the SiteContext.cs you can find a line: Site = new OrchardTestFixture<SiteStartup>(); By doing that it's creating a new instance of Orchard running this SiteStartup. We have the OrchardCore.Cms.Web.csproj that contains one startup, that just says app.UseOrchardCore() and app.AddOrchardCore(). This Startup is a same thing, but instead of being a csproj, it's hosted dynamically by this code. The Unit Test will start the site represented by this startup. This SiteStartup.cs says AddOrchardCms() and UseOrchardCore(), like in any other Orchard app. But this one will use the lambda that we provide to configure the Orchard Core instance and add custom features. This Orchard Core instance will enable the OrchardCore.Tenants and OrchardCore.Apis.GraphQL features, because the goal of this test is to check that GraphQL works. For that we need to get some APIs which are in the OrchardCore.Tenants feature. Here we also registering a custom authorization handler, which will just say anyone who needs some permission, we will grant it. It's not testing the permission pipeline, just testing the GraphQL feature itself. The Unit Test will launch the main Orchard app host and then create a tenant dynamically by calling into an HTTP REST API to create a tenant (api/tenants/create) and to set up a tenant (api/tenants/setup). Demos API endpoints to create/setup tenants and manipulate contents and using Orchard Core's authentication server Set up a site with the Software as a Service recipe that allows you to setup your site with additional preconfigured options, features and settings out of the box. By making a POST request to the api/tenants/create endpoint you can create a tenant. Let's see the following URL: https://localhost:44300/api/tenants/create?Name=Blog2&RequestUrlPrefix=blog2 Here you can pass the Name and the RequestUrlPrefix in the query string. To setup a tenant you will need more parameters. The Name, the SiteName, the DatabaseProvider, the UserName, the Email, the Password and the RecipeName. By using for example Postman you can create a tenant by making a POST request to a HTTP endpoint. You can also get, create or delete content. You can pass draft=true that creates or replaces an existing draft. Without passing the draft, it will create a published version of the content item. If we don't have the OpenID Token Validation and the OpenID Authorization Server features enabled we will not able to call APIs even the ones that allow anonymous users. After you need to set up the authorization server by navigating to OpenID Connect -> Settings -> Authorization server. Here you need to put a tick to the Enable Authorization Endpoint and Allow Implicit Flow checkboxes. Don't forget to select an authorization server tenant under the Token validation menu. Then under the Management -> Applications you need to add a new application. Let it be Postman with a public client type. We also need to tick the Allow Implicit Flow checkbox here and don't forget to set up Redirect Uris and the type of the consent. After that you can get a new access token using Postman. Here we need an OAuth 2.0 typed token which we will send in the request header. When we get a new access token, we should provide the values of our Authorization server here. Now you will have an access token that you can use to validate yourself when using the APIs. Display modes The general idea is to add a Display Mode in fields settings and to be able to add settings on them that you can see in this issue. With the help of the Display Mode we can define which way we should render a content. Let say we could have a display mode for text field like the field editor views. If we go to the content definition of a text field the new is the 'What type of display mode should be used?'. For example, if I want a header display mode, it asks the header type. Let's select one and check the display of this field on the front end. It will allow a lot of new possible options: For most display modes Liquid : Templates to display the field, may be allow to access to other field values. Summary/Details: Depend of the kind of shape. Zone/Position: Send the display to a specific zone and position. Text Field Truncate: Number of characters/words. Meta: Add it to the Head resources. Syntax Highlight: Select in which language. Translate Date, Time Fields Format Time ago Markup Timezone Numeric Field Money format Currency Boolean Field Labels depending on boolean value Media Field Carousel LightBox We just scratched the surface of the topics that the community had this week. If you are interested in the whole conversation, don't forget to head to YouTube for the recording of the current podcast!

This week in Orchard - 10/19/2018

In the current post we would like to summarize you the latest amazing demos around Orchard Core! On Orchard Core Demos File Content Definition Feature How to handle content type definitions when you have multiple people working on the same project? The fact that when you create a content type and when you are on the deployment, you have to copy the database on all the dev machines. Or even if one dev adds a content type you have to share the database or create new recipes and rerun the recipe. A good solution could be to use a file to store the content type definitions. The nice thing with a file is that you can put it in a repository and then when you update it just update all the content definitions that in the file. For that there is a new notion in the OrchardCore.ContentManagement module: IContentDefinitionStore. The IContentDefinitionManager lets you list types/parts and updates them. The new IContentDefinitionStore interface actually stores the content definition with the LoadContentDefinitionAsync and SaveContentDefinitionAsync methods. The default implementation called DatabaseContentDefinitionStore that uses YesSql to store the document. Now there is a new one called FileContentDefinitionStore, which will read and store a JSON file. So instead of using a database, this JSON document will put in a file. This is defined as a new default feature in the OrchardCore.Contents module and the FileContentDefinition is also in a separated feature. You can find the ContentDefinition.json file in the App_Data/Sites/Default folder with the following content: Here we added a new content type, for example MyContentType and adding a new TextField to it, we will see the ContentDefinition.json updated with the definition of this content type. It's because in the modules we enabled the module called File Content Definition that stores content definition in a local file. You can test this new feature in the dev branch of Orchard Core. Taxonomies leaf support First don't forget to enable the Taxonomies module. Then let's create a new content type, called Color. The Color only just has a Title. Now create new Taxonomy under the New menu. Let's add a name Colors and select Color as the Term Content Type. Now here we can add new Colors. Now add a Taxonomy Field to a content type. In our example we added a new Taxonomy Field called Colors to the Article content type. Here you can see a checkbox with label: Check if only the leaves of the taxonomy can be selected. Let's put a tick here. Now let's create a new Article with some selected colors. For example, select the Dark Blue and Light Red values. Now open the YesSql database of our site. In the TaxonomyIndex table you can see two new rows. These two records are for the two selected terms. What we have here is the TaxonomyContentItemId, that is the ID of the Colors taxonomy. The ContentItemId is the Article content item ID. The TermContentItemId is the ID of the term that is selected. Now we can query taxonomy elements and this schema could make it very easy to do that: you can query and filter by specific content parts, content types, content fields and so on. There are some Razor extensions in the TaxonomyOrchardHelperExtensions.cs file: get the taxonomy term by its ID, get inherited terms by their ID and to query the taxonomy index directly. You could find the improvement in the branch called taxonomies. Using a workflow to make the Contact Us form of the Agency theme dynamic The Contact Us form of the Agency theme doesn't do anything, it's just had a frontend to show how to design a form like this. Antoine Griffard decided to make it dynamic by using a workflow. He used an Http Request event with a HTTP POST method as the starting activity of the workflow called Contact Form Submitted. Here you can see the full workflow. Don't forget to watch the recording of the latest Orchard Podcast for the full demos!

This week in Orchard - 10/12/2018

In the current post we would like to summarize you the latest amazing demos about the brand new Orchard Core features! On Orchard Core Demos The Admin Trees module Matias Molleja has been working on the content tree feature. Now it's the admin menu for everything that can be configured, including content of course. With the Admin Trees module, you can build custom admin menus. After enable the module you can reach the Admin Trees by going to Configuration -> Admin Trees. You can add a new Admin Tree, call it like Content Items and lists. After that you can add nodes to it. Now we only have three types of nodes (Link Tree Node, Content Types, Lists), but any module can subscribe and add its own nodes. If you add a Link Tree Node, you can define the Link Text as it will be shown in the tree (let it be My Content Items), the URL of the link and CSS classes, if needed. Now you will have a new menu item, with text My Content Items. You can add different nodes to this menu, like a Content Types node. After that you will see that every content type that you have selected will be shown in the menu. If you want to place the list of the content types under the My Content Items menu, you can just simply pull the Content Types node to the right and without reloading the page, the list will be placed under the My Content Items menu. You also have the ability to put submenus under the Content menu. To do that, add a new Link Tree Node, called Content. By having the same name as an existing menu (in our case Content) you can simply put your tree under the Content menu. This module is under development, so you can find the Admin Trees module in this branch. New Workflow Events to manipulate tenants Thanks to Antoine Griffard now you can select between more activities when you are creating a workflow. If you add a new task to your workflow, you will see a new category in the list of available tasks, called Tenant. Here you can select between four difference types of tasks: Create Tenant, Enable Tenant, Disable Tenant, Setup Tenant. By choosing the Create Tenant Task you can provide every important property that needed to create a new tenant, like the Host name, the type of the database etc. You can specify these values by Liquid, so the Name of the tenant to create could be: {{ Request.Form.SiteName }} In the following workflow, we will create a new tenant when posting to a URL provided by a HTTP Request Event. To call the starting Http Request Event of the workflow, we need to post to a given URL. To do that, you can just create a new page and add a new Form to that. Here you can specify the URL to submit the form to, that will be our URL copied from the Http Request Event. By adding input widgets to our form, we can provide an interface to the user to set the values of the new tenant. Here you can add an Input with a SiteName name that we used previously in our Create Tenant Task. This module is under development, so you can find the new activities in this branch. One of the goals of this module is to be able to do a workflow, where users can create and set up a tenant. Don't forget to check out the recording of this week's Orchard Podcast for the full demos! There you can also watch short presentations about the improvements of the Taxonomies module (Sébastien redid the module, but for now by not using the BagParts.) and the impored queries using a full Query DSL.

This week in Orchard - 10/5/2018

In the current post we would like to suggest you some nice posts about Orchard Core and show you the improvements of the Predefined list editor of Orchard Core! On Orchard Core I think we don't need to introduce David Hayden to the Orchard community. David Hayden is primarily a C#, .NET and Orchard CMS Developer with 20 years experience developing ASP.NET Websites and related technologies. David is passionate about Orchard CMS. He's been developing Orchard Themes, Modules, and Websites since it was first released. He has contributed bug fixes and enhancement to several versions of Orchard and has published modules in the Orchard Gallery. He attended the first Harvest Orchard Developer Conference and has created over 100 Orchard Themes and 300+ Orchard Modules. David is currently primarily focusing on .NET Core, Orchard Core, and Orchard Core CMS for building modular, multi-tenant web applications and websites. He also published several articles about Orchard Core to his blog. Let's see some of the newest ones! Using the Content Picker in Liquid Templates in Orchard Core CMS The Content Picker was recently released for Orchard Core. In this post David shares a tip on how to use the content picker in a Liquid template. Bootstrap 4 Carousel Widget for Orchard Core CMS A nice post about developing a Carousel Widget using a BagPart and Liquid templates. Dynamic Theme Selection in Orchard Core CMS In Orchard Core you have the ability to preview the website using a different theme during the active session without changing the current theme on the site. This post is about creating a module that allows an administrator to change the current theme for they session by passing in the name of the theme using a query string parameter. If you would like to read more exciting blog posts about Orchard and Orchard Core, don't forget to check out Orchard Blogs: the heartbeat of the Orchard CMS community: blog posts from Orchard-related blogs, scraped automatically. Created by Lombiq. Demos Predefined list editor improvements Last week you could see a demo about the Predefined list, a new editor for the Text Field. There we mentioned that the Options textarea of the editor, you can predefine the allowed values using JSON. Setting the options by using JSON is not the best solution, so in the future we could define the available options as you can do it in Craft CMS. The future is here, now you will have a nice Vue.js editor to provide the values thanks to Jasmin Savard! Let's say we have a Project content type with a Text Field called Category and this Category has a Predefined List editor type. Here you can also select between drop down list and radio buttons. In the left screen you could see the editor of the Category Text Field when you have predefined the drop down list and in the right screen you could see the Category when you selected the radion buttons option. This feature is still under development, so you need the skypt/options-editor branch to have these changes. You can watch the whole demo in the recording of this week's Orchard meeting! On Lombiq Orchard Dojo Newsletter Now we have 25 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 enthusiast who you think would like to read our weekly articles? Tell them to subscribe here!

This week in Orchard - 9/28/2018

Check out our current post for a 2-hour long demo about how to add a new SaaS module for Orchard Core! On Orchard 1.x Styling the Orchard Tag Cloud so it looks like a cloud, not a list Robert Wray published a new post to his site about styling the Orchard Tag Cloud so it looks like a cloud, not a list. On Orchard Core Demos Predefined list, a new editor for the Text Field Now if you add a new Text Field to a content type, you have the option to choose the Predefined List type for the editor. In the Options textarea, you can predefine the allowed values using JSON. In this example we added a new Text Field to Article that has a Predefined List-typed editor. On the editor page of the Article content type you could see the Category Text Field that has the predefined options. It's a radio, but you can also choose the display to use a dropdown. See that we have one option with no value. We also haven't provided anything for the Default value. Setting the options by using JSON is not the best solution, so in the future we could define the available options as you can do it in Craft CMS. You can watch this demo and many other improvements in the recording of the latest Orchard Podcast! Implementing a SaaS module in Orchard Core Last Friday Sébastien showed us how to implement a SaaS module in Orchard Core. In the next few lines we would like to give you a short recap based on the 2-hour long video, that you can also find on YouTube! The concept The goal is to create a simple vertical application with a dedicated recipe. Take a look at Fabrik.io! Here the users can register and after a simple registration they can create their own sites (like in the case of DotNest as well). So the first step is to design the process how users can manage their profiles. This workflow could be a good one: User goes on the front page. User enters his/her information. User receives an email, and clicks the link to confirm the email address. User is registered in the default tenant. The site is created, and an email is sent with the URL of the site. We could also add other options for the users, like they could manage their information, profile and payments in the main tenant, on the front-end. In our demo users can enter an email address, the name of the site and a handle. After that they will get an email with a link that will create the site. If they click on the link, Orchard will create the new tenant and redirect the user to there. Create a new module in Orchard Core called OrchardCore.SaaS An easy way to add new module to Orchard Core is just to take an existing one from the OrchardCore.Modules folder and copy all of its content with a folder name that you want to add to your module. Then change the name of the csproj file. After fire up Visual Studio and Add an existing project to the OrchardCore.Modules folder which will be our new renamed project file. But you can also create a new module by adding a new Class Library (.NET Standard)-typed project to the solution. Before building the module don't forget to delete the App_Data folder from the OrchardCore.Cms.Web folder. You also need to reference the new module to the OrchardCore.Cms.Web project. Add a custom recipe to the module Pick an existing recipe and copy it to our module's Recipes folder. In our case the saas.recipe.json would be perfect, because we would like to do something similar. We need to change the name of the recipe (to do not have two recipes with the same name) and enable our module in the line 27 of this recipe. We also set the home page of our new site by setting the HomeRoute option and providing the route of the selected action. Implementation The heart and soul of our module is the HomeController. Here we have the RegisterUserViewModel to get the SiteName, the Handle and the Email from the user. If the ModelState is valid, we need to create a new instance of the ShellSettings. Here you have to provide the name, the connection string, the database provider and many other options. As you can see here we set a new tenant with the SQLite database and with the Blog recipe. The confirmation link in the email will contain every data that the user provided in the home page. For this don't forget to set up the SMTP settings. When the user clicks on the link in the email the Confirm action will take in place. Here we have to create a new SetupContext based on the information from the email, get the ShellSettings and pass this SetupContext to the SetupService to set up the site. You can see that for the sake of simplicity we are using hard-coded values for the username and password of the admin user. If everything go fine here, we redirect the user to the newly created site by using the value of the handle. We implemented this module based on Sébastien's demo and uploaded it to a GitHub repository, so feel free to explore the whole codebase of this project!

This week in Orchard - 9/21/2018

Check out our current post for loads of demos about Orchard Core and of course for a 2-hour long demo about how to use Orchard Core as a Decoupled CMS! On Orchard Core Demos Handling theme-less sites The Login page is now using the admin theme, not the frontend one. To do that, we need to use a custom layout, the Layout-Login.cshtml. See that this view is part of the TheAdmin theme. Also, at the bottom of the Active Themes menu you will find a section called Reset default themes. Here you can reset the site and the admin theme, that means there will be no layout injected in the view. This feature is useful for a Decoupled CMS. Icon picker editor Now Text Field has a new editor type, called Icon picker. If we would like to create a new content item that has a Text Field with an Icon picker editor, we will see a default heart icon. With the help of this editor you can select an icon from the Font Awesome icon set. You also have the ability to search an icon by typing its name. Security token to setup a new tenant When we create a new tenant, we can preselect a recipe like we can preselect the type of the database. By the past everybody can go to the setup screen of your tenant and set it up without having a permission to do that. Now, you have to click on the green Setup button near the name of the tenant in the Tenants page, that lets you access to the setup screen thanks to a security token. This token is also time limited. With this feature you can create tenants to users, send it by email and wait for them to set it up. Because the database and the recipe are preselected, the user cannot set the values of those when setting up a new site. You can also see the token in the Query string. Content picker field A new Content Picker Field is available for Orchard Core. When you add a new field to your content type, you can select the Content Picker Field type. Then you can choose which content types you want to display in this field and you can have a standard editor or select Lucene to search for a Lucene index. In a standard editor, you can select content items based on their DisplayText. You can watch these great demos in the recording of the latest Orchard Podcast! Using Orchard Core as a Decoupled CMS Last Friday Sébastien showed us how to use Orchard Core as a Decoupled CMS. In the next few lines we would like to give you a short recap based on the 2-hour long video, that you can also find on YouTube! The differences between Standard CMS, Headless CMS and Decupled CMS We have already talked about the different types of CMSs in a detailed way in this post, so for now just focus on what these differences means for Orchard Core. When we look at Standard CMS, what we see is that, when a website displays a page, it will use the ItemController in the OrchardCore.Content module. Inside that controller, there is a Display method, that takes a Content Item Id and renders that item whatever it is. Everything we see in an Orchard website is rendered by this exact action. With a Headless CMS, the CMS doesn't render anything in a frontend. It's just a set up APIs in terms of REST APIs, that you can query with HTTP protocol and then you get the result from these queries and then you do whatever you want with the content. In Orchard we have an ApiController in the same module which lets you to Get a Content Item and just returns the JSON document representing the Content Item.So, you can create a website, that you host somewhere and Orchard is hosted somewhere else. The first website just queries Orchard by asking to give me this Content Item and I will display it. There are most endpoints to get Content Items, like to do queries to list Content Items and so on. The Decoupled CMS is run as part of the CMS, but the CMS is not rendering the pages, it's your app or your web page that is rendering the pages. The communication between your pages and the CMS is in process using local APIs, compared to Headless CMS, where the communication is network communication. Create a new tenant to host content based on the Blank recipe The Blank site recipe creates a blank site with content management features. This will enable some features and the TheAdmin theme for the admin and nothing as the site theme. So, there is no selected theme for the frontend views. If you would like to access the admin site, you can do that, because the admin works correctly. This site has content management modules and in terms of Content Items, there is nothing. In terms of Content Types, there is nothing either, just the Menu and the Link Menu Item. Create a page on the web app directly You can just simply create a new Pages folder inside the OrchardCore.Cms.Web project (in the web application level) and inside that folder you can create a new file, like Foo.cshtml. The content of Foo.cshtml could be something like: @pageFoo Page After that if you go to https://localhost:44300/Foo, you can see it loads that page. It can be inside modules, and it will work too. If you add a page called Index.cshtml in the same folder, it will be your Home Page. Of course, you can define custom routes for your pages too. This is a kind of a Decoupled CMS, because we haven't used any theme for the frontend and not using any controller to display content. Decoupled theme As we mentioned earlier you have two different approaches when you build a new theme: You can construct the model first and create the theme. In this case you could have switchable themes for the precreated content. You can construct the theme first and then build the model. Let's create a theme based on the Modern Business one. First download it and copy everything to the wwwroot folder of OrchardCore.Cms.Web. If you type https://localhost:44300/index.html it will work, so now we have access to all static content. Making the static theme dynamic Copy the index.html file to our Pages folder and rename it to Index.cshtml. Don't forget to add the @page directive to the first line of the file. Then you can remove the static index.html file. So now if you visit your root URL, you will see your new home page. After that we can start make it dynamic. To do that you need to inject the OrchardHelper, that is an object which is usually available when we do a theme. @page@inject OrchardCore.IOrchardHelper Orchard<!DOCTYPE html><html lang="@Orchard.CultureName()">...</html> For the end of the demo you will have a Decoupled site where you can list Project and Service typed content items and also have a detail page for the Project content type. The Index page of the site contains two notable helpers: GetContentItemByAliasAsync: if your content type has an AliasPart attached, you can define an alias for it. You can get the content item based on the value of the alias. If you add a BagPart to that content item, you can query over the items of it in the view. GetRecentContentItemsByContentTypeAsync: you can get content items by the type using this helper. You can also provide the number, that how many items you would like to fetch. In the last screen you can see the detail page of the Project content type. Here we display the name of the Project. So if you are interested in how to get there, just watch the recording of the demo! On Lombiq Win a year of free custom domain usage: Still time to fill out the developer survey! As we've written about before, we ask you to tell us everything you wish DotNest would do differently. The DotNest developer survey is still on, but not for long: We'll close it on the 23rd. If you haven't filled it out here's the time, because you may also win a year of custom domain usage! So tell us your thoughts in the survey, enjoy an improved DotNest and win! DotNest is back in the Azure Marketplace - and it's in Microsoft AppSource! A while ago DotNest was part of the Azure Marketplace - and it's back again! Actually not just there, but also in the Microsoft AppSource catalog. The Azure Marketplace is mostly aimed at businesses already using Azure. AppSource is frequently utilized by any business users to source solutions for their needs, and we believe DotNest can provide a suitable platform for a lot of web-centric business use-cases. Having these two new offers published will help drive more people to DotNest and Orchard, strengthening our ecosystem. Do you know of somebody looking for a CMS, especially a hosted one? Ping them to check out these marketplace offers!

This week in Orchard - 9/14/2018

Check out our current post for the Dynamic compilation with C# 7.3 support in Orchard 1.x and for a lot of exciting Orchard Core improvements! On Orchard 1.x Demos Dynamic compilation with C# 7.3 First of all, let's mention two notion in a nutshell: Static view compilation: you can build your Razor files without needed to build the solution Dynamic compilation: you do not need to build your solution if you modify a cs file for example, you just need to hit save in your IDE and you can test your newly implemented features You can find dozens of documents about Static view compilation and Dynamic compilation in the web, so if you are interested in this topic just fire up a web search engine. Orchard 1.x not just supports dynamic compilation, but the Roslyn compiler has also been updated, so you can use the newest language features of C# that comes in the version 7.3. You can find a great demo about the Dynamic compilation in the latest Orchard podcast thanks to Benedek Farkas from Lombiq. In this demo he showed the working of the Static view compilation, the Dynamic compilation and he also overwrites a Razor file via FTP to a site that has been deployed to Microsoft Azure. On Orchard Core Crate a Font Awesome Icon Picker The idea is to create an editor for the TextField that would show a Font Awesome editor. In this page you can see an example for a dropdown where you can search and filter icons: https://farbelous.io/fontawesome-iconpicker/ David Ouwinga has an existing implementation for this feature in Orchard 1.x, that works in the following way: Show Login pages on the admin theme Last time we mentioned that the login controller (AccountController in OrchardCore.Users.Controllers) redirects us to a front-end page to login. Then it tries to find the theme and it will fail, because in a Decoupled CMS that is not necessary to have a shape. The login can't be decoupled right now, because it's completely coupled to the front-end. In WordPress, the Log In page has a different theme than the front end. Maybe Orchard Core could have the same approach here: have a different back-end theme for the Log In page. In this case when you design your front-end theme you should not have to care about to style the Log In page. User management: separate admin users and front-end users? When we authenticate on the Log In we can see all the users on the admin page. The users we show in the admin is a mix of the admin users (who has access to manage content) and the front-end users. Let's say we have an e-commerce site where we have customers. The question is should be the customers and the administrators of the site being stored in the same database/table and showing in the same list of users? Listen the conversation about the pros and cons of the concept of separating the admin and the front-end users at the end of the latest Orchard podcast! On Lombiq Win a year of free custom domain usage: Still time to fill out the developer survey! As we've written about before we ask you to tell us everything you wish DotNest would do differently. The DotNest developer survey is still on, but not for long: We'll close it on the 23rd. If you haven't filled it out here's the time, because you may also win a year of custom domain usage! So tell us your thoughts in the survey, enjoy an improved DotNest and win!

This week in Orchard - 9/11/2018

If you like demos, you will enjoy our current post! On Orchard 1.x Last time we mentioned that the next release of Orchard 1.x will arrive soon after the Dynamic Compilation will work with C# 7. Good news, now we have the PR that contains the changes that needed for the Dynamic Compilaton, thanks to Benedek Farkas from Lombiq! On Orchard Core Standard CMS, Headless CMS and Decoupled CMS At August 31, Sébastien gave a live demo about what's the difference between the Standard CMS, Headless CMS and Decoupled CMS. Standard CMS: With a traditional CMS (like Wordpress or Joomla) users create and edit their content through tools like a WYSIWYG editor or an HTML editor and save it to the back-end database. The CMS then displays the content according to the front-end delivery layer built into the CMS. A traditional CMS is sometimes referred to as a "coupled" CMS. This is what Orchard Core can do by default. You set a theme and then you get a website to edit the content. Headless CMS: If a traditional CMS was a body, the "head" would be the front-end components like the front-end framework and templating system. If you chop that head off, and you’re left with a headless CMS. A headless platform has no default front-end system to determine how the content is presented to the end user. Instead, it’s front-end agnostic, meaning that your content is raw and can be published anywhere, through any framework. So, you only edit the content and you access the data using REST APIs. With that you can create a static website, that calling the REST APIs. Decoupled CMS: With a decoupled CMS, your content is managed separately and is front-end agnostic, just like a headless CMS. Yet, it has front-end delivery tools in the box, like templates, if you want to use them. Remember when we chopped the "head" off a traditional CMS to make it headless? Well, imagine the same scenario here, except this time, we kept the head. It’s not attached to the main body as with a traditional CMS — but you aren’t totally left to your own devices when it comes to front-end delivery, like with a headless CMS, either. So, decoupled CMS is a mix of Standard CMS and Headless CMS. You can still edit the content using the CMS-part and you can render the website from the same web app, but the website you are rendering has been built by your own. You make all the pages that you will render, the CMS itself doesn't render anything, the front-end and back-end communicate to each other through calls to an API. With Orchard Core you can do all of this, you can render your site as a Standard CMS, as a Headless CMS or as a Decoupled CMS. The idea of that demo was to show some advanced content management even in the Decoupled CMS. So you can just simply create an ASP.NET MVC web app with some Razor pages and grabbing the content from content APIs and nothing more. @{ var query = await QueryManager.GetQueryAsync("Portfolio"); var results = (System.Collections.IEnumerable) await QueryManager.ExecuteQueryAsync(query);} @foreach(ContentItem Project project in results){ <a href="#">@project.Content.TitlePart.Title</a>} In this case, we made a SQL query, called Portfolio, that returns all the Portfolio content items. And for that each Portfolio content item we can render the properties in the markup. But there were issues, for example if you want to create new pages or edit the existing ones you always need to rebuild the solution. One of the biggest issue that it was not easy to reuse the services that are defined in OrchardCore helper. For example you can easily access the current culture like: <html lang="@OrchardCore.CultureName()"></html> It would be great to be able to use these helpers in the Decoupled CMS as well. The other big issue is about the login. The login controller redirects us to a front-end page to login. Then it tries to find the theme and it will fail, because there is no layout shape. The login can't be decoupled right now, because it's completely coupled to the front-end. Because of these issues, Sébastien will redo the same demo once he has the correct APIs and fixed the mentioned issues. We will publish the recording of that demo instead of this one. But if you are interested in this demo, just go ahead and ask Sébastien to share the link of that video with you. Demos Two new Orchard Core templates Marcos Aidos and Sijmen Koffeman created two new themes for Orchard Core using Liquid and on the latest Orchard community meeting they showed a demo about the Cafe Theme (Multipage website example) that is based on a StartBootstrap theme called Business Casual.The other one that you can find in the GitHub repository is called New Age theme. You have two different approaches when you build a new theme: You can construct the model first and create the theme. In this case you could have switchable themes for the precreated content. You can construct the theme first and then build the model. You can build your theme using Razor or Liquid. Both ways you will face with pros and cons: In Razor, the refences are mandatory, but you can write C# code in the templates. Razor is not safe, because its C#. If we let the admins or anyone to write Razor, we let them write C#. If we let them write C#, we let them to have access to everything. Liquid has "noise-free" templates, because there is no need to add references to your files. To use Liquid you have to learn the syntax of Liquid and implement your own helpers to be able to render the requested content in the layout. So, you only have access to the properties that are opted in, it’s like a sandbox. Webhook module You can watch a demo about how to use the new Webhooks module to post a message to a Discord channel when publishing Articles in Orchard Core. This module is still under development, so you will not find the code in the dev branch of Orchard Core. Facebook Login module With the help of this module you can authenticate yourself using Facebook. If you registered to Facebook and to the Orchard Core site with the same e-mail address, you have the ability to link these two account based on the e-mail address by the OpenId client. If the user doesn't exist in Orchard Core, it will create a new one based on the Facebook account's email address. This module is also under development, so you will not find the code in the dev branch of Orchard Core. On Lombiq Conference site with custom Bootstrap template - GPU Day case study The GPU Day conference series organized by the Wigner Research Centre for Physics of the Hungarian Academy of Sciences is dedicated to the fields of parallel and high-performance computing, visualization and data analysis in scientific and industrial applications. On the last three conferences Lombiq presented its cutting edge technology, called Hastlayer. The conference site was developed by Gábor Domonkos from Lombiq here on DotNest which is a great proof of how far you can get using only the built-in DotNest features and Media Theme for theming. If you are interested in the case study about the development of the GPU Day theme, don't forget to visit the DotNest blog! DotNest developer survey We at Lombiq want to make DotNest the best developer-focused Orchard hosting platform around and we can't thank you enough for taking the time to help us understand the best way to do that. If you would like to help us, please fill our short DotNest developer survey.

This week in Orchard - 8/30/2018

Good news for the beginners of Orchard Core! This week you could learn about how to build a new theme for Orchard Core from scratch! On Orchard 1.x If you haven't read the latest post: the latest version of Orchard 1.x (Orchard 1.10.2) released on Apr 27, 2017. The community fixed several bugs since then, so the next release of Orchard 1.x will be arrive soon. We would like to have a working Dynamic Compilation with C# 7 for the next version and Lombiq is working on this issue. After that, the community will release Orchard 1.10.3. On Orchard Core Field settings editors Orchard Core has several fields, for example the Enumeration Field. The issue with these kinds of fields was these fields would be like a new field just to be able to show different editors. For example, if you create a new text field you will be able to select the standard editor or the text area. They are extensibilities for this field to be able to get custom editors. In the case of the enumeration field the editor now is not sufficient, because the community wants to customize the editor itself. Maybe the editor could be a check box list, but sometimes it could be just a simple selection from multiple elements, but in the end, we just have one value, so it's really a text field with an editor that shows multiple possible value. What about having a new way when creating custom editors? Orchard Core introduces a new notion, called settings editors. Till now, you can select editors for your field that could have multiple type of editors. Then each editor might require settings to customize the UI of this editor. Now any field can be extended with custom editors and any module can provide custom editors for any type of fields. A field just need to focus what it stores and not about how its edited. So, editors should be about how do we edit different kind of fields. Let’s see a short demo to make this clear! Demos Field settings editors Let's have a content type called Article with a Subtitle Text Field. If we select the Multi-line option under the What type of editor should be used? dropdown, you will see a new option called Color. This is a setting for the editor. So, the content field itself is a text field, that has access to multiple type of editors and here Color is just an example here. Let's write red here. After that let's create a new Article. Here we can see the Subtitle field, that is multiline. When we type something here it will be red, because this editor will look at its settings to customize the rendering of the editor. The field editor settings are available in the fieldeditors branch. If you are interested about how the community implemented this feature or how you can create new field settings editors, watch the demo about the field editor settings in the recording of the latest Orchard Podcast. Building a theme for Orchard Core from scratch Let's see a possible way about creating a new theme for Orchard Core from scratch based on az existing Start Bootstrap theme, called the Creative theme. If you are using code generation, you can generate a new theme by typing dotnet new octheme -n "ThemeName.OrchardCore" as you can see it in the documentation. For this, you have to install the Orchard Core Cms templates by doing dotnet new -i OrchardCore.Cms.Templates::1.0.0-beta2-* You can also find this command in the same Read the Docs page. But for now, we will only just look at what is the content of an existing project file and simply copy it. To do that, fire up Visual Studio and add a new Class Library (.NET Standard) typed project to your OrchardCore.Themes folder, but don't forget that you can put it anywhere. You can delete the Class1.cs file. To do that, open the csproj file of a theme and overwrite the content of your csproj file with it. You can remove everything that doesn't exist now and just have the following project references: OrchardCore.Theme.Targets: this is require to mark the project as being a theme. It will include some properties that will make it a theme. OrchardCore.DisplayManagement: we will need it, because we will create views and we want to inherit from a Razor base view or will need some tools that are only in display management. Microsoft.AspNetCore.Mvc and Microsoft.AspNetCore.Mvc: we need those for Razor views. After that we need to create the Manifest.cs file. We can copy this file from an existing theme and modify it. The wwwroot folder will serve to store all the static files of this theme. So, add this folder to your project with the Views and Recipes folder. The web app won't be able to load any module that isn't referenced. So you have to add your project as a reference to OrchardCore.Cms.Web project. You can do it in a simple way by just adding a reference using Visual Studio's Add Reference... option. If you want to add a reference to a file that is inside the wwwroot folder, you have to prefix the path of the files with the name of the project. Change the theme to pick up dynamic content and dynamic assets The render_section Liquid tag It's easier to understand the working of the tags by an example: {% render_section "HeadMeta", required: false %} The tag will inject a resource that is needed to be injected, so this will include the HeadMeta. The required: false means that if nothing is injected that's fine, but required: true means there must be something or it will fail. In the lines above we just give you the first few steps about how to start to build your theme. If you are interested in how to create a new theme from scratch in Orchard Core, you should definitely watch Sébastien’s live demo about it. At the end of the video, you will have a great, brand new theme! By watching the recording, you will also learn more about the different Liquid tags that you can use in Orchard Core! On Lombiq DotNest developer survey We at Lombiq want to make DotNest the best developer-focused Orchard hosting platform around and we can't thank you enough for taking the time to help us understand the best way to do that. If you would like to help us, please fill our short DotNest developer survey.