Customizing the platform's graphics is an essential part of setting up your video portal. In addition to establishing your organization's visual identity through logos, banners, and distinctive colors, the overall visual design must meet your requirements for accessibility and brand identity. However, the interface does not always allow you to meet these requirements. That’s why Nudgis also offers the option to customize the site using CSS code. The “Advanced CSS” option allows you to add custom code to override styles that aren’t available in the standard appearance settings. In this article, we’ll explore the different ways to use this feature through a few examples. This list is by no means exhaustive: advanced CSS code allows for many possibilities, which, of course, cannot all be covered here. But this document will show you where and how to make changes in your Nudgis portal to give it exactly the look you want.
Don't forget to check the visual consistency after customisation by testing the display on the home page, media pages and widgets to avoid inconsistencies in style.
Contents
First, you need to access the Custom CSS field, where you can enter the code you want. To do this, go to the Administration menu, then select “Appearance Customization” -> “Advanced theming (CSS)” tab. Note that this tab allows you to apply CSS to the entire site, but you can also apply it at the channel level, and even to individual media items. To do this, simply go to the Advanced Edit page for the relevant channel or media item, then navigate to the “Appearance” tab. There you’ll find the same interface as the one used for the entire site, but it applies only to the specific channel or media item. This is where you can upload files such as fonts or images to use in your custom CSS, as well as directly enter code into the editable field.
Any CSS changes can affect other pages if an error occurs. It is therefore important to check the visual consistency of the entire site after customization (home page, media pages, and widgets).
Header customisation
To start, take a look below to see how you can add a font using CSS. Note that you can use the “Add File” feature to achieve the same result.
But since this article focuses on using CSS, we'll look at how to achieve the same result using code alone. In the following example, we've chosen to use the “Atkinson Hyperlegible” font, which is specifically designed for readability and accessibility:
/* Custom font */
@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:wght@400;700&display=swap');
@font-face {
font-family: 'Atkinson Hyperlegible', sans-serif;
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: 'Atkinson Hyperlegible', sans-serif;
font-weight: 400;
font-style: italic;
}Then activate the font in Nudgis via the Administration > Appearance customisation > Fonts menu by adding its name to the beginning of the list of fonts:
Here's a preview of the result:
Now let's look at how to add a centered image to the header using the example below:
/* Custom header with an image */
.header .toolbar {
background-image: url(/public/site/resources/image.png);
background-color: #183a9d;
background-position: center;
background-repeat: no-repeat;
color: var(--white);
} This will apply a background with an image /public/site/resources/image.png and a fallback colour #183a9d if the image is unavailable, as well as a colour for the text in white var(--white). The image must be uploaded to the server, just like the font.
Page customisation
The breadcrumb trail is a navigation element that shows the hierarchy of pages the user has visited or their current location within the site’s architecture. It helps users understand where they are and how to easily go back. We’ll see how to hide it using advanced CSS. Note, however, that as long as the code is applied, this feature (shown below) will no longer be available and will prevent users from navigating back up the parent channel :
To hide the breadcrumb trail, edit the field using the block below :
/* Hide the breadcrumb trail in the channel view */
.channels-view .breadcrumb-container {
display: none!important;
}You can also apply this removal from a video's appearance settings :
/* Remove the breadcrumb trail from a video */
.ubi-legacy .breadcrumb {
display: none!important;
}This allows you to hide the breadcrumb trail on all or part of the site, as you see fit.
Next, let's see how to change the page's background color. Note that this change does not affect the footer or header. The CSS code below sets a custom background color of #183a9d and applies that color along with its complementary color, #000000 (i.e., black), to the page background to ensure the text is legible.
/* Coloured background */
:root {
--custom-bg: #183a9d;
--custom-bg-contrast: #000000;
}
/* Main background */
.app-main,
#global,
.ubi-legacy #container, .ubi-legacy .main-title, .ubi-legacy nav.navbar, .ubi-legacy.main {
background: var(--custom-bg);
}
.app-main,
#global {
color: var(--custom-bg-contrast);
}Again, all you need to do is adjust the color-coding settings to your liking. Here is an example of how it looks:
Player customisation
In this chapter, we'll look at an example that prevents a video's title from being displayed when it's embedded in an iframe:
To hide the title in this scenario, simply apply the code below
/* Do not display the video title in iframe mode */
.ubi-legacy .media-title-bar .media-title-text {
display: none!important;
}Here, too, this example helps illustrate the possibilities offered by CSS, but it is just one example among countless applications. It’s up to you to discover which ones are right for your project and to implement them in code for your specific needs.
In conclusion, the advanced CSS in Nudgis offers a high degree of graphical customization, but as everyone knows, with great power comes great responsibility: we recommend that you thoroughly test your changes, document your choices, and prioritize consistency to ensure a seamless interface that is accessible to everyone. To learn more, we invite you to continue exploring the customization options in Nudgis with the article below.
Comments
0 comments
Please sign in to leave a comment.