wixLocation.path (not working)

Hi,

I’m trying to create a function where a lightbox launches when a client lands/redirects a certain page (the very first page of my forum). This is what I have so far but it doesn’t seem to be opening:

import wixLocation from 'wix-location';
import wixWindow from 'wix-window';

$w.onReady(function () {
	if (wixLocation.path == 'forum') {
		wixWindow.openLightbox('Quick Menu');
	}
});

My forum is on my home page and it’s been renamed to ‘packerpal’.

It would need it to launch when the client lands/ redirects on any of the main forum pages.

Many thanks for any help!

Thomas

Hi Thomas,

Pretty cool site - I’ve already started packing my bags. :wink:

I’m not sure what the problem is. I go to your site and I get the lightbox (menu at the bottom of the page). Not sure what you’re supposed to have or not have.

Let me know what you’re try to do and I’ll play with it.

Yisrael

Hi Yisrael

Thanks for the reply.

The light box only opens because it’s been set to ‘popup’ automatically on the main forum page (using the lighbox setting on the main WIX site).

I’m wanting it to come up every time anyone navigates away and back to the home page.

E.g.

  1. The site opens, the light box pop’s up

  2. They navigate to a category

  3. They navigate back to ‘home’ (the forum) and it pop’s back up again.

Is this possible? I can’t seem to get it to work.

Best

Thomas