Google Service improvements, Lombiq Content Editors for Orchard Core - This week in Orchard (07/07/2023)

Gábor Domonkos's avatar
Admin UI, Announcement, This week in Orchard, Content part

Fix Google Service dependencies and include Google Analytics and Tag Manager when the user consents. This week's demo is about the new Lombiq Content Editors for the Orchard Core module! Check out our post for the details!

Orchard Core updates

Fix Google Service dependencies

Google Tag Manager (GTM) is a bridge/middle-man service, that would allow you to enable other services like Google Analytics on your website. So, if you have GTM installed on your website, you can use the GTM portal to enable Google Analytics using the Measurement ID.

You can also enable Google Analytics without the use of GMT if you want. The two features OrchardCore.Google.TagManager and OrchardCore.Google.Analytics should not depend on each other as one should enable either.

Fix Google Service dependencies

If you enable the Google Tag Manager feature by navigating to Configuration -> Features, you will find a new option under Configuration -> Settings. It is called Google Tag Manager, where you can specify the container ID defined in your Google Tag Manager account.

Google Tag Manager Settings

Include Google Analytics and Tag Manager when the user consents

And while we are talking about Google-related services, let's check out another improvement regarding Google-related services! The Google Analytics feature always includes the Google Analytics tracking script in GoogleAnalyticsFilter. Instead, it should only include this if the user gave consent to tracking otherwise, it's a legal risk under GDPR for EU companies. Potentially something similar for websites run by other entities around the world too.

Fortunately, the built-in ASP.NET Core feature can be used for this, just by adding the below check to GoogleAnalyticsFilter.

Include Google Analytics and Tag Manager when user consents

Demos

Lombiq Content Editors for Orchard Core

This time we will check out the Lombiq Content Editors for Orchard Core module. This feature was originally built for Orchard 1 a couple of years ago, and it contained a lot of interesting features for advanced content editing, including async editors, which we will focus on today. It was a closed-source module of Lombiq, and this is the rewritten version of that for Orchard Core. As we mentioned, the primary feature of this module is the Async Editor feature, which we already used when we built the License Request form for Smithsonian Folkways Recordings. We wrote a blog post about how we upgraded that site to Orchard Core, and you can also check out a demo video of the app and our experiences developing it here.

Smithsonian Folkways Recordings now upgraded to Orchard Core

So, the Async Editor feature of this module provides an infrastructure for creating editors that can load and save content asynchronously. The editor can optionally render multiple pages where each page can load and save data independently.

To demonstrate this feature, we will utilize our Open-Source Orchard Core Extensions solution that contains most of Lombiq's open-source Orchard modules and themes, as well as related utilities and libraries. Last week we mentioned that this solution has been updated to the latest and greatest 1.6 Orchard Core version.

If you clone this repository and set up your site using the TEST: Lombiq's Open-Source Orchard Core Extensions recipe, the Lombiq Content Editors - Samples feature will be enabled by default which - of course - contains samples for Lombiq Content Editors. Meaning that if you click on the Employee (admin) option from the Content Editors Samples drop-down menu after your site has been set up, you will be redirected to the admin UI of Orchard Core, where you will see an editor of the Employee content item.

Employee Async Editor

To be more precise, this is the first editor group (PersonalDetails) of this content item. If you fill out the first group and click Save and Next, it will post the form to the API and won't reload the page. The backend will validate the form, and then if everything goes right, it will show you the HTML code of the next editor group and load it to the editor. Once you click on the Submit button on the second editor group, the editor will publish the content item. You can see the editor groups with a nice name (Personal Details, Employment Details), which provides some pagination to you as well, so you can go back and forth by clicking on these. And of course, you can utilize the async editors on the front end as well, and a good example of that is the License Request form for Smithsonian Folkways Recordings that we have just mentioned.

If you would like to know more about this feature, check out this video on YouTube where you can see some code as well. And don't forget to check out the samples module too, where you can find the code of the previously mentioned editor with tons of comments about how you can utilize this async editor in your own Orchard Core site!

News from the community

Orchard Dojo Newsletter

Lombiq's Orchard Dojo Newsletter has 471 subscribers! We have started this newsletter to inform the community around Orchard of 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 would like to read our weekly articles? Tell them to subscribe here!

If you are interested in more news about Orchard and the details of the topics above, don't forget to check out the recording of this Orchard meeting!

No Comments

Add a Comment