From c60a2073942690d4a371b2dd433dc9e59abfec22 Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Thu, 20 Aug 2020 11:50:35 +0200 Subject: [PATCH] Ease and improve TOC generation Do not add another level of data processing. Allow to hide content in TOC. Ensure ordering of elements in TOC reflects ordering in rendering. --- .../PageTSconfig/Tceform/TtContent.tsconfig | 3 --- .../TypoScript/Setup/Page.typoscript | 19 +++++-------------- .../Private/Templates/Page/BlogPost.html | 16 +++++++--------- Resources/Private/Templates/Page/Full.html | 4 ++-- 4 files changed, 14 insertions(+), 28 deletions(-) diff --git a/Configuration/PageTSconfig/Tceform/TtContent.tsconfig b/Configuration/PageTSconfig/Tceform/TtContent.tsconfig index 4af4200..b1bcfc7 100644 --- a/Configuration/PageTSconfig/Tceform/TtContent.tsconfig +++ b/Configuration/PageTSconfig/Tceform/TtContent.tsconfig @@ -34,9 +34,6 @@ TCEFORM.tt_content { space_after_class { disabled = 1 } - sectionIndex { - disabled = 1 - } linkToTop { disabled = 1 } diff --git a/Configuration/TypoScript/Setup/Page.typoscript b/Configuration/TypoScript/Setup/Page.typoscript index 16b50db..b3a1c96 100644 --- a/Configuration/TypoScript/Setup/Page.typoscript +++ b/Configuration/TypoScript/Setup/Page.typoscript @@ -73,21 +73,12 @@ page { orderBy = sorting } - 50 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor + 50 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor 50 { - as = pageSections - special = list - special.value.data = page:uid - dataProcessing { - 10 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor - 10 { - table = tt_content - pidInList.field = uid - as = content - where = sectionIndex = 1 AND header_layout != 100 - orderBy = sorting - } - } + table = tt_content + as = pageContent + where = sectionIndex = 1 AND header_layout != 100 and colPos != 50 + orderBy = colPos, sorting } 100 < .10 diff --git a/Resources/Private/Templates/Page/BlogPost.html b/Resources/Private/Templates/Page/BlogPost.html index a18328f..3afd09a 100644 --- a/Resources/Private/Templates/Page/BlogPost.html +++ b/Resources/Private/Templates/Page/BlogPost.html @@ -51,15 +51,13 @@
  • Introduction
  • - - - -
  • - {contentEntry.data.header} -
  • -
    -
    -
    + + +
  • + {contentEntry.data.header} +
  • +
    +
  • Acknowledgements diff --git a/Resources/Private/Templates/Page/Full.html b/Resources/Private/Templates/Page/Full.html index e9e7a46..e536061 100644 --- a/Resources/Private/Templates/Page/Full.html +++ b/Resources/Private/Templates/Page/Full.html @@ -18,7 +18,7 @@ })} {f:render(section: 'TableOfContent', arguments: { - contentSections: pageSections.0.content + pageContent: pageContent })} @@ -42,7 +42,7 @@