Admin Dashboard, Display titles in the top bar - This week in Orchard (24/12/2020)

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

Option to display page titles in the top bar on the admin UI, documentation for external libraries, new FileDocumentStoreAttribute, and a lot more are waiting for you in our last blog post for this year. Let's get started!

Orchard Core updates

Display titles in the top bar

Set up your site using the Blog recipe, then navigate to the admin UI of the site. Head to Configuration -> Settings -> Admin. Here you will see a new option, called Display titles in the top bar. Let's put a tick here and see what will happen.

Setting to display title in top bar

If you save it, the titles will be placed in the top bar of the admin theme. The only thing you have to do is to slightly modify the appearance of the title of your page in the admin UI by making sure to put it in the Title zone.

<zone Name="Title"><h1>@RenderTitleSegments("My page")</h1></zone>

So, if you set that you would like to display the title in the top bar, then the Title section will be rendered in the top bar section of the theme, otherwise, it will stay in its own place.

Showing the page title on the nav bar

Hide connection string when already set for the tenant

When a connection string is defined in an environment variable, the value is displayed on the Tenants creation page:

$env:OrchardCore__ConnectionString="server=localhost;uid=root;database=db;password=my-secret-pw;"
$env:OrchardCore__DatabaseProvider="MySql"

Now if the connection string is coming from the configuration in the setup screen, then it's not displayed anymore, and this way we can't change it. The SetConfigurationShellValues method in the AdminController of the OrchardCore.Tenants module checks the values of the shell settings based on the ConnectionString and DatabaseProvider keys and if there are any, the EditTenantViewModel will get these values. And now we can only show the given sections on the front-end if these values haven't been set from the shell settings.

Get the connection string value from the ShellSettings

External libraries documentation

Orchard Core uses several external .NET libraries, like Jint, YesSql, and Fluid. But you can find several Client-side libraries here too, like GraphiQL, TypeScrip, React, or Vue. The goal of this new page in the Orchard Core documentation is to list all of the used libraries with their version.

Used libraries by Orchard Core

FileDocumentStoreAttribute providing a FileName

By default, the file name is equal to the name of the related document type, e.g. ContentDefinitionRecord => ContentDefinitionRecord.json.

So, for compatibility, this attribute allows keeping the current ContentDefinition.json without having to manage this specific case in FileDocumentStore with a hard-coded string.

The new FileDocumentStore attribute

Add the email optional claim steps to AAD integration document

If you follow this how-to guide, you can build a blog that allows users to login with their AzureAD account and gets assigned roles based on the Security Groups they belong to. However, the documentation hasn't mentioned yet how to set up optional claims to configure additional information when you are registering a new application (App registration) on the Azure Portal. Now this how-to has been updated with the way how you can add optional claims (like email) to your configuration.

The optional claim step in the AAD integration document

Demos

Admin Dashboard

To see this new feature the only thing you have to do is to just simply set up your site and navigate to the admin UI. After you will get a screen something like this. Here you can see cards, that are dashboard items, that are about to represent a piece of functionality of a given feature or module. For example, the one called Content items is coming from the Contents module and by using that, you can easily do some content-related functions (like listing the latest or the draft content item).

The new admin dashboard

It's pretty straightforward, so let's look under the hood to see how you can create your own dashboard items. But first, let's see how the site renders the items on the homepage of the admin UI. The AdminDashboard.cshtml in the OrchardCore.Admin module is just about to display the SummaryAdmin display type of every AdminDashboardItem that can come from any module.

Displaying the AdminDashboardItems

Let's see the first card with the title Content items. If you open up the Views folder of the OrchardCore.Contents module, you will find a view with the filename AdminDashboardItem.SummaryAdmin.cshtml. Here you can see the HTML structure of a Bootstrap card item with the custom content inside it, which in our case is some links to the AdminController in this module. We have a driver too to say display the SummaryAdmin display type and place it in a given location. That's all you have to do to have a new card on the homepage of the admin UI.

The content items AdminDashboardItem

This feature is under development and might be changing in the future. And it has been already changed just before we finalized this blog post. :) But what are the exact changes here? Well, that will be covered in an upcoming post, stay tuned for that! If you would like to know more about this, check out this recording on YouTube!

News from the community

A new website using Orchard Core: AeroSpace Cornwall

AeroSpace Cornwall is a research, development and innovation fund, that enables businesses to take their idea and turn it into a viable product ready for market in the space and aerospace sectors. Check out this site to see the loads of capabilities that you can achieve using the CMS.

AeroSpace Cornwall

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.

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 :).

Videos about Orchard Core development are on the way, you can see a new one every day! If you are really interested in the coding part, the upcoming, almost 20 videos are specially for you.

If you're looking for our previous Orchard 1.x tutorial series check out Dojo Course 2.

Christmas in Lombiq

Sometimes we do stuff. Together. Not (just) in front of computer screens. These are some usual events in Lombiq that are all announced and arranged in advance. We periodically have an event called RnDay: this is a few hours long event where we share with each other what we recently worked on and what we plan to do. E.g. if we recently finished a project then the project's team members demo what they've done. Last week we had our last RnDay for this year but this time we have to make it online. We also named this event to The 13th RnDay - Pandemic Edition! We also tried to do our best to make a nice group photo, you can see the result down below. :)

Lombiq 13th RnDay - Pandemic Edition

We would like to thank you all for reading our posts and making the Orchard community stronger together with us! We hope that we could give you valuable news and demos about the happenings around Orchard and Orchard Core from time to time by reading our posts and of course the This week in Orchard newsletter. We would like to wish everyone a Merry Christmas and a Happy New Year! See you next year!

Orchard Dojo Newsletter

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

No Comments

Add a Comment