You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is an attempt at describing the required data structure for a configuration based header v2. It was created in July 2024 so it likely needs some adaption to the updated header concept, but can serve as a starting point.
/** * Questions: * * Meeting 19.08.: * - How can icons be loaded/displayed efficiently (SSR)? -> Store number in sanity (create icon select component for sanity) * - How can the logo image be loaded/displayed efficiently? -> Sanity Asset Management CDN, maybe not only link but also size information available via config * - Does it make sense/is it possible to version the API? -> Possible when implementing an API on next.js * * Open: * - Does it make sense to handle skiplinks through the config? * - Not sure if user menu really is a generic array? * - Should header and footer config be separate endpoints (so they can be used independently of each other or footer data can be lazy loaded)? *//** * API request params * * - Project ID * - Environment * - Current language * - Current URL (referrer enough?) * - API version *//** * Config for the currently active language, parameter set in the query * https://api.post.ch/whatever/?service=[serviceID]&language=[currentLanguage]&environment=[currentEnvironment]&version=[supportedVersion] */interfaceConfig{header: Header;footer: Footer;}/** * Configuration for the Header * Design: https://www.figma.com/design/JIT5AdGYqv6bDRpfBPV8XR/Foundations-%26-Components-Next-Level?node-id=558-7012&t=aD9LT13cyCMwoTig-1 */interfaceHeader{/** * A generic title for the whole header navigation * Example: "Navigieren auf post.ch" * Data owner: OD */title: AccessibleText;/** * Config for the global header section * - Should we flatten this? */globalNavigation: {/** * The company logo * Data owner: Company */logo: {link: Link;image: Image;};/** * For switching between different contexts * Private Customers | Business Customers | Government Customers * Data owner: Company */businessDomains?: LinkList<StatefulLink>;/** * Generic links like Jobs | About * Data owner: Company */metaNavigation?: LinkList<StatefulLink>;/** * Optional language switch (optional only if the page is not offered in multiple languages) * Data owner: OD */languages?: {changeLanguageButton: Button;// Text: 'DE', Label: 'Sprache wechseln', Description: 'Aktuelle Sprache ist Detusch'availableLanguages: LinkList<LanguageOption>;};/** * Optional coveo search * Data owner: Portal */search?: {title: AccessibleText;// Title of the search dropdownsearchToggleButton: Button;// "Suche" | "Suche öffnen", opens or closes the search overlaysearchButton: Button;// Label: "Suche starten", starts a searchcloseButton: Button;// Label: "Suche schliessen", The X, closes the search overlayclearSearchButton: Button;// The button that clears the current search termsearchField: InputField;// Label and placeholder for the search inputmaxSuggestions: number;// Currently hard-coded to 8charThreshold: number;// Currently hard-coded to 2, minimum amount of chars before suggestions are starting to be fetchedinitialRecommendations: LinkList<LinkWithIcon>;// Initially shown search recommendationstrackAndTrace?: {suggestionIcon: Icon;redirectPattern: string;// Regex for parcel numbersredirectUrl: string;};places?: {suggestionIcon: Icon;redirectUrl: string;maxPlacesSuggestions: number;};coveo?: {suggestionIcon: Icon;redirectUrl: string;searchHub: string;pipeline: string;maxCoveoSuggestions: number;suggestionUrl: string;environment: CoveoEnvironment;};};/** * Optional KLP login * Data owner: OD, Portal * - Login and logout url need to be configurable per OD * - User infos come from n.account.post.ch */KLP?: {loginLink: Link;messagesAvailableText: AccessibleText;// "Neue Nachrichten verfügbar", description for the little red dot signaling that new messages arrivedopenUserMenuButton: Button;// "Benutzermenu öffnen", Button for opening user menu when logged incloseUserMenuButton: Button;// "Benutzermenu schliessen", X Button for closing user menuuserMenu: LinkList<LinkWithIcon>;// List of links with icons, My profile, messages, settings, change account, logoutnotificationsEndpoint: string;// Not sure how they are used within the widgetkeepAliveURL: string;autoLoginURL: string;endpoint: string;};};/** * Navigation for content (external) pages * Data owner: OD */contentNavigation?: {menuButton: Button;// "Menü", displayed on mobilecloseButton: Button;// Button for closing megadropdownbackButton: Button;// "Zurück", "Zurück zur vorherigen Navigation", Button for goin back in the mobile menupageTitle?: AccessibleText;navigationTitle: AccessibleText;// "Hauptnavigation", accessible name for the navigationlinkList: LinkList<LinkList<StatefulLink>>|StatefulLink;// Either a link or a megadropdown};/** * Side navigation for applicatorical pages * Data owner: OD */applicationNavigation?: {menuButton: Button;// "Menü"navigationTitle: AccessibleText;// "Hauptnavigation", accessible name for the navigationapplicationTitle?: AccessibleText;linkList: LinkList<StatefulLink>|StatefulLink;// No megadropdown possible, just a simple link list or a link};}/** * Configuration for the footer * Design: https://www.figma.com/design/JIT5AdGYqv6bDRpfBPV8XR/Foundations-%26-Components-Next-Level?node-id=558-7013&t=aD9LT13cyCMwoTig-1 */interfaceFooter{title: AccessibleText;/** * Custom footer links * Data owner: OD */directEntryLinks?: LinkList;/** * Links about the company * Data owner: OD, Company */aboutLinks?: LinkList;/** * Getting help * Data owner: OD, Company */helpAndContactLinks?: LinkList;/** * Customizable links * Data owner: OD */serviceLinks?: LinkList;/** * List of available social media channels * Data owner: OD */socialLinks?: LinkList<LinkWithIcon>;/** * List of stores where [app] is available * Data owner: OD */appStoreLinks?: LinkList<LinkWithIcon>;/** * List of companies * Data owner: Company */companyLinks: LinkList;/** * List of meta footer links for compliance, terms, etc. * Data owner: Company */complianceLinks: LinkList;/** * The copyright notice * Data owner: Company */copyright: string;}// ========================================================== Shared interfaces & types ========================================================== ///** * String with optional possibilities for alternative screen reader text and additional description * At least text or label has to be present */interfaceAccessibleText{text?: string;// What's displayed on screenlabel?: string;// aria-label, replaces text for screenreadersdescription?: string;// aria-description, being read after text or label// title?: string; // Intended to be displayed as tooltip, acts like description for screenreaders <-- not used in the header}/** * Link with optional attributes for Google Analytics tracking */interfaceLinkextendsAccessibleText{href: string;attributes?: AnalyticsAttribute[];}/** * Button with optional attributes for Google Analytics tracking */interfaceButtonextendsAccessibleText{attributes?: AnalyticsAttribute[];}/** * A link that can be active (active menu item) */interfaceStatefulLinkextendsLink{active: boolean;}/** * An option for the language switch */interfaceLanguageOptionextendsLink{label: string;// Label is not optional for languageslanguageShortCode: string;// ISO 639 2 char short code https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes}/** * Attributes used by Google Analytics to collect accurate data */interfaceAnalyticsAttribute{name: string;value: string;}interfaceCoveoEnvironment{organisation: string;token: string;}interfaceIcon{iconNumber: number;}interfaceImage{src: string;// Source URLwidth?: number;// Width in pixelsheight?: number;// Height in pixelsalt: string;// Alternative text}typeLinkWithIcon=Link&Icon;interfaceLinkList<T=Link>{title: AccessibleText;linkList: T[];}/** * For re-usability, AccessibleText maps like this: * <label>{text}</label> * <input * placeholder={placeholder} * aria-label={label} * aria-description={description} * /> * <post-tooltip>{title}</post-tooltip> */interfaceInputFieldextendsAccessibleText{placeholder?: string;}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
This is an attempt at describing the required data structure for a configuration based header v2. It was created in July 2024 so it likely needs some adaption to the updated header concept, but can serve as a starting point.
Beta Was this translation helpful? Give feedback.
All reactions