Add SupportedCultures and DefaultCulture to the Culture filter, MateAdmin admin theme - This week in Orchard (06/12/2024)
Adding SupportedCultures and DefaultCulture to the Culture filter; new AddDisplayDriver Service Collection Extension, and a demo about the upcoming MateAdmin admin theme are the topics for this week. Let's check them out in detail!
Orchard Core updates
New AddDisplayDriver Service Collection Extension
A new extension method, AddDisplayDriver<TModel, TDriver>services.AddScoped<IDisplayDriver<Navbar> has been introduced to streamline the registration of generic display drivers. Now, instead of the verbose syntax services.AddScoped<IDisplayDriver<Navbar>, VisitSiteNavbarDisplayDriver>() for registering a driver like VisitSiteNavbarDisplayDriver, you can simply use the more concise services.AddDisplayDriver<Navbar, VisitSiteNavbarDisplayDriver>(). This enhancement reduces boilerplate code and improves readability when adding display drivers.
Add SupportedCultures and DefaultCulture to the Culture filter
This change is about modifying the way the supported_cultures filter was done. What we have today, if you do {{ "" | supported_cultures }} you get the list of the supported cultures by the current system. If you have the Localization module enabled, you can define the list of supported cultures, and this is what you get by using this filter. If you don't enable the Localization module, you just get the current culture.
But it doesn't have to be a filter; it should be a property, like SupportedCultures. The idea here is that we will not break this, but the recommended way to get the supported cultures is to do {{ Culture.SupportedCultures }}. This will give you the list of the currently supported cultures of the site.
Here is an example of how to print the names of supported cultures and find which one is currently used:
<ul>
{% for culture in Culture.SupportedCultures %}
<li class="{% if culture == Culture %}active{% endif %}">{{ culture. Name }}</li>
{% endfor %}
</ul>
The same applies to the DefaultCulture, which returns the default culture as defined in the settings.
Demos
MateAdmin admin theme
Niraj Soni is working on a new admin theme for Orchard Core based on Google's Material Design 3 principles using BeerCSS. The objectives are to build an alternate Admin theme for Orchard Core based on Open Web Standards and adaptive UI technologies, not using jQuery or Bootstrap but Modular JavaScript. In his demonstration, he shows us the current state of the theme and the planned key features of the project.
The goal is to have a multi-color Material Design 3 theme with dynamic colors, meaning theme colors can be defined using preset colors, a custom color picker, or an image file.
Check out the Readme file of the upcoming project for information about the objectives and key features, as well as some gifs that show you some pieces of the theme!
As always, if you want to see more about this theme, not just the gifs mentioned, watch a recording on YouTube!
Orchard Dojo Newsletter
Lombiq's Orchard Dojo Newsletter has 467 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!