<?xml version="1.0" encoding="utf-8"?>
<article xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="JATS-journalpublishing1-mathml3.xsd" dtd-version="1.2" article-type="Dialog Box">
<front>
<journal-meta>
<journal-id journal-id-type="publisher">weaveux</journal-id>
<journal-title-group>
<journal-title>Weave (WEAVE)</journal-title>
</journal-title-group>
<issn pub-type="ppub"></issn>
<issn pub-type="epub"></issn>
</journal-meta>
<article-meta>
<article-id pub-id-type="publisher-id">5440</article-id>
<article-id pub-id-type="manuscript">implementing-a-common-header-and-footer-sy-edits-clean.docx</article-id>
<article-id pub-id-type="doi">10.3998/weaveux.5440</article-id>
<title-group>
<article-title>Designing and Implementing a Universal Header and Footer Across Disparate Library Web Properties</article-title>
</title-group>
<contrib-group>
<contrib contrib-type="author">
<name>
<surname>Weig</surname>
<given-names>Eric</given-names>
</name>
<email>eweig@uky.edu</email>
<aff id="aff1"><institution>University of Kentucky Libraries</institution></aff>
</contrib>
<contrib contrib-type="author">
<name>
<surname>Powers</surname>
<given-names>Neal</given-names>
</name>
<email></email>
<aff id="aff2"><institution>University of Kentucky Libraries</institution></aff>
</contrib>

<contrib contrib-type="author">
<name>
<surname>Slone</surname>
<given-names>MLE</given-names>
</name>
<email></email>
<aff id="aff3"><institution>University of Kentucky Libraries</institution></aff>
</contrib>
</contrib-group>
<pub-date><day></day><month></month><year></year></pub-date>
<volume>8</volume><issue>1</issue>
<history>
<date date-type="received"><day></day><month></month><year></year></date>
<date date-type="revised"><day></day><month></month><year></year></date>
<date date-type="rev-recd"><day></day><month></month><year></year></date>
<date date-type="accepted"><day>17</day><month>10</month><year>2024</year></date>
</history>
<permissions>
<license><license-p>CC BY 4.0</license-p>
</license>
</permissions>
<abstract id="ABS1"><p id="P1">A consistent header and footer can establish branding and create a consistent experience across disparate websites. Beginning in fall 2022, the University of Kentucky Libraries developed a universal header and footer for its web properties. We wrote the header and footer in JavaScript without using frameworks or third-party packages, and we deploy from a centralized location. Individual site managers can configure some aspects of the header and footer while preserving the consistent experience. In this article, we outline our design and implementation of this feature.</p></abstract>
<kwd-group>
<kwd/>
</kwd-group>
<funding-group/>
<counts>
<fig-count count="3"/>
</counts>
<custom-meta-group>
<custom-meta id="competing-interest">
<meta-name></meta-name>
<meta-value></meta-value>
</custom-meta>
</custom-meta-group>
</article-meta>
</front>
<body>
<sec id="S1"><title>Introduction</title>
<p>Branding across disparate library web properties improves user experience (UX) by establishing consistent look, feel, and navigation while providing accessibility landmarks in content markup. Achieving this consistency can be complex, requiring expertise across various content management systems and cumbersome implementation of even minor changes.</p>
<p>In fall 2022, the University of Kentucky Libraries (UKL) launched a first release of our universal header and footer. We maintain the universal header and footer program in one central location and push to various web properties via JavaScript. This approach allows individual site managers to customize and select desired content elements of the header and footer using configuration files. In 2024, we implemented a second and third release of the header and footer. With several years of practical use to draw conclusions from, this article outlines our design and implementation approach.</p>
</sec>
<sec id="S2"><title>Design Overview</title>
<p>The universal header and footer comprises six layers. Layer two of the header and layer six, the footer (see <xref ref-type="fig" rid="F_1">fig. 1</xref>), are the only required layers for every property, per a guideline for all university web properties. The content for layers one, four, and five are centrally located in the global configuration file. This centralization provides a vector for dissemination of surveys, outage communication, and possible short-term closures of libraries (e.g., inclement weather).</p>
<fig id="F_1" position="float"><label>Figure 1.</label><caption><title>Sample header and footer with all components expanded.</title></caption><graphic xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="weaveux.5440-f0001.jpg"/></fig>
<p>Along with the global configuration for layers, we have implemented a system that allows per-vendor configuration of layer three, the website navigation. Most of the new features in the most recent iteration occurred here. Our team has implemented these configurations as a series of JavaScript objects, each exported from their own file and then imported to the main script via dynamic import. We use a content delivery network (CDN) in case of local network failures. We discuss these details below.</p>

</sec>
<sec id="S3"><title>Design Principles</title>
<sec id="S4"><title>Keep it Simple</title>
<p>A major goal of our work has been to keep the implementation simple, avoiding external dependencies where possible. The universal header and footer uses fewer than 400 lines of JavaScript code and functions without any additional libraries or frameworks. This implementation strategy allows the team to work in a codebase that is simple to understand and easy for vendors to change.</p>
<p>The universal header and footer are divided into modules. This allows a main program file to import configuration files customized for particular UKL web properties.</p>
</sec>
<sec id="S5"><title>Centralize Configuration</title>
<p>Having a single set of files for header and footer content across multiple websites reduces development costs of maintaining, extending, and troubleshooting the code. Instead of multiple implementations across various content management systems and programming languages, there is one centralized set of files. This allows a group of editors to connect to a single file system to modify configurations and code instead of connecting to multiple systems. Adjusting the HTML response header configuration via server settings also allows us to disable caching of the universal header and footer files, so that users receive changes immediately. You can see the implementation of the universal header and footer in <xref ref-type="fig" rid="F_2">Figure 2</xref>.</p>
<fig id="F_2" position="float"><label>Figure 2.</label><caption><title>Network architecture of the universal header and footer.</title></caption><graphic xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="weaveux.5440-f0002.jpg"/></fig>
</sec>
<sec id="S6"><title>Follow Campus Branding Standards</title>
<p>Work on the universal header and footer began with collaboration between library personnel and members of our campus Marketing and Brand Strategy Web Communications group. This group provided us with campus web standards, including required colors, fonts, logos, navigation links, and mandatory header and footer elements, as well as a mockup design adhering to these standards. Once we reached consensus on design of the mockup, we began work on coding the header and footer.</p>
</sec>
<sec id="S7"><title>Coordinate Messaging Across the Libraries</title>
<p>We wanted to be able to coordinate messaging across library web pages, and the universal header and footer helped us with this goal. Having the code in one location facilitated separate configurations for each satellite website while also establishing a global config to turn on alert messages and survey prompts for all websites set to allow this feature.</p>
</sec>
<sec id="S8"><title>Follow Web Accessibility Standards</title>
<p>We built the header to meet Web Content Accessibility Guidelines. We took the colors from campus web standards and composed them to pass requirements for text contrast. Where the contrast was close to failing guidelines, we increased font weight. We used Accessible Rich Internet Applications labels throughout the headers to provide access to screen readers. We also selected the project font from the list of campus web standards. We chose Usual from Adobe Fonts for its flexibility as both a header and body text font, maintaining clear contrast at larger sizes and readability at smaller ones.</p>
</sec>
<sec id="S9"><title>Enable Reuse Across the Libraries</title>
<p>Another design goal was the ability to reuse the code across web properties. We accomplished this via the combination of dynamic imports and an HTML attribute named &#x201C;data-base_path.&#x201D; This attribute serves as the path on our server where the configuration would be loaded differently for various &#x201C;data-base_path&#x201D; attributes. We provide details for this configuration below.</p>
</sec>
<sec id="S10"><title>Maintain Code Flexibility</title>
<p>While developing and maintaining software is a continuous effort, the current iteration has proven flexible enough to add features quickly. In the third design iteration, we added new features in anticipation of release among several UKL web properties: requested logos with appropriate fallbacks for each vendor, additional messaging layers, and optional drop-down menus. Throughout the process of adding features, we continue to incrementally refactor code to improve simplicity of the design. With the current setup, we provide the resources needed for each new feature within the configuration, and we add the code for using that data either as part of a function or a function by itself.</p>
</sec>
<sec id="S11"><title>Provide Fallback for Code Delivery</title>
<p>The header&#x2019;s current implementation involves recreating the script from a different source in case of errors. This source for fallback behavior is a CDN that allows us a fallback with multiple points of failure. We designated the CDN as a fallback instead of as the primary distributor because of caching concerns; it sets browser caching expirations at around a week from their first usage of the header. This long expiration time means changes don&#x2019;t appear quickly, so we can&#x2019;t use it as a primary source. But using it as a fallback allows us to set generic messaging to let users know there is a problem, and the version on campus will replace it as soon as website issues are resolved.</p>
<p>The implementation assumes that if one of the pieces of the universal header were to fail, then all would fail. Essentially, the only piece that triggers fallback behavior is the error occurring on the universal header HTML script. On an error, the script will:
<list list-type="order">
<list-item><p>Rebuild itself with the script hosted on the CDN</p></list-item>
<list-item><p>Rebuild the footer with the script hosted on the CDN</p></list-item>
<list-item><p>Set the src attribute for the CSS to be that of the CDN</p></list-item>
<list-item><p>Clean up the HTML, deleting the unused scripts from the page</p></list-item>
</list>
This allows us to note any errors in the console but retain a smooth experience for users.</p>
</sec>
<sec id="S12"><title>Customization for Individual Sites</title>
<p>We implemented the universal header and footer as a script tag in the html &#x003C;head&#x003E; element. It includes the location of the script, as well as some fallback behavior in a block of JavaScript. An example of the implementation is in <xref ref-type="fig" rid="F_3">Figure 3</xref>.</p>
<fig id="F_3" position="float"><label>Figure 3.</label><caption><title>Example implementation of main header script.</title></caption><graphic xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="weaveux.5440-f0003.jpg"/></fig>
<p>Required elements in our implementation are standardized identification names and specification of a &#x201C;data-base_path&#x201D; that corresponds to the file path of the configuration on the host server. In universalheader.js, we select this HTML attribute and, using the dynamic import language feature, import the appropriate configuration for the host of the HTML. The dynamic import is a feature introduced in 2020 that allows us to import modules via a path or URL, a useful tool in this case. This allows the universal header to take different configurations of certain layers for each vendor.</p>
<p>For organizational clarity, we standardize the configuration file paths. Additionally, we use a global configuration for items that our team wishes to standardize between instances, for example, exact colors for each layer and the various pieces of central messaging. Figure 3 illustrates the layering.</p>
</sec>
</sec>
<sec id="S13"><title>Testing and Implementation</title>
<p>Prior to full implementation of the universal header and footer, we tested with individual sites, including several supported by Omeka and Springshare and our Ex Libris Primo online catalog. A small number of CSS conflicts with individual sites led us toward prefixing all CSS rules, as well as a CSS reset within our universal header and footer. The additional specificity standardizes CSS rules to avoid styling conflicts across UKL web properties.</p>
</sec>
<sec id="S14"><title>Conclusion</title>
<p>UKL have been pleased with our universal header and footer since its debut in 2022. Achieving a common look and feel, consistent navigation, and adherence to branding standards were long-term goals to create better UX across UKL web properties. With a design that emphasizes simplicity, our team has been able to add new features at a rapid pace. Promotion of the universal header and footer to faculty and staff continues. We customized it for individual sites based on stakeholder input, and we have extended it to encompass additional features, including support for the presentation of library surveys. In early 2024, this allowed us to extend the promotional reach of our survey beyond the libraries&#x2019; main website. Moving forward, we will continue to improve accessibility and customization for the header and footer while expanding implementation throughout UKL.</p>
</sec>
</body>
</article>
