> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# Method name: categoryId()

# Method package: w

# Method menu location: w --> WixEvents --> categoryId

# Method Link: https://dev.wix.com/docs/velo/velo-only-apis/$w/wix-events/category-id.md

# Method Description:

Sets or gets the event category displayed in a Wix Events element.

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](https://support.wix.com/en/article/wix-events-creating-and-managing-event-categories).  
![The Display Events menu](https://wixmp-833713b177cebf373f611808.wixmp.com/images/velo-images/media_wix-events-menu.png) 

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](https://support.wix.com/en/article/content-manager-working-with-wix-app-collections).
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](/wix-data).

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.



# Method Code Examples:

*** Note: do not assume any prop names or enum values other than the ones in the example.

## Set the event category to display

```javascript
$w('#myWixEventsElement').categoryId = '271ff543-f0f4-49e9-a2a6-131cs68425d4';
```

## Get the displayed event category

```javascript
let eventCategory = $w('#myWixEventsElement').categoryId; //'271ff543-f0f4-49e9-a2a6-131cs68425d4'
```

## Display an event category when a button is clicked

```javascript
$w('#myButton').onClick(() => {
    $w('#myWixEventsElement').categoryId = '271ff543-f0f4-49e9-a2a6-131cs68425d4'
    $w('#myText').text = 'Charity Events';
})
```

---