What could be happenning?
I’m trying to go to an internal page and even though it’s working in the editor but it’s not working in the published site. The code is:
wixLocation.to('/matricula-2');
What could be happenning?
I’m trying to go to an internal page and even though it’s working in the editor but it’s not working in the published site. The code is:
wixLocation.to('/matricula-2');
Hi Dani
Make sure that the page of that URL is published.
Or maybe there’s an error that prevents the code from reaching this line, these errors are usually invisible, and the only way to discover them is by logging them, and pay attention to where the code stops, the error is probably where the code stops.
Ahmad
Hello Ahmad, thanks!
But, can there be an error even though it works in the editor?
Thanks!
And the page is hidden in the menu and for the SEO. But i can access to it with the url, that means it’s published, doesn’t it?
Hi Dani
You can’t publish or unpublish selected pages, you can only control if the page is hidden (from the site and SEO) or not.
The Preview mode and the Live mode are different from each others, and code may behave differently on each of them.
Hey Ahmad! Problem solved. As you said, there was an error that was preventing the code to get there, a problem with collection premissions since in the Editor, the sandbox of a collection can be accessed by anyone in every case.
Thank you!!
You’re welcome Dani
NOTE : The editor can’t be accessed by everyone, the only reason that it worked in the editor is because the user who’s editing the website is a site admin , who have superior permissions than regular users, please note that there are some cases where even the site admin doesn’t have permissions to perform certain actions.
That’s what I meant by saying the Preview mode and the live site can behave differently.
Ahmad