top of page

Travel Tips

Check Out Helpful Information for Your Next Adventure

Uganda

Persistence is the Ugandan Sunshine

Thailand

Make Your Own Way to Paradise

Costa Rica

The Vacation That Flies by the Fastest

Tasmania

The Southeast’s Well Kept Secret

Iceland

The Most Popular Tourist Destination Today

Italy

How Many Gelatos is Too Many Gelatos?

USA

The Best Times to Visit the USA

Australia

The City that Looks Like Treasure

North Pole

A Popular Place for Gift Making

Tazmania

The Serengeti and Newer Horizons

Brazil

A Treat for The Travel Bug

Germany

The Place You’ll Long to Explore

Canada

The Maple Leaf State and All Its Beauty

Veitnam

A Traveller’s Tale: Why Visit Vietnam

Mexico

The Perfect Place for a Getaway Wedding

Peru

From Lima, to Cuzco, to Tranquility

Morocco

Eats, Meats and the Ultimate Hospitality

Egypt

The Trip You’ll Never Forget

Spain

The Best Place to Rest

Holland

Small on a Map and Big in Our Hearts

Código

import wixData from "wix-data";

 

$w.onReady(() => {

loadContinents()

});


 

//trazer a lista de itens do banco de dados referenciado

function loadContinents() {

wixData.query('Continents')

.find()

.then(res => {

let options = [{"value": '', "label": 'All Continents'}];

options.push(...res.items.map(continent => {

return {"value": continent.title, "label": continent.title};

}));

$w('#iContinent').options = options;

});

 

}

 

//acionar o filtro ao alterar o dropdown

export function iContinent_change(event) {

let selectedContinent = $w('#iContinent').value

// chamar a função com o parâmetro

filterReferenced(selectedContinent)

 

}

 

// função de filtro por busca de referência

async function filterReferenced(cont) {

//buscar titulo do item referenciado

let newSelection = (await wixData.query('Continents')

.eq('title', cont)

.find()).items[0];

console.log(newSelection.title)

//buscar itens do banco principal que tenham o item referenciado

let res = await wixData.queryReferenced('Continents', newSelection, "Articles");

if(res.items.length > 0) {

let items = res.items;

console.log(items)

//mostrar os resultados do filtro no repetidor

$w('#articlesList').data = items;

 

} else {

// handle case where no matching items found

}

}

2017 Going Places

bottom of page