ovirt/rhev/rhv - custom branding (web ui)

Posted on Wed 06 December 2017 in ovirt • 1 min read

Step 1 - create a custom folder in /etc/ovirt-engine/branding

[root@rev1 branding]# ll
total 0
lrwxrwxrwx. 1 [..] 00-ovirt.brand -> /usr/share/ovirt-engine/branding/ovirt.brand
lrwxrwxrwx. 1 [..] 50-rhev-2.brand -> /usr/share/ovirt-engine/branding/rhev-2.brand
drwxr-xr-x. 3 [..] 99-custom.brand

Step 2 - copy your layout and create a 'branding.properties'

[root@rev1 branding]# ll 99-custom.brand/
total 8
-rw-r--r--. 1 [..] branding.properties
-rw-r--r--. 1 [..] common.css
drwxr-xr-x. 2 [..] images

Step 3 - branding.properties - don't remove the version parameter

[root@rev1 branding]# cat 99-custom.brand/branding.properties 
#style sheets.
userportal_css=common.css
webadmin_css=common.css
welcome_css=common.css

version=2

Step 4 - my example for a common.css - we only want to replace the logo!

[root@rev1 branding]# cat 99-custom.brand/common.css 
/* LoginSectionView.ui.xml:
   app logo, positioned in the top right of login screen */
.obrand_loginPageLogoImage {
    background-image: url(images/logo.png);
    width: 137px;
    height: 44px;
    border: 0px;
    display: block;
}

Step 5 - restart ovirt-engine and check the sourcecode

# systemctl restart ovirt-engine
[...]
<link rel="stylesheet" type="text/css" href="/ovirt-engine/theme/00-ovirt.brand/welcome_style.css">
[...]
<link rel="stylesheet" type="text/css" href="/ovirt-engine/theme/99-custom.brand/common.css">
[...]