Lombiq Privacy for Orchard Core, Target .NET 6 by default - This week in Orchard (19/11/2021)

Gábor Domonkos's avatar
Documentation, This week in Orchard, Shortcodes

New guide to the document, new asset_url Shortcode, targeting .NET 6 by default, and demo about the Lombiq Privacy module for Orchard Core. Do you want to know more? Then don't forget to check out our current post!

Orchard Core updates

Add [asset_url] shortcode

The new asset_url Shortcode can be used to render the image URL only. Let's see a short example for this one. We have a site set up with the Blog recipe, and we decided to create a new blog post. The blog post content type has a MarkDownPart attached that supports using Shortcodes. You can type the [asset_url][/asset_url] by yourself, or just easily click on the Insert Shortcode icon and find the asset_url one in the Media category. Make sure you have some content in your Media Library and enter the file name of the asset. We have an Orchard Core logo at the root of the Media Library with the file name orchard-core-symbol-logo-color.png, so let's use that one.
As you can see, if we provide the file name, the asset_url returns the relative URL from the site's media library. You can see we have a tenant here with the name blog1 and the file is in the root folder of the media library.

Using the asset_url Shortcode

If you would like to know more, head to this page of the Orchard Core documentation, where you can read about the parameters that you can use with this Shortcode.

Documentation for the asset_url Shortcode

New how-to guide: creating the pieces needed to query content based on assigned taxonomies

If you head to this page on the Orchard Core documentation, you will find a new guide for creating a query that allows searching across multiple assigned taxonomies. At the end of the guide, you will have the pieces needed to search through blogs to find only the ones with specific tags assigned.

Creating the pieces needed to query content based on assigned taxonomies guide

Target .NET 6 by default

.NET 6 was released on the 8th of November and the community already updated Orchard Core to use .NET 6 by default. So, the main branch targets .NET 6 by default which means if you clone that branch, you will need to have the .NET 6 SDK. If you go to dotnet.microsoft.com, you can easily download the latest SDK.

Orchard Core now also builds and runs the tests using .NET 6. The targets are defined in the CommonTargetFrameworks of the Dependencies.AspNetCore.props file, where you will see .NET 6, .NET 5 and .NET Core 3.1. By default, if you open Visual Studio, it will target .NET 6, but when you build on the command line, you can define which target you want. So, if you want to publish a self-contained, you can do --framework and provide the framework you want or change the value of the DefaultTargetFramework property. The same applies to the Docker deployments. And one reminder: if you are using Visual Studio and want to use .NET 6, you will need to download Visual Studio 2022 because Visual Studio 2019 has no support for .NET 6.

Target .NET 6 by default


Lombiq Privacy for Orchard Core

The Lombiq Privacy for Orchard Core is an Orchard Core module containing features related to data protection/privacy and the EU law on it, the General Data Protection Regulation (GDPR).

In this demo, we will go with the quicker way and use our Open-Source Orchard Core Extensions full Orchard Core solution that contains that module. If you clone that repository and set up your site using any setup recipe, let's just navigate to the admin UI of Orchard Core, and under Configuration -> Features, enable the following features:

  • Lombiq Privacy - Consent banner that adds the ability to show a privacy consent banner.
  • Lombiq Privacy - Form consent that provides the Privacy Consent Checkbox widget that can be used on any form.
  • Lombiq Privacy - Registration consent that adds a privacy consent checkbox to the registration form.

Now, if you navigate to Configuration -> Settings, you will find three new options there: Privacy Consent Banner Settings, Privacy Consent Checkbox Settings, and Privacy Registration Consent Settings. If you click on the Privacy Consent Banner Settings, you will find a simple editor with Liquid support, where you can set the content of the consent banner. By using the consent banner feature, users can accept the privacy policy.

If the user is unauthenticated, they can use the banner to accept or reject the privacy statement, their decision will be stored in a cookie by the browser.

If the user is authenticated, their only option is to accept the privacy policy via the banner. This is so because it is assumed that during registration, they already accepted a suitable privacy policy, it's just that the Lombiq Privacy module or something similar wasn't used at the time.

Privacy Consent Banner settings

Another new option here is the Privacy Registration Consent Checkbox Settings. The Registration Consent Feature shows a privacy consent checkbox on the registration form that needs to be checked by the users to be able to register. After registration, the user's consent is stored in the PrivacyConsent section of the user's properties. Here you can define the label of the checkbox.

Using the Registration Consent Checkbox

And the last one is the Form Consent Feature which adds a new Privacy Consent Checkbox widget content type that can be added to forms with the Forms module. In this case, users must accept the privacy policy before they can post content to the site. You can validate the consent with the Validate Privacy Consent Checkbox workflow activity. The way of how to do it can be seen in this Contact Form submitted workflow. When we get an incoming POST request, we check the validity of the Privacy Consent Checkbox, and based on the result, we redirect the user to different URLs. And if you check out the editor of the Page content type which has a Flow Part attached, you can see we added a Form widget there, and inside the Form, we placed our Privacy Consent Checkbox widget.

Using the Validate Privacy Consent Checkbox activity

And as usual, if you would like to know more about this new module, head to YouTube for a recording!

News from the community

Orchard Dojo Newsletter

Lombiq's Orchard Dojo Newsletter has 231 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!

No Comments

Add a Comment