Skip to content

Instantly share code, notes, and snippets.

@PetraMotz
Last active August 4, 2021 11:13
Show Gist options
  • Save PetraMotz/ed2a5b191e5a834123e6694096cbe9ee to your computer and use it in GitHub Desktop.
Save PetraMotz/ed2a5b191e5a834123e6694096cbe9ee to your computer and use it in GitHub Desktop.
TYPO3 #url #extension #slug #t3
ProductsPlugin:
type: Extbase
limitToPages:
- 170 --Detail und Listenansicht
- 143
extension: WebxProducts ---key der Extension in UpperCamelCase (key ist: webx_products)
plugin: Main
routes:
-
routePath: '/{page}'
_controller: 'Product::list'
_arguments:
page: '@widget_0/currentPage'
-
routePath: '/{product_title}'
_controller: 'Product::show'
_arguments:
product_title: product
defaultController: 'Product::list'
defaults:
page: '0'
requirements:
page: '\d+'
aspects:
product_title:
type: PersistedAliasMapper
tableName: tx_webxproducts_domain_model_product -- DB Tabelle
routeFieldName: slug -- name des DB Feldes wo die Slug drin steht
page:
type: StaticRangeMapper
start: '1'
end: '100'
in der Extension/ Configuration/ TCA/ gemünschtes Model wählen- beim Feld wo die Slug rein soll das hier eingeben.
'slug' => [
'exclude' => true,
'label' => 'LLL:EXT:webx_products/Resources/Private/Language/locallang_db.xlf:tx_webxproducts_domain_model_product.slug',
'config' => [
'type' => 'slug',
'generatorOptions' => [
'fields' => ['title'],
'prefixParentPageSlug' => true,
'replacements' => ['/' => '-']
],
'fallbackCharacter' => '-',
'cols' => 40,
'rows' => 15,
'eval' => 'uniqueInSite',
'default' => ''
]
],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment