The New Way to Build! Introducing ReUI — the developer platform for agentic UI with shadcn/ui
Learn More

How to disable app-toolbar in some pages? Or change by Page?


I am trying to eliminate the title and toolbar from some paths, I do see here where we have it,


<ng-container *ngIf="appToolbarDisplay">
<app-toolbar class="app-toolbar" [ngClass]="appToolbarCSSClass" id="kt_app_toolbar"
[appToolbarLayout]="appToolbarLayout"></app-toolbar>


but I cannot seem to find where to place false for appDisplayToolbar.

I have Tried This:



{
path: "locations",
loadChildren: () =>
import("./locations/locations.module").then((m) => m.LocationsModule),
data:{ appToolbarDisplay: false}
},


It doesn't work. How do I exclude toolbar from some?


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (1)

Hi Kenneth,

It seems the option is not there. Here's how you can do it:

  1. In your component TypeScript file:
import { Router, NavigationEnd } from '@angular/router';
import { filter } from 'rxjs/operators';

// ...

export class YourComponent {
 shouldShowToolbar: boolean = true; // Set the initial value

 constructor(private router: Router) {
 router.events.pipe(
 filter(event => event instanceof NavigationEnd)
 ).subscribe((event: NavigationEnd) => {
 const currentPath = event.url;
 console.log('Current Path:', currentPath);

 // Update the boolean based on the current path
 this.shouldShowToolbar = currentPath !== '/exclude-toolbar';
 });
 }
}
  1. In your component's HTML file:
< ng-container *ngIf="shouldShowToolbar"> < app-toolbar class="app-toolbar" > < /ng-container>

In this example, the shouldShowToolbar variable is initially set to true. Then, in the subscription to the router events, it's updated based on the current path. The toolbar will only be displayed if shouldShowToolbar is true.

Remember to adjust the path ('/exclude-toolbar' in this case) based on your specific use case.

Thanks

Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(