Add media file settings for allowed file types, Lombiq’s Journey with WTW’s Client Portal - This week in Orchard (29/09/2023)

Gábor Domonkos's avatar
Announcement, Media Library, This week in Orchard, Shape

Make UserMenu and LoginMenu extensible to using drivers, add media file settings for allowed file types, and a blog post about Lombiq’s Journey with WTW’s Client Portal! Let's see the details in our post!

Orchard Core updates

Make UserMenu and LoginMenu extensible to using drivers

Currently, there is no easy way to extend or inject items in UserMenu and LoginMenu. This is because all items in there are hard coded.

If you remember, a few weeks ago we talked about the User Display Name and the User Avatar features, and in the recording, Mike Alhayek showed how difficult it is to change the UserMenu or LoginMenu shapes. The suggestion was to make these shapes extensible.

From now on, to inject new menu items in either the LoginMenu or UserMenu you can implement and register an implementation of DisplayDriver<UserMenu>. The Detail display type is used to create the front-end menu, whereas the DetailAdmin is used to create the admin menu. Here you can see screenshots from TheTheme theme and from TheAdmin theme.

Extensible menus using drivers

As you can see, every menu item has its own shape which makes extending the items of these menus way more flexible.

The new UserMenuItems shapes

Add media file settings for allowed file types

Currently, when using Media Field, there is no way to restrict which file types can be used. Any extension that is uploaded can be selected. This works great for the most part. But what if you want to allow specific types? For example, creating a slide show of some sort. You should not be able to select non-image files for a slide show. Having a way to specify image extensions will help in this case.

And here comes the new settings! Here, you can see that we have a content type called Slide Show Item. This content type has a Media Field attached, called Pictures. If you edit the Pictures Media field, you have a way to set the allowed media types (image types for our case) by using the image types checkbox which helps you to select all the file extensions with the "image" type. With the help of this friendly UI, you can easily say that you only allow users to upload images using the Pictures Media Field. Note the list of the extensions here comes from existing MediaOptions.

Media Field allowed file extensions

News from the community

Lombiq’s Journey with WTW’s Client Portal

WTW is a multinational company providing services, such as insurance brokerage, risk management, and human resources consulting. Recently we implemented a specialized Orchard Core Client Portal for them. It was an exciting project, and we delivered it on time. While the final steps on the rest of the architecture are being completed, the whole portal is gradually being rolled out to users during the summer of 2023. If you are interested in the details, check out this case study for more!

Lombiq's Journey with WTW's Client Portal

Orchard Dojo Newsletter

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