Skip to content

Commit

Permalink
[TASK] Add header configuration to site root
Browse files Browse the repository at this point in the history
  • Loading branch information
Lisa Kreitz authored and pixeldesu committed Apr 11, 2024
1 parent be5d527 commit cb7c336
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ page {
}
}
}
30 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
30 {
table = pages
selectFields = contact
uidInList.data = site:rootPageId
pidInList = 0
as = contact
}
}
}

Expand Down
23 changes: 22 additions & 1 deletion local_packages/football/Configuration/TCA/Overrides/pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,32 @@
],
],
],
'contact' => [
'label' => 'LLL:EXT:' . $extensionKey . '/Resources/Private/Language/locallang_db.xlf:pages.contact',
'displayCond' => 'FIELD:is_siteroot:REQ:true',
'config' => [
'type' => 'link',
'allowedTypes' => ['page','url'],
'appearance' => [
'allowedOptions' => ['target'],
],
],
],
];

/**
* add fields to pages
*/
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns($table, $fields);

/**
* add new palette for header config
*/
$GLOBALS['TCA']['pages']['palettes']['header'] = [
'label' => 'LLL:EXT:' . $extensionKey . '/Resources/Private/Language/locallang_db.xlf:pages.palettes.header',
'showitem' => 'contact'
];

/**
* add new palette for footer config
*/
Expand All @@ -74,7 +93,9 @@
*/
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes(
$table,
'--div--;LLL:EXT:' . $extensionKey . '/Resources/Private/Language/locallang_db.xlf:pages.tab.footer,
'--div--;LLL:EXT:' . $extensionKey . '/Resources/Private/Language/locallang_db.xlf:pages.tab.header,
--palette--;;header,
--div--;LLL:EXT:' . $extensionKey . '/Resources/Private/Language/locallang_db.xlf:pages.tab.footer,
--palette--;;footer'
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,21 @@
<trans-unit id="pages.social">
<source>Social Media Links</source>
</trans-unit>
<trans-unit id="pages.contact">
<source>Page with contact form</source>
</trans-unit>
<trans-unit id="pages.tab.footer">
<source>Footer</source>
</trans-unit>
<trans-unit id="pages.palettes.footer">
<source>Footer</source>
</trans-unit>
<trans-unit id="pages.tab.header">
<source>Header</source>
</trans-unit>
<trans-unit id="pages.palettes.header">
<source>Header</source>
</trans-unit>
<!--- END: pages -->

<!--- BEGIN: tt_content -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@
</ul>

<f:cObject typoscriptObjectPath="lib.searchBox"></f:cObject>
<div class="d-grid">
<button class="btn btn-primary" type="submit">Contact us</button>
</div>
<f:if condition="{contact}">
<div class="d-grid">
<f:link.typolink parameter="{contact.0.data.contact}" class="btn btn-primary" additionalAttributes="{type:'submit'}" />
</div>
</f:if>
</div>
</div>
</nav>
Expand Down

0 comments on commit cb7c336

Please sign in to comment.