Is possibile run some actions before $w.onReady ?

My problem is the following.

When I click menu in order to jump to ‘Who we are’ Page,
I would to get the normal page if I’m not logged, viceversa as member site I would jump on a second version of the “Who we are” page (dinamic Page).

I easily solved this, but when I jump, I see for a second the original ‘Who we are Page’ and only after, I automatically get the 2nd version of ‘Who we are’ Page.

Cause of this behavior is that I do my choiches after I loaded the page, inside the onReady function. This choiches should done before the loading page.

Thanks in advance
Mauro

** modified 10:oo PM 26/03/2018

Hey,

the way most website do that is having a common landing page with an ability to sign in.
members area pages are restricted to site logged in users so a member’s landing page is not the common landing page (think about gmail when you are logged in or not). if there are sections in your page which are for logged in users only, make them hidden by default (also protect the data by adding permissions to your collections) and show them on page ready if the user is logged in

Shlomi

Hi Shlomi thanks so much for ur response. I have to say, reading now my question, I wasn’t so clear, my fault. Actually I would achieve the selection of two versions of the same page based on wich user is browsing. If it’s site member then get the member Page, if it logged out will get the normal page.
So I need ti do this choiche before I will get the page loaded.
So I am studying the router API and the Hook methods, I believe this is the way, but I am not happy of documents and helping of on Wix Site. It would need more realistic examples.