top of page

How to Create a Floor Plans Page and Database in Wix, using Velo

Aug 10, 2022
3 min read

Who is our customer and what problem did they want to solve?


The content for The Standard was a great use case for Wix's Dynamic Pages feature. The client provided a spreadsheet of different Residences along with the data that would need to be displayed on each of Residence's pages.


What solution did we provide?


To implement this, we made a Content Manager database called "Residences" with data such as the price of the residence, the square footage, the number of bedrooms & bathrooms, as well as the unit number, building number, floor number, an image of their floor plan and a downloadable PDF of the floor plan.


We also created another Content Manager database called "ResidenceFeatures" which would contain features that the residences shared that the "Residences" database would reference. Each residence feature had a title such as "11 ft. ceilings" or "8 ft solid core doors" and had multiple residences that referenced it.



How did we implement the solution?


With these databases in place, the next step was to create dynamic pages for the Residences collection.


When you do this, Wix creates a page in the editor to list all items from that collection as well as a page for each specific item of the collection.


For the "All" items dynamic page, the customer provided drawn images of the property with each residence shown and numbered. Since the residences are divided by floor, we used a Wix Multistate box to show the image for each floor's residences and buttons to change the state of the Multistate box to match the floor selected.


Next, we placed buttons with transparent background and transparent text over each drawn image (residences). From there, you are able to navigate to the individual residence's page.


For each individual residence's page, we used the Wix Data module to query the "ResidenceFeatures" collection referenced above, retrieve the features for each residence, then show them in a repeater.


We used the Multistate box again in order to display an image of the Residence's floor plan without furniture and a thumbnail of the floor plan with furniture that when clicked changes the state of the Multistate Box to a state with a large picture of the residence floor plan with furniture and a thumbnail that changes the Multistate box back to the original state.



Check out the code we used below:


import wixData from "wix-data";
import wixWindow from "wix-window";

$w.onReady(function () {
  const formFactor = wixWindow.formFactor;
  const data = $w("#dynamicDataset").getCurrentItem();
  if (typeof data.floorplan === "undefined") {
    $w("#beforeAfterStateBox").hide();
  }
  const repeater = $w("#repeater1");
  repeater.onItemReady(($item, itemData, index) => {
    $item("#featureText").text = itemData.title;
    if (index === repeater.data.length - 1) {
      repeater.show("fade");
    }
  });

  wixData
    .queryReferenced("Residences", data._id, "ResidenceFeatures")
    .then((result) => {
      repeater.data = result.items;
    });

  if (formFactor === "Desktop") {
    $w("#seeWithFurnitureImage").onClick(() => {
      $w("#beforeAfterStateBox").changeState("withFurniture");
    });

    $w("#seeWithFurnitureText").onClick(() => {
      $w("#beforeAfterStateBox").changeState("withFurniture");
    });

    $w("#seeWithoutFurnitureText").onClick(() => {
      $w("#beforeAfterStateBox").changeState("withoutFurniture");
    });

    $w("#seeWithoutFurnitureImage").onClick(() => {
      $w("#beforeAfterStateBox").changeState("withoutFurniture");
    });
  }
});



Have questions about this? Contact us at 225-250-1888 or email robert@roberthebertmedia.com.



About our company


RHM specializes in helping businesses of all sizes and across all industries achieve their digital and web marketing needs. Whether it's designing a new website, building an app, performing custom development, or running Google Ads, our goal is to showcase how you are the best at what you do and help people connect with you. Contact us at 225-250-1888 to get started!





 
 
 

203 Comments


karenanderson95074
22 hours ago

Phần hướng dẫn tạo trang sơ đồ mặt bằng khá dễ theo dõi, nhất là cách tách dữ liệu từng căn khỏi phần hiển thị để sau này cập nhật đỡ rối. Đọc đến đoạn lọc theo loại phòng, tôi chợt nhớ một người quen từng kể về các trang game bài đổi thưởng như SUN WIN, cũng là dạng nội dung có nhiều nhóm thông tin cần sắp xếp rõ ràng, dù tôi chưa dùng nên không biết thực tế ra sao. Quay lại bài, điều tôi còn băn khoăn là cách xử lý khi cơ sở dữ liệu có nhiều bản ghi hoặc hình ảnh nặng. Nếu có thêm ví dụ về lỗi thường gặp trong Velo thì…

Like

Đọc hướng dẫn tạo trang sơ đồ mặt bằng và cơ sở dữ liệu bằng Velo, tôi thấy nó giống việc vẽ lại một căn nhà trước khi sửa: phải biết chỗ nào là tường, chỗ nào là lối đi. Tôi không làm theo, chỉ đọc để hình dung cách một trang web được tổ chức. Có lần xếp lại mấy tờ giấy vẽ nhà cũ, tôi nhớ tới chuyện ai đó kể về game bài đổi thưởng, trong đó có nhắc https://sunwinhub247.co, nhưng tôi chỉ nghe rồi để đó. Phần tôi thích là cách bài tách dữ liệu khỏi giao diện, dù đọc xong vẫn thấy hơi rối. Chắc phải xem lại lần nữa mới nắm được mạch.

Like

lindacarter396
2 days ago

Phần nói về việc tạo trang sơ đồ mặt bằng và cơ sở dữ liệu bằng Velo làm mình chú ý vì đặt cạnh nhau cả giao diện lẫn dữ liệu phía sau. Mình từng nghe người quen bàn về game bài đổi thưởng trong lúc nói chuyện công nghệ, nên khi bắt gặp https://sunwinone368.com.co, mình liên tưởng đến cách các trang web thuộc những lĩnh vực rất khác nhau đều cần được tổ chức thông tin. Mình không rõ nội dung cụ thể của tên này, cũng chưa biết bài viết đi sâu đến đâu ở phần triển khai. Đọc xong, mình vẫn nghĩ nhiều nhất về sự kết nối giữa dữ liệu và cách người xem tìm thấy…

Like

Lucinda
2 days ago

The walkthrough makes a Wix project much easier to follow, especially the way the two databases connect residence details with shared features. The use of dynamic pages and floor-selection controls is a practical solution for presenting information clearly. I came across a related web-design discussion on microsoft copilot consulting, which offered another useful perspective. Thanks for sharing the implementation details.

Like

amandamiller693
2 days ago

Phần kết hợp trang sơ đồ mặt bằng với cơ sở dữ liệu trong Wix và Velo khá thú vị, vì nó cho thấy dữ liệu có cấu trúc sẽ giúp tránh phải tạo từng trang riêng một cách lặp lại. Đọc đoạn về trường dữ liệu và nội dung hiển thị, tôi nhớ một người bạn cũng hay lập danh sách tên các trang game bài đổi thưởng để phân loại, trong đó họ từng https://sunwinplus99.com.co ghi https://sunwinplus99.com.co. Tôi chưa dùng trang đó nên không biết thông tin trong danh sách có chính xác hay không. Trở lại bài hướng dẫn, điều tôi quan tâm nhất là mối nối giữa dữ liệu và giao diện: chỉ cần đặt tên trường…

Like
bottom of page