[SOLVED] Go back to home page


#1

Hello guys,

Is there a way to go back to the home page, and close all router navigation pages and popup pages also?

This will be handy when the user is deep in router navigation pages and wants to go back to the home screen with just one click.

Thank you for you time.


Feel free to switch views
#2

Try it…

<a href="/" class="external"> home </a>

I do not know that this is the correct way, but it helped me.


#3

Thank you very much for your quick answer!
Unfortunately your sugestion did not work for me, but it soulved another issue i had :slight_smile: I can now open PDF documents on an external webpage. Thank you JhowJhoe!

What i need is to go back to the APPs home page and close all navigation pages and popup pages. Any other sugestions guys?

Thank you for your time.


#4

Glad to help you, now try this.

Maybe you can use some parameters on your router.

router.back(url, options)

example sintaxe:

app.router.back('/', force:true);

force (boolean) - if set to true then it will ignore previous page in history and load specified one

Sorry for my bad english.

More details: https://framework7.io/docs/view.html#router-api-methods-properties


#5

Hello, I use your method, I guarantee it works in the browser, but it fails in the phone, it only returns the previous page


#6

Hello, I use your method, I guarantee it works in the browser, but it fails in the phone, it only returns the previous page


#7

Please, send me you sintaxe.


#8

This is correct solution

But keep in mind that / must be your home page route then in routes. Otherwise you need to specify the appropriate route


#9

Thank you for the tips guys. Here is my feedback:

app.router.back(’/’, force:true); works great if it is called from a router navigated paged. If it is called from a popop, it goes back to the home page but the popsups are not closed.

This is still my issue. Is there a way to close all open popups?

Thank you for your time.


#10

Simple! try it.

popup.destroy()

More infos: https://framework7.io/docs/popup.html


#11

popup.destroy() didnt work for me. I used app.popup.close(); and bingo!

Also I noticed that i had to call a function in the index page for everything to work. Here is the complete solution:

function go_home() {

   app.popup.close();
   app.router.back('/',force: true);

}

<a onclick="go_home();">Home</a>

SOLVED - Than you everyone, just a great framework!


#12

I Happing in help you.

Fico feliz em poder ajuda-lo!


#13