CMS: Connecting the Wix Audio Player to a Collection
5 min read
CMS allows you to store a huge number of files in a collection and play them in the Wix Audio Player. The collection of files connects to a dataset, which connects to the Wix Audio Player. In the dataset, you can add filters and sorting to determine which files play and in which order.
Step 1 | Create a collection
Creating a collection allows you to easily manage your site's content like text, images, files and more.
To create a collection:
- Go to CMS in your site's dashboard.
- Click the relevant collection.
- Click Create a Collection.
- Enter a name for your collection and click Create.
- Click Manage Fields.
- Click + Add Field.
- Under the Field type drop-down, select Audio.
- Enter a name for this field.
- (Optional) Update the Field ID and add help text that appears only in your collection.
- Click Save.
- Click + Add Item to add a new row where you'll add your first audio file.
- Click the field under Audio, then click the Add Track icon .
- Upload the audio file you want to use and click Add Track.
- Enter the title of the track in the Title field.
- Click + Add Item to continue adding as many files to your collection as you want.
Tip: You can also click the Add Field icon to add more details to your collection (e.g. artist, genre, cover art).
Step 2 | Add a dataset
Now you're done setting up your collection, the next step is to add a dataset and connect it to your collection.
To add a dataset:
- Go to CMS in your Editor:
- Wix Editor: Click the CMS icon on the left of the Editor.
- Editor X: Click the CMS icon at the top of Editor X.
- Click the Add Content Elements tab.
- Click the Add icon next to the Dataset.
- Click Settings on the dataset.
- Click the Connect a collection drop-down and select your new collection.
Step 3 | Add and connect the audio player to the dataset
Once you've created the collection, and also connected the dataset to your collection, you're ready to connect the audio player to the dataset.
To add and connect the audio player:
- Go to the Add panel:
- Wix Editor: Click Add Elements on the left side of the Editor.
- Editor X: Click Add Elements at the top of Editor X.
- Click Video & Music.
- Click Audio Players.
- Click and drag the audio player of your choice onto your page.
- Click the Connect to Data icon.
Note: Connection Options vary depending on the type of audio player selected.
- Click the Connect a dataset drop-down and select the dataset that you want to connect your audio player to.
- Under Connection Options, connect the relevant options to the fields in your collection.
Step 4 | Set up a filter in the dataset
Use a filter in your dataset to select the track that plays on the audio player. In this case, we use the track title in the filter.
To set up a filter:
- Click the dataset on your page.
- Click Settings.
- Click + Add Filter.
- Under the Field drop-down, select the field containing the name of your track. In this case, we choose Track title (text).
- Under the Condition drop-down, select Contains.
- In the Value field, enter a word or phase unique to the track you want to play.
- Click Add Filter.
- Click Preview to hear your audio player in action.
Did this help?