Vorbly <Code>

CODING MADE EASY WITH VORBLY

WIX CODE LINK TWO DYNAMIC PAGES

Need to link two dynamic pages? This tutorial will show you how to link two dynamic Wix pages using Wix Code. You can now link two dynamic pages (different databases) to each other. We will provide you with the webpage elements and sample codes required to implement this feature.

THE DEMO

1/2

THE ELEMENTS

Dynamic Page 1

Dynamic Page: /Tours/{tourid}

Text Elements​

  • Tour Name: #title

  • Tour ID: #tourid

  • Tour Availability: #tourdates

Wix Repeater

  • Tour Details: #repeater1

Button Elements

  • Book Now Button: #BookNow

Dynamic Page 2

Dynamic Page: /OrderForm/Tours/{tourid}

Text Elements​

  • Tour Name: #title

  • Tour ID: #tourid

  • Order Form Information: #OrderInfo

User Inputs

  • Customer Name: #name

  • Customer Email: #email

  • No. of Guests: #guests

  • Tour Timing: #timing

  • Comments: #comments

Button Elements

  • Book Now Button: #BookNow

The Database

Create databases for your dynamic pages and.or order forms.

Include fields like tour name, tour description, Google Maps, images, etc...

THE CODE

Page Code

// Paste code in first dynamic page //

 

import wixLocation from "wix-location";

 

export function BookNow_click(event, $w) {

           let tourid = $w('#tourid').text;

           wixLocation.to("/OrderForm/Tours/" + tourid);

}

COMMENTS

I'm a paragraph. Click here to add your own text and edit me. It's easy.

Please complete all required fields.
No comments. Be the first to leave a comment.

I'm trying to make a dropdown that will, using your example, navigate between tours in Dynamic Page 1 using code that looks like this:

export function dropdown1_change(event) {
wixLocation.to('/station-profile-data/${$w("dropdown1").value}');
}

However, I keep getting this error:
DatasetError: Operation (onReady) is not allowed because the field used to build this page's URL is empty DatasetError: The dataset cannot filter by the dynamic dataset because the field used to build this page's URL is empty

Any clue why this is happening? Hope you can help me. Thanks.

JokJok

Feb 20, 2021

1

WEB DESIGN & DEVELOPMENT SOLUTIONS

GET PROFESSIONAL HELP