Quick Start
This guide provides a comprehensive overview for getting the Anthology extension running, assuming you have an existing TYPO3 model you wish to display.
Installation
Install the extension via Composer:
composer require liquidlight/typo3-anthology
Add Anthology to your site set as a dependency by either selecting it in the Sites module or adding the following to your site config YAML:
dependencies:
- liquidlight/anthology
If you're not using site sets, you can include the TypoScript in your setup. file:
@import 'EXT:ll_anthology/Configuration/TypoScript/setup'
Automated Setup
The quickest and easiest way to get started with Anthology is using the anthology:setup command:
Run the Command
./vendor/bin/typo3 anthology:setup [site_package_path]
Replace [site_ with the path to either your site package, or the extension you are modifying.
Once the command has completed, it is recommended you manually review the generated configuration for accuracy before proceeding.
Add the Generated Configuration
If it is not already configured, you must include the generated sitemap. and [model_ files in your site package or extension's TypoScript file:
@import './TypoScript/modules'
And also add the generated YAML configuration to your site configuration YAML:
imports:
- resource: 'EXT:site_package/Configuration/Sites/[ModelName].yaml'
Manual Setup
Repository Configuration
For the extension to function, you must add the As attribute to your model's repository.
use LiquidLight\Anthology\Attribute\AsAnthologyRepository;
use TYPO3\CMS\Extbase\Persistence\Repository;
#[AsAnthologyRepository('tx_myextension_domain_model_item')]
class ItemRepository extends Repository {
...
}
As'sAnthology Repository tableargument must be the name of your database table and TCA.Name
Add and Configure the Plugin
- Navigate to the Page module and add the Anthology content element from the Plugins tab.
- Configure the plugin settings:
- General Tab
-
- Mode: Choose
Listfor the main view orSinglefor a detail page. - Model name: Select your model (e.g., "My Extension Items"). This list is populated based on your TypoScript configuration.
- Single View Page: For a
Listplugin, link to the page where theSingleview is located.
- Mode: Choose
- Display Tab
-
- Items Per Page: Set the number of items for pagination (e.g.,
10). - Enable Pagination: Activate or deactivate the pagination.
- Items Per Page: Set the number of items for pagination (e.g.,
- Filters Tab
-
- Assign pre-configured filter records to the plugin.
Routing (for Detail Pages)
To create user-friendly URLs for your detail pages, add a route enhancer to your site's config.:
routeEnhancers:
# Single view with slug-based URLs
ItemSingle:
type: Extbase
limitToPages:
- 123 # Your single view page UID
extension: LlAnthology
plugin: AnthologyView
routes:
# Single record by slug
- routePath: '/{record}'
_controller: 'Anthology::single'
defaultController: 'Anthology::view'
aspects:
record:
type: PersistedAliasMapper
tableName: tx_myextension_domain_model_item
routeFieldName: slug
This requires a slug field in your model's table.
For further information, and to add pagination route enhancers to the list view, refer to the Routing documentation.
Sitemap
To include your detail pages in the XML sitemap, add a sitemap provider to your TypoScript:
plugin.tx_seo.config.xmlSitemap.sitemaps {
my_items {
provider = TYPO3\CMS\Seo\XmlSitemap\RecordsXmlSitemapDataProvider
config {
table = tx_myextension_domain_model_item
sortField = crdate
lastModifiedField = tstamp
pid = 123 # Storage page UID
url {
pageId = 456 # Single view page UID
fieldToParameterMap {
uid = tx_llanthology_anthologyview[record]
}
additionalGetParameters {
tx_llanthology_anthologyview.action = single
tx_llanthology_anthologyview.controller = Anthology
}
}
}
}
}
See the Sitemap guide for more details.
Templates
The extension will automatically use templates from your model's extension directory. To override a template, copy it from ll_ to the corresponding path in your own extension (e.g., my_) and modify it.
See also
For more detailed information on template customization, see the Templates guide.