Hallo zusammen,

ich möchte die Tags wie hier beschrieben direkt im Feld speichern:

PHP-Code:
// Save the tag values directly in the field and do not use the Haste-ManyToMany relation
'sql' => ['type' => 'blob''notnull' => false], 
Ich bekomme dann aber im Backend den folgenden Fehler:

Field tags does not seem to be related!
Wenn ich die sql-Zeile auskommentiere wird die Tabelle tl_cfg_tag_content (mit contao:migrate) erstellt und alles läuft wie gewünscht.
Ich benötige die Tags direkt beim ContentElement, weil ich die Tags dort zu jedem Element ausgeben möchte. Ich möchte nicht im Template zu jedem Element eine Datenbankabfrage machen.

Was muss ich noch für eine Relation einrichten?

/config/config.yml
Code:
codefog_tags:
    managers:
        my_manager:
            source: 'tl_content.tags' # in format <table>.<field>, or an array of such
            #service: '' # optional, manager service to use (defaults to "codefog_tags.default_manager")
            #alias: '' # optional, alias of the newly created service
/contao/dca/tl_content.php
Code:
<?php

$GLOBALS['TL_DCA']['tl_content']['palettes']['youtube'] = str_replace("youtube", "youtube,tags", $GLOBALS['TL_DCA']['tl_content']['palettes']['youtube']);
  

$GLOBALS['TL_DCA']['tl_content']['fields']['tags'] = array(
  'exclude' => true,
  'inputType' => 'cfgTags',
  'eval' => [
        'tagsManager' => 'my_manager', // Manager name, required
        'tagsCreate' => true, // Allow to create tags, optional (true by default)
        //'tagsSource' => 'tl_content.tags', // Tag source, optional (defaults to current table and current field)
        'maxItems' => 5, // Maximum number of tags allowed
        'hideList' => true, // Hide the list of tags; the input field will be still visible
        'tl_class' => 'clr'
    ],
  # Save the tag values directly in the field and do not use the Haste-ManyToMany relation
  'sql' => ['type' => 'blob', 'notnull' => false],
  // habe mal eine Relation getestet (ohne Erfolg)
  //'relation' => array('type'=>'hasMany', 'load'=>'eager', 'table'=>'tl_cfg_tags')
);
Ich teste gerade in einer frischen Contao 4.10 Installation.