Custom Text/Banner on Web UI

Problem:
Need to include a text banner at the top of the Web UI. I’m able to edit /usr/share/app/views/home_topbar.html.erb to enable a banner on the earlier versions of Foreman still using the topbar menus. This path no longer exists in the newer versions of Foreman using the sidebar menus.

What is the new method of adding a banner to the UI?

Expected outcome:
Banner message at top of Web UI on all pages.

Foreman and Proxy versions:
1.22

Foreman and Proxy plugin versions:

Other relevant data:
[e.g. logs from Foreman and/or the Proxy, modified templates, commands issued, etc]
(for logs, surround with three back-ticks to get proper formatting, e.g.)

logs

You could try editing the base layout and add your banner after this line if you want it only after login or before if you want to show it also on the login page:

but I am afraid you are on your own with regards to making the html/css styling needed to make it look good.

1 Like

Thank you. I inserted the code as suggested and I’m able to see the banner on the UI.

Is there any way to place the banner above the navbar and make it static to where it doesn’t move when scrolling on the page?

That would likely require adding some css styling to it, you can do that inline (e.g. <div style="position: fixed"> etc.) but you would need to figure out the exact styling needed to make it work properly.

FYI… adding it to the login page is a setting:

Login page footer text

1 Like

@tbrisker Thank you! I now have a fixed banner on the top/bottom (header/footer) of the UI. The only problem is that the header is below the top menu/navbar. Is there a way to place the header above the top menu?

This would be a really nice feature to have in the admin settings to be able to post a notice to the users about a change, upcoming downtime, etc.