# Data model inheritance

Data model inheritance - often simplified to just "inheritance" - is a feature in Pokko that allows you to compose complex data models by basing one model off another, inheriting the properties from that other model.

{% hint style="info" %}
**Example: Website**

You may be using Pokko to manage content for a website.  This website consists of various kinds of pages - blog posts, portfolio items, media libraries, etc.

Being part of a website they all share some common properties - i.e., page titles, URLs, meta descriptions

Instead of creating a data model in Pokko for each page and adding these properties to each model, you could make use of inheritance and create a base model including all these common properties that your page types would inherit from.

![](/files/-MfZtE3SGRbse8pvptGs)
{% endhint %}

## Model configuration

Data model inheritance is best implemented when creating your models rather than retrospectively.  You can move fields around once they have been created, but if any content has been created against the models you are reconfiguring it may be lost.

Following the above example, you would start by creating the **Page** model.

| Field            | Configuration                                                                 |
| ---------------- | ----------------------------------------------------------------------------- |
| Title            | Single line text, automatic source "Entry name"                               |
| URL slug         | Single line text, automatic source "Entry name" with "slugify" transformation |
| Meta description | Single line text                                                              |

When creating the **Blog post** and **Portfolio item** models, under the Inheritance section, click "Add" and choose "Page" from the dropdown.

![](/files/-MfZtrysz6_A5IZlny-E)

With that configured, you will see in the **Blog post** model the fields that have been inherited from **Page**.

![](/files/-MfZuDjSem5NmXPR0bFJ)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pokko.io/advanced-features/data-model-inheritance.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
