diff --git a/public/typo3conf/ext/ep_theme/Configuration/TCA/Overrides/tt_content_element_faq_overview.php b/public/typo3conf/ext/ep_theme/Configuration/TCA/Overrides/tt_content_element_faq_overview.php new file mode 100644 index 00000000..ff217a3e --- /dev/null +++ b/public/typo3conf/ext/ep_theme/Configuration/TCA/Overrides/tt_content_element_faq_overview.php @@ -0,0 +1,28 @@ + ' + --palette--;' . $frontendLanguageFilePrefix . 'palette.general;general, + --div--;' . $frontendLanguageFilePrefix . 'tabs.access, + hidden;' . $frontendLanguageFilePrefix . 'field.default.hidden, + --div--;' . $frontendLanguageFilePrefix . 'tabs.extended + ', + ]; +}); diff --git a/public/typo3conf/ext/ep_theme/Configuration/TSconfig/Page/Mod/Wizards/NewContentElement.tsconfig b/public/typo3conf/ext/ep_theme/Configuration/TSconfig/Page/Mod/Wizards/NewContentElement.tsconfig index 8adc75cb..8f3aed3b 100644 --- a/public/typo3conf/ext/ep_theme/Configuration/TSconfig/Page/Mod/Wizards/NewContentElement.tsconfig +++ b/public/typo3conf/ext/ep_theme/Configuration/TSconfig/Page/Mod/Wizards/NewContentElement.tsconfig @@ -85,6 +85,12 @@ mod { } special { elements { + faq_overview { + iconIdentifier = content-ep_theme-ce + title = FAQ Alle Kategorien + description = Alle FAQ-Einträge nach Kategorie gruppiert + tt_content_defValues.CType = faq_overview + } lineup { iconIdentifier = content-ep_theme-ce title = Lineup @@ -104,7 +110,7 @@ mod { tt_content_defValues.CType = nlform } } - show := addToList(lineup, event_pricetable, nlform) + show := addToList(faq_overview, lineup, event_pricetable, nlform) } common { elements { diff --git a/public/typo3conf/ext/ep_theme/Configuration/TypoScript/ContentElements/faq_overview.typoscript b/public/typo3conf/ext/ep_theme/Configuration/TypoScript/ContentElements/faq_overview.typoscript new file mode 100644 index 00000000..a2496dc1 --- /dev/null +++ b/public/typo3conf/ext/ep_theme/Configuration/TypoScript/ContentElements/faq_overview.typoscript @@ -0,0 +1,17 @@ +tt_content.faq_overview =< lib.contentElement +tt_content.faq_overview { + templateName = FaqOverview + settings { + infoPageUid = {$plugin.tx_eptheme.settings.infoPageUid} + } + dataProcessing { + 10 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor + 10 { + table = tx_epproducts_domain_model_faq + where = category != '' + orderBy = category ASC, uid ASC + pidInList = {$plugin.tx_epproducts.settings.faqsStoragePid} + as = faqs + } + } +} diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/faq_controller.js b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/faq_controller.js index baa206a7..d155f2e0 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/faq_controller.js +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/faq_controller.js @@ -5,7 +5,7 @@ export default class extends Controller { static debounces = [ 'filter' ] - static targets = [ 'entry' ] + static targets = [ 'entry', 'category' ] initialize() { useDebounce(this) @@ -14,17 +14,20 @@ export default class extends Controller { filter(e) { let value = e.target.value if (value.length < 3) { - this.entryTargets.forEach(entry => { - entry.classList.remove('hidden') - }) + this.entryTargets.forEach(entry => entry.classList.remove('hidden')) + this.categoryTargets.forEach(category => category.classList.remove('hidden')) return } const pattern = new RegExp(value, 'i') this.entryTargets.forEach(entry => { const question = entry.querySelector('button span').textContent const answer = entry.querySelector('[data-rte-content]').textContent - const matches = question.match(pattern) || answer.match(pattern) - entry.classList.toggle('hidden', !matches) + entry.classList.toggle('hidden', !question.match(pattern) && !answer.match(pattern)) + }) + this.categoryTargets.forEach(category => { + const hasVisible = Array.from(category.querySelectorAll('[data-faq-target="entry"]')) + .some(entry => !entry.classList.contains('hidden')) + category.classList.toggle('hidden', !hasVisible) }) } } diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/FaqGroup.html b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/FaqGroup.html new file mode 100644 index 00000000..bb215063 --- /dev/null +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/FaqGroup.html @@ -0,0 +1,36 @@ + + + +
+ + {category} + + +
+ + +
+
+
+
+ + diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/FluidStyledContent/FaqOverview.html b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/FluidStyledContent/FaqOverview.html new file mode 100644 index 00000000..8fe9f4a7 --- /dev/null +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/FluidStyledContent/FaqOverview.html @@ -0,0 +1,42 @@ + + + + + + +
+
+
+ + Häufig gestellte Fragen + +
+ + {ep:icon(icon: 'search', class: 'w-6 h-6 text-white')} +
+ + + + +
+ {ep:icon(icon: 'info-circle', class: 'w-4 h-4')} + + Weitere Reiseinfos findet ihr hier + +
+
+
+
+
+
+
+ +