---
title: "Models"
manual: "liquidlight/typo3-anthology"
version: "3.2"
permalink: "https://docs.typo3.org/permalink/liquidlight/typo3-anthology:models@3.2"
source: "Developers/Models.rst"
rendered: "2026-10-14T11:57:18+00:00"
---

# Models {#models}

The Anthology extension is designed to be a generic tool for displaying records from any database table. To achieve this, you must explicitly tell the extension which model you want it to work with. The [Quick Start](https://docs.typo3.org/permalink/liquidlight/typo3-anthology:quick-start@3.2) guide provides a brief overview, whilst this guide explains the concepts in more detail.

Making a model available involves three key parts: the TCA, the Extbase Repository, and the Extbase Model.

## The TCA File {#the-tca-file}

At a minimum, you need a `ctrl` section in your [TCA file](https://docs.typo3.org/m/typo3/reference-tca/13.4/en-us/Index.html#start) with a `title`. This title is what will appear in the plugin's "Model name" selection box.

Here is a minimal example for a hypothetical table named `tx_myextension_domain_model_item`:

**Configuration/TCA/tx_myextension_domain_model_item.php**

```php
<?php

return [
	'ctrl' => [
		'title' => 'My Extension Items',
		'label' => 'title',
		'tstamp' => 'tstamp',
		'crdate' => 'crdate',
		// ... other necessary ctrl properties
		'iconfile' => 'EXT:my_extension/Resources/Public/Icons/Item.svg',
	],
	// ... rest of your TCA ...
];
```

## The Repository {#the-repository}

To fetch the data from your table, the Anthology extension needs a corresponding [Extbase repository](https://docs.typo3.org/m/typo3/reference-coreapi/13.4/en-us/ExtensionArchitecture/Extbase/Reference/Domain/Repository/Index.html#extbase-repository-api). This repository **must** have the `LiquidLight\Anthology\Attribute\AsAnthologyRepository` attribute with the corresponding TCA/table name argument.

**Classes/Domain/Repository/ItemRepository.php**

```php
<?php

declare(strict_types=1);

namespace Vendor\MyExtension\Domain\Repository;

use LiquidLight\Anthology\Attribute\AsAnthologyRepository;
use TYPO3\CMS\Extbase\Persistence\Repository;

#[AsAnthologyRepository('tx_myextension_domain_model_item')]
class ItemRepository extends Repository
{
	...
}
```

## The Model {#the-model}

The model should be a standard [Extbase domain model](https://docs.typo3.org/m/typo3/reference-coreapi/13.4/en-us/ExtensionArchitecture/Extbase/Reference/Domain/Model/Index.html#extbase-model), no additional configuration is required to use a model in Anthology

**Classes/Domain/Model/Item.php**

```php
<?php

declare(strict_types=1);

namespace Vendor\MyExtension\Domain\Model;

use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;

class Item extends AbstractEntity
{
	...
}
```

## Select the Model in the Plugin {#select-the-model-in-the-plugin}

After completing the steps above and clearing the cache, your new model will be available for selection in the Anthology plugin.

1.  Edit the Anthology content element on your page.
1.  Navigate to the **General** tab.
1.  Click on the **Model name** dropdown menu.
1.  You should now see "My Extension Items" (the `title` from your TCA file) as an option.

Once you select it and save the content element, the plugin will start to query and display the records from your `tx_myextension_domain_model_item` table.
