Renaming the cockpit's home navigation item

Product/components used and version/fix level:

Scaffolding from Cockpit 10.16.0.171

Detailed explanation of the problem:

A customer is trying to rename the landing dashboard (home by default). By injecting the navigation service we managed to rename the node to “Overview”:

import { NgModule } from "@angular/core";
import { NavigatorService } from "@c8y/ngx-components";
import { map } from 'rxjs/operators';

@NgModule()
export class NavModule {
    constructor(nav: NavigatorService) {
      nav.items$ = nav.items$.pipe(
        map(items => {
          const homeNode = items.find(node => node.label === 'Home');
          if (homeNode) {
            homeNode.label = 'Overview';
          }
          return items;
        })
      );
    }
}

However the title of the Home dashboard remains “Home”:
image

Can this title be customized?

Hi Georgi,

the home dashboard of cockpit is imported in your app.module.ts with the CockpitDashboardModule. This module offers a static config function.

This function accepts an object of type CockpitDashboardConfig as it’s parameter. By setting the pageTitle attribute you can adjust the title of the page (this will not be reflected in the navigation on the left hand side).

So adjusting the import to:

CockpitDashboardModule.config({ pageTitle: 'Overview' })

should do work.

Regards,
Tristan

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.