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 >

Improving search filters to the contents list - This week in Orchard (22/06/2021)

We can write about several nice improvements this week! Adding missing deployment steps, new lines about Shortcodes in the documentation, updating the content type editor, and a demo about the search filters improvements to the contents list! Orchard Core updates Deployment steps We have several cases where we have the recipe steps but not the deployment steps. For example, now you can export the Facebook login settings but without secrets (like passwords) because we don't handle that in the recipes right now. The newly added import/export deployment steps are: FacebookLogin GoogleAnalytics Microsoft Azure AD OpenIdValidationSettings Technical name of Content Type and Display Name of Content Parts in Edit Content Type page This feature is about to show a read-only input with the technical name of the content type when you would like to edit the content type definition. With this feature, you can easily see the difference between the display name and the technical name. Of course, you can guess the display name by the technical name, but not everyone knows that. You can check it out easily. Let's just navigate to the admin UI of Orchard Core and go to Content -> Content Definition -> Content Types. Edit one of the content types, and you will see the technical name and the display name of the content type. Shortcodes docs and rename Razor helper We have the HtmlToShortcodesAsync Razor helper that you can use to render Shortcodes. This one is now renamed to ShortcodesToHtmlAsync, and the old one is marked as obsolete. And you can also find some new lines in the documentation about how to render Shortcodes via a Liquid filter or Razor helper. Check allowed file extensions when importing media You can have a list in Orchard Core that contains the file extensions that can be uploaded to the media library. If you would like to upload a PDF file to the media library and the PDF extension is not allowed, you won't be able to upload that. However, if you want to import a PDF file via recipes, you could do that because the file extension checking was missing from there. It could be a security issue but if you have rights to execute recipes, that means you have already logged in as a user who has Security Critical permissions. And one more note here: if you do _logger.LogWarning, don't forget to check is the LogLeveL.Debug enabled _logger.IsEnabled(LogLevel.Debug), otherwise, don't write a warning to the log files. Remove deprecated SHA256CryptoServiceProvider usage While running a benchmark, it started failing, the SDK throwing some warning that the CryptographyAlgorithms.CreateSHA256() is deprecated and cannot be used in .NET 6. The documentation says that now we can do SHA256.Create(), and it works for all the versions that we are targeting. Someone else from Microsoft related to benchmarking and performance mentioned this issue because they are using Orchard Core as a source for the PGO. PGO means Performance Guided Optimizations which is a way to analyze what's happening in an app to optimize the IL generated by the JIT. Demos Improving search filters to the contents list A few weeks ago, you could see a demo regarding search filters and parsers for the contents list. This demo is just about showing you the final version of the search filters that you can also try out right now if you are using the preview packages of Orchard Core! Let's see how you can use this feature that makes browsing your content items much easier! We have a site set up with the Blog recipe. The blog recipe creates an Article content type and one Article content item by default. If you want to list all of the article content items, you just need to navigate to Content -> Content Items and select Article from the filter by content type dropdown menu. As you can see, this means that the Search textbox will be populated with the type:Article expression. It means if you write, type: and the name of the content type, you can list all of the content items from the given type. If you also want to sort the items by the created date (select Recently created from the Sort dropdown menu), the sort:Created text will also appear in the Search textbox. If you click on the funnel icon before the search box and select the Filter Syntax one, you will see a modal window that shows you the available filters. This modal describes all the registered filters that you can use with the given properties. It also shows you the current values of the given filters and a little bit of information about the syntax. And then down the bottom, you just get the current filter and the normalized version of it which describes how it's being constructed. And the same applies to the Users list too (Security -> Users). Here we filtered for the Enabled users where the name contains admin, and where the Administrator role applies. Finally, we sort them by their email address. If you would like to know more about this feature don't forget to check out this recording on YouTube! News from the community Lombiq Utility Scripts: create a trusted certificate Our Utility Scripts project is open source from last year! Many scripts for Orchard Core, Orchard CMS, Azure, SqlServer development. E.g., quick Orchard Core solution init, reset/reinstall. In the following lines, we would like to show you a nice and useful script that could be a very handful one during your Orchard Core development. The CreateTrustedCertificate script creates all necessary files and imports them into the local Certificate Store so that it can be used to access localhost sites via HTTPS. If you open up that file in GitHub, you will find several comments in the script that help you to see what are the steps that are script is actually doing! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 204 subscribers! We have started this newsletter to inform the community around Orchard with the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post is 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!

Orchard branding, Assign Role permissions - This week in Orchard (28/03/2021)

Check out our current post for many interesting topics and demos like updating the branding of Orchard; introducing Noayo, a new Orchard Core hosting platform; a new Orchard Core site, and many more! Orchard Core updates Update branding The issue is that we don't really have concise branding guidelines or even proper branding assets, just what's left over from a long time ago: https://docs.orchardcore.net/projects/O1/en/latest/Documentation/Walkthroughs/#orchard-branding The goal would be to possibly retouch the existing design a bit: E.g. the current logo's outer circle is strangely uneven, and to use a different branding color than the green there or just use those but then we should settle with the same main brand colors everywhere. Let us introduce you Paris Noble, brand strategist and co-founder of Elevate Strategy & Design. For the past 2 years, they've been working closely together with us on many Orchard-related projects that either needed something to do with strategy and/or design. So why do we want to start rebranding Orchard? Branding is super important to make Orchard a widely known, competitive product, to truly make it an industry sensation. And now you can see some logo proposals with a poll on Twitter too! If you haven't voted, please choose the logo that you are like the most. And don't forget to follow this issue on GitHub where you can freely add your opinion about the new logo to make Orchard Core even better! Add .NET 5.0 and netcoreapp3.1 target framework multi-targeting This is about changing all of the target frameworks, all the props files, and targets files to support .NET 5.0 as default. So, now every module is compiled on both, and right now the only target is 5.0, but anyone can define 3.1 because it will work with that. If you want 3.1 by default you can set it. Now you have all the new features of 5.0, but for now, we only used it for performance improvements. When we publish, we need to define what we want to publish for, so again, the Docker files are by default deployed with 5.0 and it's not breaking your existing site. It will still work, there is no breaking change here. Demos Dynamic user permissions - Assign Role We had a demo a few weeks ago where you could see how you can use the new Manage Users in Role permissions which means you can restrict which users you can manage by the name of the role. That means you can delete them, disable them, change their email address, and so on. The new permissions here are the Assign Role permissions in the OrchardCore.Roles feature. Let's see this new addition in a simple example! Let's say we have a user with the Editor role assigned. And we say that users in this role will have the permission named Assign Role - Author. You can set that in the admin UI under Security -> Roles. What does it mean in practice? To see that let's log in with that user who has the Editor role assigned. Navigate to the admin UI of Orchard Core and head to Security -> Users. Here let's hit the Edit button near the admin user for example. As you can see, the Roles list contains every role in the system and you can see that this user has the Administrator role. But all of the checkboxes here are disabled, except the Author one. This user can only assign the Author role to this user because we said that the users with the Editor role can only assign the Author role to users. Head to YouTube to see a short demonstration about this feature! Noayo Noayo is a fictional word that comes from noyau, which is a French word that means core in English. Noayo is an Orchard Core hosting platform and it allows you to create your own Orchard Core instance online. You can use a Bootstrap template for that site. You have two plans: the first one is 5$/month, you have 14 trial days, you will get 300Mb storage, you can have a maximum of 300 content items and 1$ is redistributed to contributors. The 10$ plan has more storage, you can have more content items and that also allows you to use your custom domain. If you would like to request a new account, just hit the Request an account button. In the following demo, you could see the Site management feature of Noayo and a presentation of a given site that runs on Noayo. Head to YouTube now to learn more about Noayo! News from the community A new website using Orchard Core Musica Pristina's purpose is to connect people with a breathtaking musical experience in their home. One where selecting what to play is nearly as enjoyable as listening to it. If you are interested in more websites using Orchard and Orchard Core, don't forget to visit Show Orchard. Show Orchard is a website for showing representative Orchard CMS (and now Orchard Core) websites all around the internet. It was started by Ryan Drew Burnett, but since he doesn't work with Orchard anymore, as announced earlier it is now maintained by our team at Lombiq Technologies. Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 192 subscribers! We have started this newsletter to inform the community around Orchard with the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who you think would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news around Orchard and the details of the topics above, don't forget to check out the recording of this week's Orchard meeting!

Dynamic user permissions, Multi Text Field - This week in Orchard (14/02/2021)

We also have two demos this week! One is about the Multi Text Field, a new field that can be used to define multiple selectable options to a given list, the other is about the new dynamic user permissions, which can be useful if you would like to restrict user management by their allocated roles. Read our post for more! Orchard Core updates Fix autoroute trailing slash Let's say we have a site using Orchard Core, like https://www.orchardcore.net. Here if you select the Legacy Orchard option from the menu, you will be redirected to https://www.orchardcore.net/orchardcms. But if you add a trailing slash after the URL, like https://www.orchardcore.net/orchardcms/, you will get a 404 message. The autoroute entry, in this case, is the orchardcms. Now let's see what was the fix exactly. The logic in the old code wasn't find anything that ends with a trailing slash. The new implementation now find the autoroute because it will trim the / sign from the end of the string. Document that all shells can use a single connection string Orchard Core extends ASP.NET Core IConfiguration with IShellConfiguration to allow tenant-specific configuration on top of the application-wide one. To learn more about ASP.NET Core IConfiguration visit https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration. But what if you want all tenants to access the same database? The corresponding configuration can be kept in a single place, as opposed to setting up the same connection string for all tenants one by one. Check out the updated page on the Orchard Core documentation for more details! Add shortcode resolver to HTML Field GraphQL exposes data but if it contains shortcodes, we need to be able to evaluate them also in GraphQL. Check out the new HtmlFieldQueryObjectType that is about to render the content of the HTML Field. The code also takes into account that we need to sanitize the HTML before rendering or not. Demos Dynamic user permissions We have a permission called Managing Roles that can be used to assign roles to a user but this permission is kind of unused. The goal of this new feature is to split this permission into multiple permissions. Here comes the idea of dynamic permissions, which means the delegation of which users you can manage on the Users page. If you have several users in your system you may want to only allow managing a given group of users. Let's see what it means in practice! We set up the site using the Blog recipe and headed to Security -> Users and added several users with different roles. We just using the predefined roles now and added two users for each role. Now let's imagine the following scenario: we would like to allow users with the Editor role to be able to manage the users with the Author role. It can be done right now, but we want to restrict the users with the Editor role to be able to manage ONLY the users with the Author role. To do that, navigate to Security -> Roles, hit Edit near the Editor role, and find the OrchardCore.Users Feature section. Here you will see several new permissions. The View Users permission is about to be able to see the content of the Users page or not, the Manage own user information is about to be able to edit the own information. And we put a tick in the checkbox near the Manage Users in Role - Author text. Now let's try out the new permissions by logging in with the editor user. Head to the admin UI, navigate to Security -> Users (we can see that option because we say that users with the Editor role have the View Users permission), and hit Edit near a moderator user. Users with the Editor role cannot manage users with the Moderator role, which means we will see only disabled editors here, we cannot really edit anything on this page. But if you would like to edit a user with the Author role, you will be able to do that because we allowed that on the Roles page for the Editor users. If you would like to know more about this feature, don't forget to head to YouTube to check out the recording! Multi Text Field Set up your site using the Blog recipe. To try out the new Multi Text Field we will edit the content definition of the predefined Article content type. To do that, head to Content -> Content Definition -> Content Types and hit the Edit button near the Article. Here choose the Add Field button and select the Multi Text Field as the Field Type. When you add a Multi Text Field, you can provide options to your predefined list that can be used when working with the given instances of this content type. You can set the labels and the values and also select the default one(s). You can also have several editor types for the Multi Text Field, like Standard, Picker, or Checkbox List. You can see the different editor types in the following GIF. You can also see a short demo on YouTube about this new field. Check it out now! News from the community Work with us! You've completed the Dojo Course, congratulations! You’re now officially an Orchard Core developer. Would you like to work on a variety of challenging Orchard Core projects with the biggest Orchard team in the world? Work with us! Just send us an e-mail to crew at lombiq.com. Please include what you’re most interested in professionally and attach around 100 lines of any kind of code that you’re especially proud of or just link to the favorite open-source project of your own on GitHub or else. Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 192 subscribers! We have started this newsletter to inform the community around Orchard with the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who you think would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news around Orchard and the details of the topics above, don't forget to check out the recording of this week's Orchard meeting!

Admin Dashboard Widgets, GitHub Issue Templates - This week in Orchard (24/01/2021)

This week we will see the new issue templates in GitHub, the new View Media Options permission, and have a demo about a nice upcoming feature called Admin Dashboard Widgets! Check out our current post for more! Orchard Core updates Adding documentation for Resources Libraries If you navigate to the OrchardCore.Resources project and open the ResourceManifest.cs file there you can see the list of the resources used by Orchard Core by default. That means if you would like to use jQuery for example in your site, you don't have to add this resource again from your theme or module because Orchard Core already has it. The goal of this table in the documentation is to collect all the used libraries with their versions. New View Media Options permission You can use the appsettings.json file to configure different media options like the supported sizes, allowed file extensions, and so on. But if you don't remember the exact values off the top of your head you had to open the appsettings.json file to check out the configuration values. To solve this issue, you can just easily navigate to Configuration -> Media -> Media Options that means you just need the admin UI of Orchard Core to see the values. And now you will find new permission called View Media Options that can be used to control who can be able to view the content of this site. GitHub Issue Templates If you found a bug while using Orchard Core or you just have a suggestion or an idea to make the CMS better, feel free to add a new issue on the GitHub page of Orchard Core. All you have to do is to select the Issues tab and click on the New issue button. This will navigate you to a new page where you can select what kind of issue you would like to submit. You can see three different kinds of options here: Bug report, Feature request, and Discussions. If you select the Discussions one, you can start a new discussion. GitHub Discussions is a collaborative communication forum for the community around an open-source project. Community members can ask and answer questions, share updates, have open-ended conversations, and follow along on decisions affecting the community's way of working. Check out the existing discussions related to Orchard Core here! But if you found a bug or have a new feature request, select from the first two options. If you do that, you will be redirected to these pages. Here you can add your issue by using nice issue templates that help us to investigate the given bug, like how can we reproduce your issue. Or if you have a feature request, the template could help us to understand better what is the problem that can be solved by adding this new feature to the system. Feel free to try out and use them when submitting new issues! Refactor media tokens This is about replacing the used Data Protection to encrypt tokens, as the encrypted token changed every server restart (because of course encryption should never produce the same value twice, for a given input). This caused the browser and/or CDN to refresh all the images every time the server is restarted/deployed. The is-cache wasn't affected by this, just the browser/CDN caches. Demos Admin Dashboard Widgets A few weeks ago we wrote about an upcoming new feature called Admin Dashboard that allows you to add cards to the homepage of the dashboard, which is about to represent a piece of functionality of a given feature or module. This feature is still under development and it has changed in the meantime a lot, so it's time to check out the newest improvements! First of all, go to Configuration -> Features and enable the Admin Dashboard feature. If you do that, you will see the following screen when you navigate back to the homepage of your dashboard. You can see one predefined card here with the title Orchard Core, and at the bottom of the card, you can see an Edit and a Delete button. Let's click on the Edit one! As you can see this is an Html Dashboard Widget content type with a Title Part and a HtmlBody Part attached. But under that, you can see a textbox called Position. By using that setting you can control the order of your widgets on the dashboard. We have just this one, so whatever you type here, this will be rendered as the first widget. If you click on the Add Widget button on the dashboard, you can create as many other Html Dashboard Widgets as you want. But now let's look under the hood and see how you can create custom dashboard widgets! Navigate to Content -> Content Definition -> Content Types and create a new type, call it Markdown Dashboard Widget. Add the Title Part, the Markdown Body Part, and the Dashboard Part to it. The Dashboard Part is the one, that you will need to attach to every content type that you would like to mark as a dashboard widget. By using that part you can set the Position of your widget. And the final thing you have to do is to set the stereotype of your content type to DashboardWidget. Now let's get back to the dashboard of the admin UI and select the Markdown Dashboard Widget after clicking on the Add Widget button. As you can see, if we set the position to 1, it will be rendered after the predefined one with the title Orchard Core. If we modify the value of the position, we can change the ordering of the widgets. But that's not all! Head to YouTube now to see a video about this upcoming new feature! News from the community Execute an Orchard Core shape into HTML sample in the Lombiq Training Demo for Orchard Core The Lombiq Training Demo for Orchard Core is a demo Orchard Core CMS module for training purposes guiding you to become an Orchard developer. You can use this module as part of a vanilla Orchard Core source that includes the full source code - which is the recommended way. You can also use it as part of a solution that uses Orchard Core NuGet packages, however, it's harder to look under the hood of Orchard Core features. And now the module just got a new sample about how to execute an Orchard Core shape into HTML! Check it out now if you're learning Orchard and you haven't seen this feature yet! Work with us! You've completed the Dojo Course, congratulations! You’re now officially an Orchard Core developer. Would you like to work on a variety of challenging Orchard Core projects with the biggest Orchard team in the world? Work with us! Just send us an e-mail to crew at lombiq.com. Please include what you’re most interested in professionally and attach around 100 lines of any kind of code that you’re especially proud of or just link to the favorite open-source project of your own on GitHub or else. Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 185 subscribers! We have started this newsletter to inform the community around Orchard with the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who you think would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news around Orchard and the details of the topics above, don't forget to check out the recording of this week's Orchard meeting!

User Picker Field, the new user ID - This week in Orchard (06/12/2020)

This time we will do a little deep dive and check out some important changes in the code base of Orchard Core. But don't be scared, we promise you will like these changes, especially the demo about the new User Picker Field! Orchard Core updates Allow media width and height values without a token You could see a demo a few weeks ago in this post about the new options for Media Field where you can set the alt text of your image and you can also crop your images using a nice media crop picker. The way it was working is it's putting different kinds of options to the query string that allows you to manipulate your image. Let's see the following URL for an example: https://localhost:44300/media/post-bg.jpg?width=1&height=600&rmode=crop&rxy=0.2,0.5. Here you can see we set the width and height of the image from the media library. We also set the resize mode for the processed image with other parameters as well. A few days later the community introduced a new bool option added to the MediaOptions called UseTokenizedQueryString to encrypt the image processing query string to prevent disc filling, that is true by default. And now here comes another great stuff that allows values for width and height to be provided via the query string even when tokens are enabled. What does it mean? Let's see an example of it! Set up your site using the Blog recipe then open the default banner image URL of the predefined blog post with the following query string parameters: https://localhost:44300/media/post-bg.jpg?width=1024&height=600. Note that the tokens are enabled by default, but you can still set the width and the height of the image now. Don't forget that this will only work if the height and width values match the supported sizes array values. Introduce Culture Scope There is a new CultureScope class that you can use if you want to locally set the current culture (the current user interface culture and the culture used by the current thread). You can find several unit tests to see how you can use it, but check out this one for now. Here you can see that the culture is set to French, but that setting only applies inside the using statement. Implement UserId All the user profiles that you have locally, now have a new property called UserId, which is unique. We used to use a name, the user name as the way to identify a user. But now the community decided to use a unique ID such that you can't guess user ID or you can't recover another set or permission or ownership by mistake, because an account has been deleted and someone created a new account using the old name and somehow the logical references are still kept based on this name and you would inherit something from that. So, to prevent that, Orchard Core is using now a user ID. If you take the latest version of the dev branch and just run your code there will be a migration that copies the user names of the existing users as the user ID. This way you don't have any change in your content, it will still work the same and be careful that your user ID equals a string like 4gq8jagmrtxrwvg21csa0b6y4y, which is safe, because the next time someone creates a new user, they can't impersonate anyone else like recovering an old account, because it will be a newly generated unique identifier that can't match something like that. And how can you find the currently logged in user? Check out the code in the DefaultContentsAdminListFilter where you can see that now, instead of using the user.Identity.Name, you can use the FindFirstValue extension method from ASP.NET Core to return the value of the first instance of the specified claim type, or null if the claim is not present. And then you can set that value as the Owner of the content item. Demos User Picker Field Let's say you would like to create a blog where multiple users can create blog posts and you want to connect the user account of the author user with the given blog post by showing the name of the user somewhere in the detail view of the post. It's easy because the users can log in to the admin UI of Orchard Core and publish their own posts. In this case, they will be the authors of the given content items. But let's say we don't want to give them access to the site. We just want them to send the content of the blog post to a given email address and the site editors will edit and publish the posts. Is there an easy way to connect content with user accounts in Orchard Core? Set up your site using the Blog recipe. This recipe comes with a predefined blog where you can create new blog posts. The posts can have several properties: the title, the banner image, tags, the category, and so on. We will modify the content definition of the Blog Post to do some tricks. Navigate to the admin UI of Orchard Core and head to Content -> Content Definition -> Content Types and edit the Blog Post one. Click on the Add Field button and find the recently added one, called User Picker Field. This field allows you to connect users with a content item. Here you can say that you want to allow multiple users to be selected, allow the picker to display users from all roles, and many more. If you put a tick on the Display All Users checkbox, every user will be in the list that you can choose from, if you remove the tick, the available roles in the system will be listed and you can choose from them. Now if you edit the predefined blog post, you will see the User Picker Field in action. In this case, we have two users in the system named admin and editor. The admin is the superuser with the Administrator role and the editor user has the Editor role. We can see both of them because we said we would like to allow the picker to display users from all roles. If you save your content item, the field will show you the user names of the selected users seperated by a comma (if you selected multiple ones). And you will see a No users. message is you haven't selected any users. You can find some lines about the User Picker Field in the documentation of Orchard Core and a nice presentation of this feature on YouTube! News from the community Our full Orchard Core tutorial series, the Dojo Course 3 is here! After a long wait, the new Orchard Core version of our legendary Dojo Course tutorial series is here, the Dojo Course 3! Are you a newcomer and want to learn Orchard Core from the ground up, both from a user's and a developer's perspective? Are you somewhat familiar with Orchard Core but would like to get up to speed and become an Orchard pro? Look no further, check out Dojo Course 3! Dojo Course 3 guides you from the very basics of Orchard Core all up to be able to write your own themes and modules, utilizing various APIs of Orchard. We're publishing a tutorial video every day for 40 days starting on 1 December. So, this is your 40 days of Orchard :). In the first few videos, we gave you an introduction to Orchard Core and showed you a way about how to set up your first Orchard Core website. After we started to talk about the content model of Orchard Core, checking out the basics of content management. We will stay in the admin UI for a little in the upcoming days and check out the other basic features of the CMS like how to add widgets with layers, managing the menus, and the media files. After we will see how can you search and index content items, and build forms using the Forms and Workflows feature. But we will not spoil the topics of the upcoming videos. :) If you're looking for our previous Orchard 1.x tutorial series check out Dojo Course 2. Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 172 subscribers! We have started this newsletter to inform the community around Orchard with the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who you think would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news around Orchard and the details of the topics above, don't forget to check out the recording of this week's Orchard meeting!

Custom User Settings, Advanced Markdown Extensions - This week in Orchard (27/11/2020)

Now it's easier to extend the user setting than ever thanks to the new custom user settings feature! Create advanced Markdown with the new extensions, use the new isInRole layer rule, and many other great things in Orchard Core! Check out our current post for more! Orchard Core updates Use Advanced Markdown extensions Set up your site using the Blog recipe and navigate to the admin UI to edit the predefined blog post. You can use a Markdown editor to edit the body of your blog post. To convert the Markdown string to HTML, Orchard Core using Markdig, which is a fast, powerful, CommonMark compliant, extensible Markdown processor for .NET. This processor has a great extensible architecture with more than 20 built-in extensions to allow footnotes, support emojis, and smileys, adding figures, enable Bootstrap classes, and so on. You can check out the features section of the readme.md file to know more about these extensions. And the good news is now you can select which extension you want to enable by just setting different configuration values in your appsettings.json file. The default option is to turn on the nohtml extension (that disables HTML support) and the one called advanced, which enables advanced Markdown extensions. By turning on the advanced extension, Markdig will use every extension except the BootStrap, Emoji, SmartyPants and soft-line as hard-line breaks extensions. On the screen above you can see we also turn on the emoji extension. Let's try this out quickly! Here you can see we added some Emoji shortcodes and smileys to the blog post and they are converted to their respective Unicode characters. And we also added a task list at the end of the blog post that comes from the TaskLists extension that is enabled by default because the TaskList extension will be enabled if you say you want to use the Advanced Markdown extension. You can read more about Markdown configuration in the Orchard Core documentation too! Add isInRole layer rule Let's say we would like to create a layer that contains widgets that are only available for users who are in the Editor role. We cannot do that easily until now, so let's try out the newly added isInRole layer rule! Set up your site using the Blog recipe then head to Design -> Widgets in the admin UI. Here you can see the two predefined layers: Always and Homepage. Click on the Add button to create a new layer. The only thing we have to do here is to set the Rule to isInRole("editor"). Now put a widget to this layer and create a new user with the editor role. If you log in with that user you can see the widget in the Content zone of the theme. Add CloneContent Permission as Content Type dynamic permission Navigate to the admin UI of your site then head to Security -> Roles and hit the Edit button near an arbitrary role. Now type the clone word in the search box that will list the new clone content permissions. This means now you can set the clone content permission for every securable content type (a content type that can have custom permissions). Improves Document Options and Compression MessagePack for C# is an extremely fast MessagePack serializer for C#. It is 10x faster than MsgPack-Cli and outperforms other C# serializers. MessagePack for C# also ships with built-in support for LZ4 compression - an extremely fast compression algorithm. Performance is important, particularly in applications like games, distributed computing, microservices, or data caches. And now this package is part of Orchard Core. Orchard Core using MessagePack to GZIP content, because there is an option in MessagePack to also compress it. There is a new IDocumentSerialiser to say how to serialize into a sequence of bytes or deserialize from a byte array. JSON.NET can serialize anything, but if there is an issue with a custom document, we can use MessagePack to customize the way how to serialize content from the distributed cache. Demos Custom User Settings Set up your site using the Blog recipe. Now navigate to the admin UI and head to Configuration -> Features to enable the new Custom User Settings feature that allows content types to become custom user settings. After we can create a new content type that will be responsible to store the custom user settings. To do that, head to Content -> Content Definition -> Content Types and create a new content type. The most important thing to do here is to make the stereotype CustomUserSettings and remove the ticks from the Creatable, Listable, Draftable, etc, checkboxes. We named our content type as User Profile and attached three fields to it: a media field to store the avatar of the user and two text fields to store the first name and the last name of the user. We haven't added any content parts to this content type. Let's navigate to Security -> Users and edit one of the users in the system. Here you will notice a new tab near the Content one with the name User Profile. That's because we named our content type User Profile. Here we specified the first and the last name of the user and attached an image to it. If you hit Save, you can persist your changes for this given user. Now it's time to use our custom user settings from code. The Orchard Core documentation has a great detailed page about how you can get the custom user settings using Liquid, how to adjust the placement, and many more. Notice the brand new users_by_id Liquid Filter that you can use to get the User object from the database by a user ID. But how can you get your custom user settings in C#? Well, that's also quite simple! The User class in Orchard Core implements the Entity class, which has a JObject property called Properties. And inside the Properties, you can find the whole UserProfile content type with it's attached content parts and fields. { "Email": "[email protected]", "EmailConfirmed": true, "Id": 18, "IsEnabled": true, "LoginInfos": [], "NormalizedEmail": "[email protected]", "NormalizedUserName": "ADMIN", "PasswordHash": "AQAAAAEAACcQAAAAECfRTVdPZm1meRWrxja3vzbJlslet72QzrqSsPKxOeeGKQs7bcMVeTYRSNrhc2yjpw==", "Properties": { "UserProfile": { "Author": "admin", "ContentItemId": "4k7hmhyywz1ettg2hkv5xpcfxz", "ContentItemVersionId": null, "ContentType": "UserProfile", "CreatedUtc": null, "DisplayText": null, "Latest": false, "ModifiedUtc": "2020-11-24T14:36:36.8629171Z", "Owner": null, "Published": false, "PublishedUtc": null, "UserProfile": { "Firstname": { "Text": "Admin" }, "Image": { "MediaTexts": [ "" ], "Paths": [ "c827782e12851cd2cf4c5161c4f5445a.jpg" ] }, "Lastname": { "Text": "Orchard" } } } }, "ResetToken": null, "RoleNames": [ "Administrator" ], "SecurityStamp": "FAALQXTJCDTD5EOVTLCW6N75CW3BOVYU", "UserClaims": [], "UserId": "4gq8jagmrtxrwvg21csa0b6y4y", "UserName": "admin", "UserTokens": []} Navigate to the CustomUserSettingsDisplayDriver and check out the GetUserSettingsAsync private method. Here you can see the way about getting the custom user settings content item from the Properties array. And after you can easily work with the properties of your content item. And that's not all of it! Check out this recording on YouTube to know more about this great, useful feature! News from the community Introducing 40 days of Orchard Core: Dojo Course 3 is here! We've been hard at work to bring you the updated, Orchard Core version of our legendary Dojo Course tutorial series, Dojo Course 3! If you want to become an Orchard Core developer, Dojo Course 3 is for you! Starting with the 1st of December we'll publish a new Orchard Core tutorial every day for 40 days on our YouTube channel. Be sure to set a reminder for the premiere video and subscribe if you want to see them just as they come out! If you're looking for our previous Orchard 1.x tutorial series check out Dojo Course 2. Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 169 subscribers! We have started this newsletter to inform the community around Orchard with the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who you think would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news around Orchard and the details of the topics above, don't forget to check out the recording of this week's Orchard meeting!

Shape Components, new Anchor Tag Helper - This week in Orchard (11/09/2020)

We prepared with an interesting topic for this week about how could you use shapes like reusable Angular components? But before that, we checked the latest updates of Orchard Core, like the new updates around Tag Helpers. Orchard Core updates Add UI permissions based on the user role This is about hiding some buttons based on the permissions, instead of returning the 401 page when clicking on those. What do we mean? Well, let's say we have a permission that doesn't contain a role to publish or unpublish pages. That means users with that permission can't see the Publish button at the bottom of the editor in a case of a Page content item. Meeting information in the documentation When you open the Orchard Core documentation page and navigate to Resources, you will find a new link in the Resources column at the left called Meeting. If you click on that you will see a brand new page where you can find every relevant information about the steering committee and the triage meetings. Support for dropping a password from a password manager during setup Some password managers let you drag and drop a password to a textbox. During setup, if we do this rather than focus then type or paste, the tick appears in the input, but the strength indicator doesn't update and clicking Finish setup just does nothing with no indication. The fix was to update the strength.js file to check for the drop event. Add missing Tag Helper references The root of this issue was the Tag Helpers are found during development because of the runtime compilation. But when you change the environment from development to production, it stops working if you don't have a direct reference on the ResourceManagement project. The compilation doesn't find the issue, because it's a runtime resolution. Yes, you can use the a tag it will compile, but in runtime, it has a different behavior based on the projects you reference and you don't get the behavior you expect. The only thing you can do is to have a functional test to be sure that it would work. Tag Helper for the anchor tag with asset-href attribute Added an HtmlTargetElement to the Anchor Tag Helper to also address anchor tags with asset-href attributes. Added needed const and property and changed the Process logic to require non-null asset-href for anchor tags. So, if you use the asset-href in the anchor tag, it will convert the URL of a media URL to a public URL. Demos Shape Components What makes it hard to build a new site using Orchard Core? The ultimate solution would be to remove the templating in Orchard and just use decoupled. So, you don't have to know about shapes at all. And then you just write your pages, your controllers, you have lot's of APIs to get your content, you can reuse ASP.NET caching and do your decoupled site like this. It would be a decoupled site. Let's just forget about shapes and rendering everything from modules. Just let people render their own things and provide tools to render the site. It might be slower at first to build the site, but they will never be blocked by 'I don't know what a shape is.' or 'I don't understand how shapes work.', 'What is placement?' and so on. We have themes and recipes today that build some predefined solutions, like a blog or an agency site and they can be extended to anything. For that, you still have to understand all the shape- and display mechanisms to build these elements. A new solution would be to still create recipes, but recipes that would contain Razor Pages and controllers and anything that would build a blog even if we didn't have shapes and placement and everything. Like build a decoupled site that is a blog and this is the recipe. When you install it you have the same blog, the same theme working and if you want to change it, you don't have to learn shapes. You just look at the page that renders the blog, the blog post and you just change it. Or you create a new one and change the code directly. This would be just ASP.NET, there is nothing new to learn out of ASP.NET. That would be a solution to have. But let's say the issue is not about the shapes, because shapes are great. The issue is zones and placement. And these are harder to learn. Shapes in the end, if you just take shapes by themself, they are just dynamic ViewModels that have alternates and that can be rendered using templates. It's like a view component in ASP.NET. But it's like a view component with more features like it can have an ID, CSS classes, attributes, it can have dynamic behavior, it can have a caching, it has alternates. So, it has a dynamic resolution of templates, which the view component doesn't have. Let's think about a shape like a reusable component, like a view component in ASP.NET, but like an Orchard shape component, that can be reused. Were we able to pique your curiosity? Then just navigate to YouTube and see this exciting demo about shape components! News from the community Orchard Dojo Newsletter Now we have 160 subscribers of the Lombiq's Orchard Dojo Newsletter! We have started this newsletter to inform the community around Orchard with the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who you think would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news around Orchard and the details of the topics above, don't forget to check out the recording of this week's Orchard meeting!

New Orchard Core theme, Make Content recipe step idempotent - This week in Orchard (16/05/2020)

Are you tired of the existing built-in themes in Orchard Core? Do you want to try new ones? Well, let us show you a brand new theme called The Medium Theme! The scheduled publish feature now can be used with the nightly build packages! And if you want to expand your knowledge you can read about the security-critical permissions, the new methods in the IContentHandler interface, and many more! Orchard Core updates Make FormPart generic Now you can customize a FormPart attached to any content type and define the enctype to use when submitting the form using POST method or you can enable the Antiforgery Token if you want. You can also customize the wrapper around your form. Just enable the Forms module and attach the FormPart to your type. Then you will find the following screen when editing your content type. Render BagPart items with Summary display type If you have widgets inside a BagPart, they would be displayed with the Detail display type and shows unnecessary stuffs. But the whole thing is quite weird. Why would you add a widget to a BagPart? For widgets, you can use the FlowPart and add widgets there. BagPart is for content items not for widgets. If they are in BagPart it will break your themes if you have provided custom templates for widgets using the Detail display type instead of the Summary one. You can still change the display type for the items in the BagPart to another display type if you want to customize the rendering. Here you could see a widget Summary template (Widget.Summary.cshtml) that would be used in case if you render a widget inside a BagPart because it will use the Summary display type. So, in a nutshell: BagPart will render content items as Summary display type. If any content type template was customized for Detail (Content-Foo.cshtml) in BagParts, it will need to be changed to the Summary display type (Content-Foo.Summary.cshtml). Make content recipe step idempotent If you check the IContentHandler interface you will find some new endpoints: ImportingAsync ImportedAsync ValidatingAsync ValidatedAsync The goal of these new methods is that any import or API call to query content have to be idempotent, meaning that the same action will be executed multiple times and that will result in the same effect, like if you say create a content item with the ID = 1, the first time it will create it, the second time it will tell you it's nothing to do because it's already done. Or if you call delete something 10 times, it will do it for the first time and don't do anything for the next one, don't break anything, just tell you that the call is already done. But if you say create new items 10 times, it will create them 10 times, depends on the parameters you pass. Let's see an example in the AliasPartHandler. If you try to import a content item with an alias that already exists, the result will be a fail with an error Your alias is already in use. Update configuration docs There is a section in the documentation that now shows you how to create a tenant just from the configuration. Add Scheduled Publish functionality Some weeks ago we showed you an upcoming feature to Orchard Core that is about to publish a content item in a given time in the future. Now, this feature is merged to the dev branch of Orchard Core, so if you are using the nightly builds of Orchard Core, update to the latest and try out this feature now! If you haven't heard about this module yet, check out the demo about how to use it on YouTube! Make Import Data a security-critical permission As a reminder, security-critical permission is a permission that could enable you to elevate your permissions and abuse a feature to become a super admin. There are some critical features in Orchard Core like running a recipe. If you run a recipe you can enable any feature, a feature that might give you access to anything or change some content that might give you access to anything. The Import Data Permission should be listed as security-critical because with it you can import any data to the site, including changes to roles, which could elevate permissions. The way how you can create security permissions can be seen for example in the Permissions class of the Deployment module. Demos New Orchard Core theme: The Medium Theme The Medium Theme is a free, open-source theme that you can find in the following repository. Sipke Schoorstra decided to create an Orchard Core theme based on The Medium Theme and make it open-source. This repository not just containing the theme itself, but you can find there some useful features too. Later, the theme will get its own repository. The comments are not supported yet, but that's on the roadmap that you can also find in the Readme.md file of the repository. The blog posts are associated with owners, for that the User extended with a couple of settings. Blog posts can have tags and you have many other features to use in your theme. If you are interested in everything about the new theme, don't forget to check the following recording on YouTube! News from the community Stability updates for our Orchard Visual Studio Extension Lombiq Orchard Visual Studio Extension is a Visual Studio extension with many features and templates frequently used by Lombiq developers. It contains Orchard-related (including Orchard Core) as well as generic goodies. This extension has an Orchard Log Watcher feature, that alerts you when you have any new entry in the log file. When you install this extension, you will see a new button on the Orchard Log Watcher toolbar. The button of this toolbar will be enabled when you have unread entries in the error log files. If you click on this button, the log file will be opened with the editor assigned to open .log files. And that's not all of the features of this extension! This week we released a new version that contains stability updates that fixing some potential embarrassing UI freezes. If you have it installed, the update will arrive automatically, otherwise check out here the open-source extension. In GitHub, you can find the extension's Readme with release notes too. Also, if you encountered bugs or have a feature request please add it on the GitHub page as well. Lombiq and open-source Open-source software is something we live and breathe. Check out how we contribute to the very foundation of the IT world by reading the Lombiq and open-source post on our website! Orchard Core workshops The contributors of Orchard Core will hold some unique online workshops in the coming months, between May and September 2020. So even with Orchard Harvest postponed due to the coronavirus pandemic we'll get some new learning events. Lombiq's developers will also give two workshops, on using Orchard from the admin UI and on developing a module. Are you looking to get up to speed with Orchard? Check out the workshops' details on the Orchard Core homepage! Orchard Dojo Newsletter Now we have 145 subscribers of the Lombiq's Orchard Dojo Newsletter! We have started this newsletter to inform the community around Orchard with the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who you think would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news around Orchard and the details of the topics above, don't forget to check out the recording of this week's Orchard meeting!

This week in Orchard - 07/19/2019

New Media Library web search providers for Orchard 1.x, improved documentation, and demo about the ability to set localization cookie when using the Content Culture Picker in Orchard Core. Read our post for the latest news around Orchard! On Orchard 1.x Demos New Media Library web search providers If you navigate to the modules, you will see some new ones in the Media category: now you can have Bing, Google, and Pixabay web search providers! Let's enable them and see how you can use it. For any web search provider that you would like to use you need to have an API key and provide them to Orchard under Settings -> Media. Now head to the Media Library and hit Import. Then select Web Search from the list to get the Search text box and a select list near that. Here you can use those web search providers, that you have provided an API key for. For example, let's choose Pixabay. If you select one or multiple files and hit the Import button, the selected files will be downloaded and Orchard puts them in the folder you have previously selected. Thank you for the contribution to Milán Keszthelyi from Lombiq Technologies! On Orchard Core Role-based permissions to display admin menus In the following GIF, you can see two admin menus (admins only and contributors only). Their visibility is configured from the roles page. If you logged in as an administrator, you can see both, but if you are a contributor you can only see one of them. Being able to see an admin menu doesn't mean you can see everything inside it, of course, normal permissions still apply. For example, a contributor can see the link menu, but can't see the content types links if they don't have the right permissions for them. Consuming Content Parts and Fields using C# For a while now it's possible to get strongly typed versions of Content Parts and Fields using Orchard Core. Thank's to John Rom, he wrote great documentation about how you can do that! Demos Content Culture Picker - Add ability to set Localization Cookie Last week we wrote about the Content Culture Picker feature of Orchard Core. The Content Culture Picker module helps you to manage cultures for the frontend and now comes with two now options you can set. If you enable the Content Culture Picker module, you can head to Configuration -> Settings, where you will see a new option, called ContentCulturePicker. Here you can decide to set the localization cookie when switching between cultures (this is enabled by default) and to redirects to the homepage of the target culture if the ContentItem of the target culture does not exist. The documentation is also updated about how to set the cookie from the admin site of Orchard Core or by using a recipe step. On Lombiq Orchard Dojo Newsletter Now we have 80 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 - 05/17/2019

In our post, we would like to give you some tips about how to write localizable text in Orchard Core. We check the new User liquid filters, the new Twitter integration and many more! On Orchard Core Add various User liquid filters We already had the User object in liquid and now we have the has_permission filter to check for named permission and optionally a resource to check for. We have the is_in_role filter to check if the user is in the role and the has_claim filter to check if the user has a claim of the specified type. Workflows Internalization This PR has three changes related to localization. First of all, the State text in the OrchardCore.Workflows/Views/Workflow/Details.cshtml file was not translated. The second one is more interesting. In the OrchardCore.Workflows/Views/Workflow/Index.cshtml we render the status of the workflow. The status can be Idle, Starting, Resuming, Finished and so on. This is an enumeration. These will be rendered as is in the output, they were not translated. Translating as you can see here could be fine because it's just a static value. The issue is nobody will be able to translate them because we don't know they have to be translated. The solution, in this case, is to use a switch statement. So, enums should be localized using a switch statement that resolves to calls to T[] with the static string inside it. This way our tool will be able to pick it up and add the entry in pot files. The last point for translation is tricky. It's not a dynamic value (a class) and it can't be solved with a switch. The solution here is to add a new property on the activity to return a localized string, like DisplayText. Add create new option to Publish and Save Draft buttons Now we have a Publish button with one suboption called Publish and continue.This PR extends this and adds a new suboption which is Publish and create new. The Save Draft button will also get a new option to Save Draft and create new. Twitter client and update status workflow activity In this PR, Michael Petrinolis extends Twitter Module with a Twitter API client and an Update Twitter Status workflow task. To use the new Twitter integration and the new Update Twitter Status activity, you need to enable the Twitter Integration module. Now you can navigate to the Twitter Integration page in the admin site, where you need to provide four different settings: API key: The API key defined in the Keys and tokens tab of the Twitter app dashboard. API secret key: The API secret defined in the Keys and tokens tab of the Twitter app dashboard. Access Token: The Access Token defined in the Keys and tokens tab of the Twitter app dashboard. Access Token Secret: The Access Token Secret in the Keys and tokens tab of the Twitter app dashboard. To get these settings, you need to create a new Twitter application where you can get these values. Now you can use the new Update Twitter Status Task. Let's say we would like to post a new tweet when a new blog post has been published to our site. We can use the Content Published Event as a startup task and set the Blog Post content type to filter on. After add the Update Twitter Status Task and provide a title and a template for updating Twitter status. Bethany Christian Services using Orchard Core Bethany Christian Services using Orchard Core for their website. Bethany believes every child deserves to be loved, connected and empowered through the family. Bethany is a global nonprofit that supports children and families with world-class social services, all designed to help families thrive. APS Medical Billing Solutions using Orchard Core APS understands that it takes experience to run a successful healthcare business, and they are dedicated to finding solutions that fit your specific practice requirements. The team of qualified medical billing specialists work with each practice to create value through customized service. If you are interested in more websites using Orchard and Orchard Core, don't forget to visit Show Orchard. Show Orchard is a website for showing representative Orchard CMS (and now Orchard Core) websites all around the internet. It was started by Ryan Drew Burnett, but since he doesn't work with Orchard anymore, as announced earlier it is now maintained by our team at Lombiq Technologies. On Lombiq Orchard Dojo Newsletter Now we have 61 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!