Premium Feature — This feature is available in the Professional, Professional Plus, and Enterprise Editions. Learn more or contact LabKey.

To create a custom header that appears on all pages throughout the site, place a file named _header.html in any module you will include in your server. Place it at the following location:

mymodule
resources
views
_header.html

The header is written as an HTML fragment, without the <head> or <body> tags. The file can render any kind of HTML content, such as links, images, and scripts. It is also responsible for its own formatting, dependencies, and resources.

Example

The following _header.html file adds a simple banner message alongside the LabKey logo. Create a new .html file in the location described above, and use this content.

<p align="center" style="color:white">
<span class="fa fa-flag"></span>&nbsp;&nbsp; Custom Header Appears Here &nbsp;&nbsp;<span class="fa fa-flag"></span>
</p>

In this example, the header file was placed in the resources/views directory of the "HelloWorld" module created in our module development tutorial. If _header.html files are defined in several modules, you can select which one to display within the admin console.

  • Go to (Admin) > Site > Admin Console.
  • Click Admin Console Links.
  • Under Premium Features, click Configure Header.
  • Check the box to Show HTML header.
  • Select the module in which the header is defined.
  • Click Save.
The new header will appear at the top of every page.

Related Topics

Discussion

Was this content helpful?

Log in or register an account to provide feedback


previousnext
 
expand all collapse all