Whether you’re building a fun personal site or a robust online business, there are several ways you could benefit from using a CMS (Content Management System). However, many external databases and dependency-based services can introduce technical difficulties and create privacy concerns, while also taking more time and effort to implement.
The Wix CMS integrates data with your site in a single location, and provides an easy-to-use interface for you to browse and seamlessly update your content. It also allows you to store data for your site securely without the need for an external service. Here are some ways to take advantage of the CMS in Wix Studio.
Connect Site Elements to Data
Connecting your CMS collection to Dynamic Pages and Repeater elements can vastly improve your efficiency when working with layouts with recurring formatting. Any changes in the CMS will automatically reflect in your site’s elements, eliminating the need to create repetitive elements and pages from scratch.
Repeater Elements
If you are displaying repeated elements with different content, you may benefit from linking a CMS collection to a Repeater element. With Repeaters, you can display content in the same repeated layout which updates its interface based on the data in the collection.
You can choose how many items to display and in which order through the Dataset settings. After you connect your collection to a Repeater, whenever you need to edit or add items to the repeated layout, simply update the data of your collection and the changes will automatically reflect in your Repeater items.
Dynamic Pages
For cases when you need a new page for each item in your collection, you can automatically generate pages by linking each collection item to a Dynamic Page. Dynamic Pages automate the page-creation process for a quicker workflow and better consistency.
Because Dynamic Pages are technically based on a single page, which is populated with different content each time, you can deploy content-heavy sites without compromising load times with multiple different pages. This also means that Dynamic Pages do not count towards your Wix site’s 100 page limit, since each page is individually rendered instead of stored as a file.
You have the option to use a preset which automatically populates a collection and its Dynamic Pages, or you can create your own collection from scratch.
Secure Your Data
Content isn’t always meant to be strictly for viewing – in many cases, site users will need to be able to change the data in a collection. However, ensuring that your data is secure when allowing outsiders control of its contents can be burdensome. Wix Content Manager’s permissions system provides a simple and secure way for administrators to easily manage how people can interact with data.
Collection Permissions
You can control who has access to each collection, as well as the scope of their access, by selecting your creating your own custom access rules. If you'd like website visitors to be able to modify data, they can also securely create, update, or delete items in your collection depending on the collection permissions. For example, on a forum site, forum post data stored in a collection may be set to allow any user to read its content, but only registered members can create content.
To access collection permissions, go to the CMS tab, click the three dots to the right of your collection name, and select “Permissions & privacy”.
You can change who can view, add, delete, or update data in each collection based on what makes sense for your use case.
To better understand the nuances of collection permissions and their various use cases, see our video on the topic.
Datasets
If you are connecting Wix elements from your site’s interface to a CMS collection, you will need to create a Dataset. The data from your site’s collections are not automatically accessible to users. The Dataset is what allows a page to communicate with a collection. A page without a Dataset for a collection will not be able to access that collection’s contents.
Where collection permissions determine who can read or modify the collection as a whole, the dataset determines where users might have read-only, write-only, or read and write permissions in context of each page. Datasets add another layer of security to your collection data by allowing you to choose how you want users to interact with data on the page.
Coding with Wix Data
Wix Data
Adding code to your site will unleash the full potential of Wix CMS, especially for data-driven sites. The default filter and sort options provided by the Dataset’s interface may suffice for many use cases, but if more complex operations are needed, you can implement them through code with the wix-data` API.
With the `wix-data` API, you can perform queries with arguments, update data programmatically, use data hooks to intercept interactions with a collection, and much more. For more information on how to use the API, see our video tutorial for sorting queries.
Using External Databases
If you are using existing data from an external database for a Wix site, you can still connect that data to your Wix elements and access that data in your code. You can create an external database adapter which exposes external database APIs to import its contents to your site’s CMS as an external collection.
Here are some guides on creating an adapter for a few popular databases:
You can also import and export data from Comma-Separated Value (CSV) files to use offline, import into external software, or share data with others by using the CMS or code.