# Tabs not displayed when opening links with Side Menu

**URL:** <https://forum.ionicframework.com/t/tabs-not-displayed-when-opening-links-with-side-menu/129789>\
**Category:** ionic-v3\
**Created:** [May 6, 2018, 11:44am UTC](https://forum.ionicframework.com/t/tabs-not-displayed-when-opening-links-with-side-menu/129789 "2018-05-06T11:44:03Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![brunofbrito](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/brunofbrito/32/119225_2.png) [@brunofbrito](https://forum.ionicframework.com/u/brunofbrito)\
**Post date:** [May 6, 2018, 11:44am UTC](https://forum.ionicframework.com/t/tabs-not-displayed-when-opening-links-with-side-menu/129789/1 "2018-05-06T11:44:03Z")

</div>

I’m trying to combine a Side Menu with Tabs. My Side Menu has a set of links different from the ones available in the Tabs. I can visit the pages, but I don’t see the Tabs if I access them via Side Menu.

If I use the links I have in the Homepage of the app, I can get the Tabs everywhere. So what I want is to replicate this across the Side Menu as well.

This is my **app.component.ts** file:

```auto
import { Component, ViewChild } from '@angular/core';
import { Nav, Platform, NavController } from 'ionic-angular';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';

import { TabsPage } from '../pages/tabs/tabs';

@Component({
  templateUrl: 'app.html'
})
export class MyApp {
  @ViewChild('content') nav: Nav;
  rootPage: any = TabsPage;

  segmentPages: Array<{ title: string; component: any }>;
  diseasePages: Array<{ title: string; component: any }>;

  constructor(
    public platform: Platform,
    public statusBar: StatusBar,
    public splashScreen: SplashScreen
  ) {
    this.initializeApp();

    this.segmentPages = [
      { title: 'Adolescente 12-17', component: 'AdolescentePage' },
      { title: 'Mulher 18-25', component: 'MulherjovemPage' },
      { title: 'Mulher +35', component: 'MulheradultaPage' },
      { title: 'Homem', component: 'HomemPage' }
    ];
    this.diseasePages = [
      { title: 'O Cancro', component: 'CancroPage' },
      { title: 'A Prevenção', component: 'PrevencaoPage' },
      { title: 'O Tratamento', component: 'TratamentoPage' },
      { title: 'A Fertilidade', component: 'FertilidadePage' }
    ];
  }

  initializeApp() {
    this.platform.ready().then(() => {
      this.statusBar.styleDefault();
      this.splashScreen.hide();
    });
  }

  openPage(page) {
    this.nav.setRoot(page.component);
  }
}

```

and my **app.html**

```auto
<ion-menu [content]="content">
<ion-header>
  <ion-toolbar>
    <ion-title text-uppercase>Menu</ion-title>
  </ion-toolbar>
</ion-header>
<ion-content>
  <ion-list>
    <ion-list-header>Sou</ion-list-header>
    <button menuClose ion-item *ngFor="let p of segmentPages" (click)="openPage(p)">
      {{p.title}}
    </button>
    <ion-list-header>Saber mais sobre</ion-list-header>
    <button menuClose ion-item *ngFor="let p of diseasePages" (click)="openPage(p)">
      {{p.title}}
    </button>
    <ion-list-header>Linha de Apoio</ion-list-header>
    <ion-item>
      <h1 color="primary"><ion-icon name="call"></ion-icon> 808 255 255</h1>
    </ion-item>
  </ion-list>

</ion-content>
</ion-menu>

<ion-nav id="nav" #content [root]="rootPage" swipeBackEnabled="false"></ion-nav>

```

This is the code for my Home page ( **home.ts** ), which works as desired:

```auto
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';

@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {
  constructor(public navCtrl: NavController) {}
  goToPage(page) {
    this.navCtrl.setRoot(page);
  }
}

```

Why doesn’t `setRoot` keep the tabs when I use it inside **app.component.ts**?

---

<div class="post-metadata">

**Author:** ![Putintsev](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/putintsev/32/111050_2.png) [@Putintsev](https://forum.ionicframework.com/u/Putintsev)\
**Post date:** [May 6, 2018, 7:48pm UTC](https://forum.ionicframework.com/t/tabs-not-displayed-when-opening-links-with-side-menu/129789/2 "2018-05-06T19:48:45Z")

</div>

Try in this direction:

**app.component.ts**

> this.nav.setRoot(‘TabsPage’, {tabIndex: 2});

**tabs.ts**

> this.selectedIndex = this.navParams.get(‘tabIndex’) || 0;

**tabs.html**

> \<ion-tabs [selectedIndex]=“selectedIndex”\>

---

<div class="post-metadata">

**Author:** ![Roye](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/roye/32/119133_2.png) [@Roye](https://forum.ionicframework.com/u/Roye)\
**Post date:** [May 7, 2018, 4:25am UTC](https://forum.ionicframework.com/t/tabs-not-displayed-when-opening-links-with-side-menu/129789/3 "2018-05-07T04:25:06Z")

</div>

To see the tabs, you must have your root page point to the tabs page.  
As soon as you call setRoot to any other page, the new page will become the root, and the tab options will be gone.  
To move between the tabs you need to call the _select_ function on the tabs object.  
Use the following tabs guide to understand this better: [https://ionicframework.com/docs/api/components/tabs/Tabs/](https://ionicframework.com/docs/api/components/tabs/Tabs/)

---

<div class="post-metadata">

**Author:** ![brunofbrito](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/brunofbrito/32/119225_2.png) [@brunofbrito](https://forum.ionicframework.com/u/brunofbrito)\
**Post date:** [May 7, 2018, 9:53am UTC](https://forum.ionicframework.com/t/tabs-not-displayed-when-opening-links-with-side-menu/129789/4 "2018-05-07T09:53:43Z")

</div>

Thanks for the help, @Putintsev and @Roye . I had a look at the _select_ function and I’m afraid it’s not what I’m looking for.

The problem here is that the links in the sidemenu are different from the ones in the tabs. So in the tabs I have Link 1/2/3/4, but in the sidemenu Links 5/6/7/8. Can I still navigate to those while displaying the tabs?

---

<div class="post-metadata">

**Author:** ![brunofbrito](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/brunofbrito/32/119225_2.png) [@brunofbrito](https://forum.ionicframework.com/u/brunofbrito)\
**Post date:** [May 8, 2018, 3:33pm UTC](https://forum.ionicframework.com/t/tabs-not-displayed-when-opening-links-with-side-menu/129789/5 "2018-05-08T15:33:48Z")

</div>

Here is a GIF that describes the problema I’m facing: [https://gfycat.com/gifs/detail/BlondPositiveIrishredandwhitesetter](https://gfycat.com/gifs/detail/BlondPositiveIrishredandwhitesetter)

---

<div class="post-metadata">

**Author:** ![Roye](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/roye/32/119133_2.png) [@Roye](https://forum.ionicframework.com/u/Roye)\
**Post date:** [May 9, 2018, 1:28am UTC](https://forum.ionicframework.com/t/tabs-not-displayed-when-opening-links-with-side-menu/129789/6 "2018-05-09T01:28:35Z")

</div>

I played the video and I see that you don’t navigate using the tabs (yet).  
Questions:

1. What is the relationship between the tabs and the menu ?
2. Would the menu entries will change based on the selected tab ?
3. When you click on a menu item, which tab should be selected (and how would it know ) ?

---

<div class="post-metadata">

**Author:** ![brunofbrito](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/brunofbrito/32/119225_2.png) [@brunofbrito](https://forum.ionicframework.com/u/brunofbrito)\
**Post date:** [May 9, 2018, 9:41am UTC](https://forum.ionicframework.com/t/tabs-not-displayed-when-opening-links-with-side-menu/129789/7 "2018-05-09T09:41:08Z")

</div>

Hi @Roye here are my replies! Thanks for taking the time to help.

1. Tabs have different links from the Menu. Tabs are defined as the root page, while the Menu is part of `app.html` and `app.component.ts` (code in the initial post)

2. The menu entries won’t change.

3. No tab should be selected, since links from the menu are from other sections that aren’t an option in any tab. The user just needs to see the tabs at all times.

---

<div class="post-metadata">

**Author:** ![Roye](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/roye/32/119133_2.png) [@Roye](https://forum.ionicframework.com/u/Roye)\
**Post date:** [May 9, 2018, 1:24pm UTC](https://forum.ionicframework.com/t/tabs-not-displayed-when-opening-links-with-side-menu/129789/8 "2018-05-09T13:24:05Z")

</div>

If the menu open a view for information that is not in the tabs or relates to any tabs, the tabs bar shouldn’t be viewed.  
I believe the correct way is to use NavController.push for the menu items. The user will see a page that cover the entire view ( also cover the tabs too ), and can click on the (\<-) back button to return to main page with your tabs.  
So, the tabs are always there, just will be covered with entries from the menu are used.

---

<div class="post-metadata">

**Author:** ![prabhashi1](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/prabhashi1/32/133655_2.png) [@prabhashi1](https://forum.ionicframework.com/u/prabhashi1)\
**Post date:** [April 27, 2020, 5:51am UTC](https://forum.ionicframework.com/t/tabs-not-displayed-when-opening-links-with-side-menu/129789/9 "2020-04-27T05:51:04Z")

</div>

Hi,

have you solved the problem? I’m currently facing same. Can you help me with it?

---

<div class="post-metadata">

**Author:** ![brunofbrito](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/brunofbrito/32/119225_2.png) [@brunofbrito](https://forum.ionicframework.com/u/brunofbrito)\
**Post date:** [April 27, 2020, 6:31pm UTC](https://forum.ionicframework.com/t/tabs-not-displayed-when-opening-links-with-side-menu/129789/10 "2020-04-27T18:31:11Z")

</div>

Hi friend, unfortunately not.

If I recall correctly, I ended up creating a custom footer that was present on every page, with `<ion-footer>`, `<ion-toolbar>`, `<ion-grid>` and some CSS so that it would resemble tabs!

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 9:01pm UTC](https://forum.ionicframework.com/t/tabs-not-displayed-when-opening-links-with-side-menu/129789/11 "2021-07-19T21:01:05Z")

</div>

Closed on July 19, 2021, 9:01pm UTC


