Search.../

categoryId

Sets or gets the event category displayed in a Wix Events element.

Description

Using the Display Events menu, you can set Wix Events elements to display a specific set of events or all the events in an event category.
The Display Events menu

By setting categoryId, you can dynamically change which event category to display. When you set categoryId to null or the page is reloaded, the element defaults to whatever is selected in the Display Events menu.

The value of categoryId corresponds to the ID field value for the event category's entry in the Wix Events "Categories" app collection. You can find this value either by opening the collection with the Content Management System (CMS), or querying the collection using the Wix Data API.

By default, the value of categoryId is the ID for the event category selected in the Display Events menu, or null if Select manually is selected in the menu.

Type:

stringRead & Write

Was this helpful?

Set the event category to display

Copy Code
1$w('#myWixEventsElement').categoryId = '271ff543-f0f4-49e9-a2a6-131cs68425d4';
Get the displayed event category

Copy Code
1let eventCategory = $w('#myWixEventsElement').categoryId; //'271ff543-f0f4-49e9-a2a6-131cs68425d4'
Display an event category when a button is clicked

Copy Code
1$w('#myButton').onClick(() => {
2 $w('#myWixEventsElement').categoryId = '271ff543-f0f4-49e9-a2a6-131cs68425d4'
3 $w('#myText').text = 'Charity Events';
4})