> 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`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt ## Resource: wix-data ## Namespace: hooks ## Article: Introduction ## Article Link: https://dev.wix.com/docs/velo/apis/wix-data/hooks/introduction.md ## Article Content: # Introduction Data hooks run code before or after certain interactions with your site's collections. A data hook allows you to intercept the interaction immediately before or immediately after it occurs. The hook's code can even be used to affect the interaction itself. For example, you may want to intercept an item before it is added to your collection to perform a final validation or tweak the data that actually makes it into the collection. In general, hooks are run whether the interaction with your collection is initiated by a page element, programmatically, or when using the Content Management System (CMS). However, a Data API call from the backend code of your site may pass the optional `WixDataOptions` object and use it to suppress hooks from being called on that particular operation. > **Note**: This feature is not yet supported in [Wix Blocks](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-blocks/about-wix-blocks.md). Code for the hooks is written in the **data.js** file, which resides in the **Backend** section of your site. Hook functions are defined using the following pattern: ``` javascript export function _() { } ``` You can add these functions to the **data.js** file by writing them yourself, or by generating templates using the Velo sidebar. To add a hook to a collection from the sidebar: 1. Click the **Databases** button and hover over the relevant collection. 1. Click the **Show More** icon. 1. Select **Add/Remove Hooks**, and choose the hooks you want to add. ![Adding a Hook](https://wixmp-833713b177cebf373f611808.wixmp.com/images/velo-images/media_add_remove_hooks.png "Add/Remove Hook")