feat: add footer menu, change paginator design

This commit is contained in:
2024-12-15 20:44:43 +01:00
parent 696881e4f8
commit 8905c5731d
6 changed files with 43 additions and 15 deletions

View File

@@ -0,0 +1,4 @@
# Define the footer menu PID as a constant to make it easily configurable
page {
footerMenuPid = 7
}

View File

@@ -1,5 +1,7 @@
# Include existing configuration # Include existing configuration
<INCLUDE_TYPOSCRIPT: source="DIR:EXT:base/ContentBlocks" extensions="typoscript"> <INCLUDE_TYPOSCRIPT: source="DIR:EXT:base/ContentBlocks" extensions="typoscript">
# Include constants
#<INCLUDE_TYPOSCRIPT: source="FILE:EXT:base/Configuration/Sets/SitePackage/TypoScript/constants.typoscript">
page = PAGE page = PAGE
page { page {
@@ -23,6 +25,12 @@ page {
as = mainnavigation as = mainnavigation
} }
30 = page-content 30 = page-content
40 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
40 {
special = directory
special.value = 7
as = metanavigation
}
} }
} }
@@ -50,8 +58,6 @@ page {
} }
# Use includeAssets to properly preload fonts with TYPO3 v13 asset handling. # Use includeAssets to properly preload fonts with TYPO3 v13 asset handling.
# Make sure the font filenames do not have spaces. Convert them to use hyphens or underscores.
# After that, the AssetCollector will handle publishing to _assets folder.
includeAssets { includeAssets {
hajimeSansTtf { hajimeSansTtf {
path = EXT:base/Resources/Public/Fonts/Hajime-Sans.woff2 path = EXT:base/Resources/Public/Fonts/Hajime-Sans.woff2
@@ -77,6 +83,8 @@ page {
} }
} }
} }
footerMenuPid = {$footerMenuPid}
} }
lib.contentElement { lib.contentElement {
@@ -101,3 +109,17 @@ lib.parseFunc_RTE {
} }
} }
} }
# Define the footer menu to show subpages of the configured footerMenuPid
# special = directory will list all direct subpages of the given pid, not the page itself
lib.footerMenu = HMENU
lib.footerMenu {
special = directory
special.value = {$footerMenuPid}
1 = TMENU
1 {
wrap = <ul>|</ul>
NO = 1
NO.wrapItemAndSub = <li>|</li>
}
}

View File

@@ -19,7 +19,7 @@
</li> </li>
</f:if> </f:if>
<f:for each="{pagination.allPageNumbers}" as="page"> <f:for each="{pagination.allPageNumbers}" as="page">
<li class="{f:if(condition: page == paginator.currentPageNumber, then:'current')}"> <li class="{f:if(condition: '{page} == {paginator.currentPageNumber}', then:'current')}">
<a href="{f:uri.action(action:actionName, arguments:{currentPage: page},addQueryString:'untrusted')}">{page}</a> <a href="{f:uri.action(action:actionName, arguments:{currentPage: page},addQueryString:'untrusted')}">{page}</a>
</li> </li>
</f:for> </f:for>

View File

@@ -26,7 +26,13 @@
<div class="site-footer__bottom"> <div class="site-footer__bottom">
<div class="site-footer__bottom-grid"> <div class="site-footer__bottom-grid">
<ul class="site-footer__legal"> <ul class="site-footer__legal">
<f:cObject typoscriptObjectPath="lib.footerMenu" /> <f:for each="{metanavigation}" as="item">
<li{f:if(condition: item.active, then:' class="active"')}>
<a href="{item.link}"{f:if(condition: '{item.target}', then: ' target="{item.target}"')}{f:if(condition: '{item.target} == "_blank"', then: ' rel="noopener noreferrer"')} title="{item.title}">
<span>{item.title}</span>
</a>
</li>
</f:for>
</ul> </ul>
<p class="site-footer__copyright">© All Right Reserved</p> <p class="site-footer__copyright">© All Right Reserved</p>
</div> </div>

View File

@@ -2,6 +2,7 @@
background-color: var(--bs-primary); background-color: var(--bs-primary);
color: var(--bs-yellow); color: var(--bs-yellow);
font-family: 'Inter', sans-serif; font-family: 'Inter', sans-serif;
font-weight: 700;
border-radius: .5rem; border-radius: .5rem;
padding: 0.75rem 1.5rem; padding: 0.75rem 1.5rem;
border: none; border: none;

View File

@@ -46,9 +46,10 @@
color: $primary-color; color: $primary-color;
} }
&.current a { &.current a, a:hover {
background: lighten($primary-color, 20%); background: var(--bs-primary);
color: $secondary-color; color: var(--bs-yellow);
font-weight: bold;
} }
a { a {
@@ -57,16 +58,10 @@
height: 2.5rem; height: 2.5rem;
line-height: 2.5rem; line-height: 2.5rem;
text-align: center; text-align: center;
border-radius: 50%; border-radius: 0.5rem;
background: $primary-color; background: transparent;
color: $secondary-color;
font-weight: bold;
text-decoration: none; text-decoration: none;
transition: background 0.3s ease-in-out; transition: background 0.3s ease-in-out;
&:hover {
background: lighten($primary-color, 10%);
}
} }
} }
} }