Skip to content
Tutorials Center
My learning

Topics

Lesson 17 of 37 ยท CMS and Dynamic Content

Wix CMS and Dynamic Pages

Learn how Wix stores data in Content Manager collections, connects it to pages through datasets, builds dynamic item and list pages, and queries data in code with Velo's wix-data.

Wix offers a CMS under the name Content Manager. Like Webflow's CMS it lets you define collections of structured content and then generate pages from them. The Wix approach is to connect page elements to data through datasets and to create dynamic pages whose URLs follow a pattern. On top of that you can use Velo by Wix to read and write data with JavaScript, which makes the Wix CMS a small database as well as a page generator.

This lesson describes the workflow in words, because the Wix product cannot run on this site, and gives a stand-in that imitates the query style of Velo's data API. The real Velo code is shown read-only, and the stand-in is clearly a teaching model. Menu names change as Wix updates its products, so rely on the concepts.

Collections in the Content Manager

You create a collection in the Content Manager (reachable from the editor's CMS menu or from the site dashboard):

  1. Choose to create a new collection and give it a name. Each collection has an ID used by code.
  2. Add fields with a type: text, rich text, number, date and time, image, gallery, document, URL, boolean, reference, multi-reference, tags and more.
  3. Set field options: required, default values, and display names. Every item also receives system fields, such as an ID and created/updated dates.
  4. Add items manually, import them from a CSV file, or populate them through code or forms.
  5. Set permissions: who can read, add, update and delete items. This matters a lot, since a collection that anybody can write to is a security risk.

Collections can also be private (only the site and its admins use them), which is handy for internal data such as form submissions or logs.

Datasets: the glue between data and elements

A dataset is a connector placed on a page. It points to one collection, defines which items to use (filters, sort, how many per page) and is what page elements connect to. Elements such as text, images, buttons, repeaters, tables and galleries can then be connected to a dataset field. The dataset also has a mode:

  • Read-only: the page displays data but visitors cannot change it.
  • Read and write: form inputs connected to the dataset can add or edit items, subject to permissions.

Think of a dataset as the data source that the elements on the page listen to. Several elements can share one dataset, and one page can have several datasets.

Dynamic pages

A dynamic page is a template connected to a collection. Wix offers two kinds:

Kind Shows Example URL pattern
Dynamic item page One item per URL /recipes/{Title}
Dynamic list page A collection list and its filters /recipes

The URL pattern uses field placeholders: /recipes/{Title} becomes /recipes/sourdough-bread for the item titled Sourdough bread. Pick a field whose value is unique and URL-friendly (often a dedicated slug field), because two items with the same value in the URL field cause conflicts. Adding the same text in different capitalization, or changing a title later, changes the URL, so use a stable field.

A repeater is the usual way to show a list of items on a page. You design one repeated item (an image, a title, a button), connect those elements to a dataset's fields, and Wix repeats the design for every item. Items can link to their dynamic item page.

flowchart TD
  C["Content Manager collection: Recipes"] --> D["Dataset on the list page<br/>filter, sort, items per page"]
  D --> R["Repeater: one card design<br/>repeated for each item"]
  R -->|link to item| P["Dynamic item page<br/>/recipes/{Title}"]
  C --> D2["Dataset on the item page<br/>filtered to the current item"]
  D2 --> P

Two datasets over one collection: one lists items, one fills a single item's page.

Filters, sorts and pagination

Datasets support filters (field equals, contains, is greater than, is empty, and combinations with and/or), sort order, and the number of items loaded per page with pagination controls. You can also add input elements (dropdowns, search boxes) that visitors use to filter the displayed items. Always make sure that a filter that matches nothing leads to an empty-state message instead of a blank space.

Querying with Velo (read-only)

With Velo enabled, you can query a collection from page code with the wix-data module. The code below is shown for reading only: it needs a Wix site with a collection named Recipes, so it cannot run here.

JavaScript
import wixData from "wix-data";

$w.onReady(async () => {
  const results = await wixData
    .query("Recipes")
    .eq("category", "Bread")
    .ge("rating", 4)
    .descending("published")
    .limit(6)
    .find();

  console.log(results.items.length, "recipes found");
  $w("#recipeRepeater").data = results.items;
});

Each method returns a query, so you chain them: eq (equals), ge (greater or equal), contains, startsWith, hasSome, descending, ascending, skip and limit. find() runs the query and returns a result object with items (the page of data) and information such as the total count. Velo also lets you insert, update and remove items, which is why permissions are crucial.

A stand-in for the query style

The class below imitates the chained query style so that the idea can be practiced here. It is not the real wix-data module, and the data is invented.

JS Stand-in: a chainable query like wix-data

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Building a URL pattern

The next stand-in shows how a pattern such as /recipes/{title} produces item URLs, and detects collisions caused by non-unique values.

JS Stand-in: dynamic URL patterns and collisions

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Items 2 and 3 collide because their titles differ only in capitalization and punctuation. Using a dedicated, unique slug field avoids the problem.

Permissions and safety

  • Give collections the least access they need: read for visitors, write only for admins or specific roles.
  • Never store secrets (API keys, passwords) in a collection that visitors can read.
  • Validate user-submitted data, since forms can be abused.
  • Back up important collections by exporting them periodically.

Webflow comparison

Webflow builds the CMS directly into the Designer: each collection has an automatic template page, and lists are a native element. Wix separates data (Content Manager and datasets) from presentation (dynamic pages and repeaters) and adds code access through Velo. Both can generate pages from data and filter and sort lists. The choice depends mainly on whether you want design-level control (Webflow) or data and code integration inside an all-in-one platform (Wix).

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is a dataset in Wix?

    A dataset is the page's data source: it points to a collection and defines which items elements can use.
  2. 2. What does a dynamic item page URL pattern like /recipes/{Title} do?

    The placeholder is replaced by each item's field value, giving each item its own page.
  3. 3. Why should the URL field be unique?

    Conflicting values mean two items cannot both have the same address.
  4. 4. Which Velo query chain returns the 6 newest items in a category?

    You filter, sort descending by date, limit, and then run find() to get the items.

Summary

  • The Content Manager stores collections of typed items with permissions.
  • Datasets connect page elements to a collection; repeaters repeat a design per item.
  • Dynamic item pages and list pages use URL patterns built from field values, which must be unique.
  • Velo's wix-data supports chained queries and data changes, so set permissions carefully.
  • Webflow integrates the CMS in the Designer, while Wix separates data and presentation and adds code access.

Next: CMS Data Modeling and Import