Browse Source

set the default value for new pages structure_id (in TCA)

Olivier Massot 5 years ago
parent
commit
b30fde00f0

+ 2 - 0
ot_templating/Configuration/TCA/Overrides/Readme.md

@@ -0,0 +1,2 @@
+Contient les définitions des tables de la DB typo3
+surchargées par le plugin (ex: champs ajouté) 

+ 24 - 0
ot_templating/Configuration/TCA/Overrides/pages.php

@@ -0,0 +1,24 @@
+<?php
+defined('TYPO3_MODE') or die();
+
+$columns = array (
+    'tx_opentalent_structure_id' => array (
+        'label' => 'Id de la structure',
+        'config' => array (
+            'type' => 'input',
+        )
+    ),
+);
+
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns(
+    'pages',
+    $columns
+);
+
+// Décommenter pour afficher le champs dans le backent (editer la page > onglet General)
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes(
+    'pages',
+    'tx_opentalent_structure_id',
+    '',
+    'after:subtitle'
+);

+ 1 - 0
ot_templating/Configuration/TCA/Readme.md

@@ -0,0 +1 @@
+Contient les définitions des tables ajoutées dans la DB par l'extension