---
title: "Link to page"
date: "2023-10-05T01:22:17+00:00"
summary: "Discover how to create dynamic links in your content with our \"Link to page\" feature. Learn to connect internal pages and external URLs seamlessly, enhancing user navigation and engagement on your website."
image:
type: "page"
url: "/drupal-starter-kits/add-ons/site-studio/link-page"
id: "64b77b2b-8e1d-4a94-a043-efb6ef932de3"
---

Schema:

    {
      "type": "object",
      "properties": {
        "type": {"type": "string", "pattern": "^form-field$"},
        "id": {"type": "string", "pattern": "^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$"},
        "machine_name": {"type": "string"},
        "data": {
          "type": "object",
          "properties": {
            "uid": {"type": "string","pattern": "^form-link$"},
            "title": {"type": "string"},
            "value": {
              "type": "object",
              "properties": {
                "url": {"type": "string"}
              }
            }
          }
        }
      },
      "required": ["id", "type", "data"]
    }
    

Example output:

Given "Link to page" form element on a component set up like so

![7c80ff8e-Screenshot%202023-12-06%20at%2000.50.43.png](https://acquia.widen.net/content/aecaa67c-94de-4851-a607-e6017788f05e/web/7c80ff8e-Screenshot%202023-12-06%20at%2000.50.43.png)

And used on Node layout canvas like so (given that "Test Page, Please Ignore" is a Drupal Node with id "5")

![f7b809f1-Screenshot%202023-12-06%20at%2000.52.06.png](https://acquia.widen.net/content/2cafcb00-5991-414c-a7b3-b7aefc0014db/web/f7b809f1-Screenshot%202023-12-06%20at%2000.52.06.png)

JSON:API output for this form field will be this:

    {
      "type": "form-field",
      "id": "7cc6c4c8-da14-4c2d-8e4d-f34187758f43",
      "machine_name": "link-to-page",
      "data": {
        "uid": "form-link",
        "title": "Link to page",
        "value": {
          "url": "https://sitestudiodocs.acquia.com/node/5",
          "jsonapi_link": "https://sitestudiodocs.acquia.com/jsonapi/node/layout_page/050cdf6a-310f-49b8-8059-5e0e705fb961"
    }
      }
    }

The "value" property is an object containing "url" property that is absolute link to "Test page, Please Ignore" page with Drupal node id 5. The "jsonapi\_link" here is canonical Drupal route to JSON:API resource representing "Test Page, Please Ignore" node. 

If same component containing "Link to page" form element is used with external URL like so:

![210c5aa0-Screenshot%202023-12-06%20at%2000.59.53.png](https://acquia.widen.net/content/796bf75c-10d8-486d-a5bb-7223bd2f8260/web/210c5aa0-Screenshot%202023-12-06%20at%2000.59.53.png)

JSON:API output for this form field will be this:

    {
      "type": "form-field",
      "id": "618bd7fe-e48d-4407-b1b3-dfae708b9d75",
      "machine_name": "link-to-page",
      "data": {
        "uid": "form-link",
        "title": "Link to page",
        "value": {
          "url": "https://youtu.be/dQw4w9WgXcQ?si=ELei-LXbyEZU1Lcd"
        }
      }
    }

The "value" property is an object containing "url" property that contains external link. As there is no internal Drupal entity to link to there is no "jsonapi\_link" property.