0
Hello, I created an application with Ionic where I have several pages. The application initializes with an intro page then goes to the homepage. I wanted to know how to put a standard footer on every page, except the intro, all at once without the need to keep repeating the same code on every page. I tried to do this by putting the html code in the app.html file, in a way it works, but it also inserts the code in the Intro page and in this I do not want to have footer. Is there this flexibility to work with Ionic layout? Thanks in advance. (NOTE: I am using ionic3)
Follow the footer code I want you to repeat on every page except the initial (Intro).
<ion-footer>
<ion-row>
<ion-col no-padding>
<button no-margin ion-button full large color="primary">
<ion-icon name="ios-chatbubbles"></ion-icon>
</button>
</ion-col>
<ion-col no-padding>
<button no-margin ion-button full large color="primary">
<ion-icon name="heart"></ion-icon>
</button>
</ion-col>
<ion-col no-padding>
<button no-margin ion-button full large color="primary">
<ion-icon name="person"></ion-icon>
</button>
</ion-col>
</ion-row>
</ion-footer>
Jose, enter the source code of your page and footer.
– Mike Otharan
Hello @Mikeotharan, all right? I put the code, I want it to be replicated on every page except the intro.
– Gonzaga Neto
You can create a footer page and give an import for each page that will have the footer
– Mike Otharan
I’m thinking here, if I don’t have this feature, maybe I could create a default page, and import it on the other pages, so I would type less code besides centralizing editing, but I don’t know if Ionic supports this feature.
– Gonzaga Neto
Yes, I’m doing something similar using this method.
– Mike Otharan
There is some different syntax to import the page, you can put the import command code for me?
– Gonzaga Neto
import { Pagefooter} from '.. pages/footer/footer'; do not forget to set the footer in modules.ts
– Mike Otharan