> 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: About Data Hooks for Dynamic Pages ## Article: About Data Hooks for Dynamic Pages ## Article Link: https://dev.wix.com/docs/develop-websites/articles/databases/wix-data/hooks/about-data-hooks-for-dynamic-pages.md ## Article Content: # Velo: About Data Hooks for Dynamic Pages When a request comes in for one of your dynamic pages, [a router uses the URL of the request](https://support.wix.com/en/article/cms-about-dynamic-pages#dynamic-item-pages) to decide which page to show and what data to bind to the page's dataset. You can add a data binding router hook to intercept this process at certain points and insert additional logic. Some hooks can be used with [router pages](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/routers/about-routers.md) as well. **Note:** If you duplicate a dynamic page and change a router prefix, you must also update the hook function. ## Router Hooks After defining a router for your site, you can define data binding router hooks in **routers.js** located in the Public & Backend section of the Code sidebar (Wix Studio), or the Code sidebar (Wix Editor). **Note:** To define data hooks, you must first create a router and add it your site. See how to create a router in [Wix Studio](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/routers/create-a-router.md), or in the [Wix Editor](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/routers/create-a-router.md). The hook functions are named with the following convention: _() The router prefix is the first part of the URL you chose when creating your dynamic page. You can find the URL of your dynamic page in the page's settings.  For example, if you have a page with the URL `/dishes/name` and you want to create a `beforeRouter` hook, the function would look like this: export function dishes_beforeRouter(request) { // function code } The hooks you can register are listed here in the order they run: * beforeRouter * customizeQuery * afterRouter To learn more about the hook functions, see the [Router API reference](http://wix.to/94BuAAs/wix-router.html). You can also register [data hooks](https://dev.wix.com/docs/develop-websites/articles/databases/wix-data/hooks/about-data-hooks.md) that run code before or after certain interactions with your site's collections. If you’ve done so, the data hooks will run between `customizeQuery()` and `afterRouter()`. ### beforeRouter() This hook is triggered before the router goes to the requested page. You can use this hook to route requests to a different page or return an error response. For example, you can check who is requesting the page and then decide based on the user's role whether to let the router continue to the next step or to return an error type response code. ### customizeQuery() This hook is triggered before the page's data query is executed. You can use this hook to further refine or change the query that will determine what data is bound to your page's dataset. For example, you can filter the query to only return items that have a status field set to active. ### afterRouter() This hook is triggered after the router has bound the data, but before the page is displayed. You can use this hook to change the router's response based on the data that was retrieved. For example, you can have two versions of a page, one for portrait oriented images and another for landscape oriented ones. After the image is pulled from the database, you can show the page that corresponds to the image's orientation.