๐Ÿš€ Integration Examples

Learn how to integrate the Accessibility Widget into your projects

๐Ÿ“‹ Basic HTML Integration

The simplest way to add accessibility features to any website. This method works for any static HTML page or CMS where you have direct access to the HTML file.

<!-- Place this single line of code at the very end of your page's body, just before the closing </body> tag. -->
<script src="https://barrierefreie-web.de/plugin.php"
async defer></script>

๐Ÿ”Œ Content Management Systems (CMS)

For platforms like WordPress, Joomla, Drupal, TYPO3, Ghost, Concrete5, and Craft CMS, you should add the script in a way that survives theme or system updates. This is typically done in a core theme file or a dedicated "custom code" area.

The recommended and most common method for adding scripts. Add this code to your theme's functions.php file or use a plugin like "Insert Headers and Footers" to easily manage scripts.

// Enqueue the external script correctly via WordPress's system. function add_accessibility_widget() { wp_enqueue_script('accessibility-widget-js', 'https://barrierefreie-web.de/plugin.php', array(), null, true); } add_action('wp_enqueue_scripts', 'add_accessibility_widget');

For Joomla, you can add it directly to your template's main file. Navigate to Extensions > Templates > Templates, select your theme, and find index.php. Add the code before the closing </body> tag.

<?php defined('_JEXEC') or die; ?> //... your template content ... <script src="https://barrierefreie-web.de/plugin.php" async defer></script> </body> </html>

For Drupal, the recommended method is to declare the script as a library and then attach it to your theme or module.

# Add to your theme's .libraries.yml file (e.g., mytheme.libraries.yml) accessibility-widget: js: 'https://barrierefreie-web.de/plugin.php': { type: 'external', minified: true } dependencies: - core/jquery // Then attach it in your theme or module using a hook like this: function mytheme_page_attachments_alter(array &$attachments) { $attachments['#attached']['library'][] = 'mytheme/accessibility-widget'; }

Add the script via TypoScript or in a template file. Using TypoScript is the recommended method to avoid losing the code during updates.

// In your TypoScript setup, add this line: page.includeJSFooter.accessWidget = https://barrierefreie-web.de/plugin.php

Ghost provides a "Code Injection" feature in its admin panel. Navigate to Settings > Code Injection and paste the script tag into the Site Footer section.

<!-- Paste this into the Ghost "Site Footer" code injection area --> <script src="https://barrierefreie-web.de/plugin.php" async defer></script>

For Craft CMS, you can add the script to your main layout template file, typically _layout.twig or _layout.html. Place the script tag before the closing </body> tag.

{# In your main layout template file #} <script src="https://barrierefreie-web.de/plugin.php" async defer></script> </body> </html>

In Concrete5, you can add the script via the "Sitemap" or "Page Types" dashboard. Go to Dashboard > Pages & Themes > Page Types and edit the default page type. Under HTML Editor, add the script to the footer area.

<!-- Paste this into the Concrete5 HTML Editor --> <script src="https://barrierefreie-web.de/plugin.php" async defer></script>

OctoberCMS uses a similar approach to other CMS. Add the script to your main layout file, for example, /themes/your-theme/layouts/default.htm. Place the tag before the closing </body> tag.

{# In your OctoberCMS layout file #} <script src="https://barrierefreie-web.de/plugin.php" async defer></script> </body> </html>

๐Ÿ›๏ธ E-Commerce Platforms

For platforms like Shopify, BigCommerce, PrestaShop, or Magento, use the dedicated "Custom Code" or "Script Manager" sections in your admin panel to add the widget globally to all pages.

Navigate to your Shopify admin panel, go to Online Store > Themes > Actions > Edit code, then select theme.liquid and paste the script before the </body> tag.

<!-- Code added to Shopify theme.liquid --> <script src="https://barrierefreie-web.de/plugin.php" async defer></script>

WooCommerce runs on WordPress, so you can follow the standard WordPress integration process. Alternatively, you can use the "Insert Headers and Footers" plugin and paste the script tag into the footer section.

// Same as WordPress, add this to a plugin or functions.php function add_accessibility_widget_woo() { wp_enqueue_script('accessibility-widget-js', 'https://barrierefreie-web.de/plugin.php', array(), null, true); } add_action('wp_enqueue_scripts', 'add_accessibility_widget_woo');

In Magento, the best way is to add it via the admin panel. Go to Content > Design > Configuration, select your theme, and under the HTML Head or Footer section, add the script to the "Scripts and Style Sheets" or "Footer" field.

<!-- Code added via Magento Admin Panel --> <script src="https://barrierefreie-web.de/plugin.php" async defer></script>

For BigCommerce, navigate to Storefront > Script Manager in your admin panel. Click "Create a Script," give it a name, set the location to "Footer," and paste the script tag into the "Script Content" field.

// Paste this into the "Script Manager" in BigCommerce <script src="https://barrierefreie-web.de/plugin.php" async defer></script>

PrestaShop lets you add custom code in the back office. Go to Design > Themes & Logo > Theme Configuration and look for a section to add custom code to the footer.

<!-- Paste this into the custom code section in PrestaShop --> <script src="https://barrierefreie-web.de/plugin.php" async defer></script>

In Wix, go to your site's dashboard and navigate to Settings > Custom Code. Click "Add Custom Code," select "Footer" as the placement, and paste the script tag.

// Add this to the "Custom Code" section in Wix <script src="https://barrierefreie-web.de/plugin.php" async defer></script>

For other platforms like OpenCart, Ecwid, Volusion, nopCommerce, PlentyShop, or Shift4Shop, the process is similar. You'll typically find a "Script Manager," "Global Scripts," or "Custom Code" area in your store's admin dashboard to paste the script tag.

<!-- Add via your e-commerce platform's admin settings --> <script src="https://barrierefreie-web.de/plugin.php" async defer></script>

๐ŸŒ Website Builders & Headless CMS

For website builders like Wix, Squarespace, Webflow, or Duda, and headless CMS platforms like Strapi or Contentful, you will use a custom code injection method. The process for headless CMSs depends on the frontend framework you are using (e.g., React or Vue). The most common approach is to add the script in the "Footer" or "Custom Code" section of your site's dashboard.

In your Wix dashboard, go to Settings > Custom Code. Click "Add Custom Code" and paste the script tag. Make sure to set the placement to "Body - End" to ensure it loads correctly.

<!-- Paste this into the custom code section in Wix --> <script src="https://barrierefreie-web.de/plugin.php" async defer></script>

For Squarespace, navigate to Settings > Advanced > Code Injection. You can paste the script into the "Footer" section to ensure it appears on all pages.

<!-- Paste this into the Squarespace "Code Injection" Footer --> <script src="https://barrierefreie-web.de/plugin.php" async defer></script>

In Webflow, go to Project Settings > Custom Code. You can paste the script tag into the "Footer Code" area to load the widget on every page of your site.

<!-- Paste this into the Webflow "Footer Code" --> <script src="https://barrierefreie-web.de/plugin.php" async defer></script>

For other builders like Weebly, Jimdo, Site123, Duda, GoDaddy, Strikingly, or Bookmark, look for a "custom HTML," "embed code," or "code injection" feature in your dashboard or page editor. This is the simplest way to add the script globally.

<!-- Paste this into your website builder's code injection section --> <script src="https://barrierefreie-web.de/plugin.php" async defer></script>

โš›๏ธ Frontend Frameworks & Libraries

For Single Page Applications (SPAs) and frameworks, it's best to load the script programmatically to ensure it's handled correctly within the component lifecycle.

Use the useEffect hook to load the script when your main component mounts. For Next.js, this should be done in pages/_app.js or _document.js.

// In your main component (e.g., App.jsx or pages/_app.js in Next.js) import { useEffect } from 'react'; export default function App() { // The useEffect hook ensures the script is loaded only once when the component mounts. useEffect(() => { const script = document.createElement('script'); script.src = 'https://barrierefreie-web.de/plugin.php'; script.async = true; script.defer = true; document.body.appendChild(script); // The return function handles cleanup when the component unmounts. return () => { if (document.body.contains(script)) { document.body.removeChild(script); } }; }, []); return (
{/* Your application's content goes here */}
); }

You can add the script directly to index.html (recommended for simplicity) or load it dynamically using Renderer2 in a service or component.

// In your src/index.html before the closing </body> tag <script src="https://barrierefreie-web.de/plugin.php" async defer></script>

Use the onMounted hook for the Composition API, or the mounted() hook for the Options API in your main component. For Nuxt.js, you can add it to the nuxt.config.js file.

// Using the Composition API in a component import { onMounted } from 'vue'; export default { setup() { onMounted(() => { const script = document.createElement('script'); script.src = 'https://barrierefreie-web.de/plugin.php'; script.async = true; script.defer = true; document.head.appendChild(script); }); } }

Use the onMount lifecycle function to load the script when the component is created. This is typically done in your main App.svelte file.

// In your main component, e.g., App.svelte import { onMount } from 'svelte'; onMount(() => { const script = document.createElement('script'); script.src = 'https://barrierefreie-web.de/plugin.php'; script.async = true; script.defer = true; document.body.appendChild(script); });

In Ember, you can add the script in a component's didInsertElement hook or load it in a service to ensure it's available globally once the app has rendered.

// In an Ember component import Component from '@ember/component'; export default Component.extend({ didInsertElement() { this._super(...arguments); const script = document.createElement('script'); script.src = 'https://barrierefreie-web.de/plugin.php'; script.async = true; script.defer = true; document.body.appendChild(script); } });

For Backbone.js, you can load the script when your main application view is rendered. Add the script tag to your main HTML file or dynamically load it as shown here.

// In your main Backbone view render() { this.el.innerHTML = `<h1>My App</h1>`; const script = document.createElement('script'); script.src = 'https://barrierefreie-web.de/plugin.php'; script.async = true; script.defer = true; document.body.appendChild(script); return this; }

Alpine.js is lightweight, so you can simply add the script tag to your HTML file, just as with basic HTML integration. Place it just before the closing </body> tag.

<!-- Place this at the end of your page's body --> <script src="https://barrierefreie-web.de/plugin.php" async defer></script>

๐Ÿ–ฅ๏ธ Backend & Static Site Platforms

For platforms like Node.js, Django, Ruby on Rails, Laravel, Hugo, or Jekyll, the process is the same as basic HTML. You need to add the script tag to the main template or layout file that renders the HTML for your site's pages.

In a Node.js/Express application using a templating engine like EJS, you would add the script to your main layout file, for example, views/layout.ejs.

// In your EJS layout file <script src="https://barrierefreie-web.de/plugin.php" async defer></script> </body> </html>

In a Django project, you will add the script to your base template file, typically base.html. This ensures the script is loaded on every page that inherits from this template.

{# In your Django base.html template #} <script src="https://barrierefreie-web.de/plugin.php" async defer></script> </body> </html>

For Laravel, you will add the script to your main layout file, usually resources/views/layouts/app.blade.php, placing it before the closing </body> tag.

{{-- In your Laravel Blade template --}} <script src="https://barrierefreie-web.de/plugin.php" async defer></script> </body> </html>

Hugo is a static site generator. You will add the script tag to your theme's main layout or partials, such as layouts/_default/baseof.html, to ensure it's included on every page.

{{- "" | safeHTML -}} <script src="https://barrierefreie-web.de/plugin.php" async defer></script> </body> </html>

For Jekyll, add the script to the main layout file, which is often named _layouts/default.html. Place the script tag before the closing </body> tag.

{# In your Jekyll layout file #} <script src="https://barrierefreie-web.de/plugin.php" async defer></script> </body> </html>

For platforms like Flask, Symfony, Spring Boot, ASP.NET Core, or CakePHP, the integration method is to simply add the script tag to your main layout or template file, just like a standard HTML site.

// In your main layout/template file <script src="https://barrierefreie-web.de/plugin.php" async defer></script>

โ˜๏ธ Headless CMS / API-First Platforms

For headless CMS solutions, the integration process depends entirely on the frontend framework you are using. You will follow the steps for the specific framework (e.g., React, Vue, Next.js) and add the script tag to your frontend application's main layout file.

When using Strapi, you're building a separate frontend. If your frontend is a React app, you would follow the **React/Next.js** instructions above. If it's a Vue app, you'd use the **Vue.js/Nuxt.js** instructions.

// The integration is handled in your chosen frontend framework. // Example: In a React component that fetches data from Strapi. import { useEffect } from 'react'; // ... your component code ... useEffect(() => { // Load script for the accessibility widget const script = document.createElement('script'); script.src = 'https://barrierefreie-web.de/plugin.php'; document.body.appendChild(script); }, []);

Contentful also provides content via API, so you'll integrate the script on your frontend. For example, if you're building a static site with Gatsby, you'll follow the **Static Site Generators** instructions for Gatsby.

// The integration depends on your frontend stack, e.g., Gatsby. // See the 'Static Site Generators' section for specific instructions.

For other platforms like Sanity.io, Prismic, GraphCMS (Hygraph), DatoCMS, Kentico Kontent, or Directus, the process is the same as the above. The integration is handled on the frontend application that consumes the content from the headless CMS.

// The integration is performed in the frontend application that displays the data. // Refer to the 'Frontend Frameworks' or 'Static Site Generators' sections for guidance.

๐Ÿ“ˆ Specialized Platforms

For specialized platforms like Teachable, Thinkific, Kajabi, ClickFunnels, Podia, Substack, or Medium, integration is typically done through a dedicated "Custom Code" or "Analytics" section in the administrative dashboard.

In Teachable or Thinkific, you can add custom code to your site's header or footer. For Teachable, go to Settings > Code Snippets. For Thinkific, go to Settings > Code & Analytics.

<!-- Paste this into the custom code section --> <script src="https://barrierefreie-web.de/plugin.php" async defer></script>

For Kajabi, go to Settings > Site Details and find the "Page Scripts" section. You can paste the script tag into the "Header Page Scripts" or "Footer Page Scripts" area.

<!-- Paste into Kajabi's Page Scripts section --> <script src="https://barrierefreie-web.de/plugin.php" async defer></script>

In ClickFunnels, open your funnel and go to Settings > Tracking Code. Paste the script into the "Footer Code" section to add it to all pages in your funnel.

<!-- Paste into ClickFunnels' Tracking Code section --> <script src="https://barrierefreie-web.de/plugin.php" async defer></script>

For platforms like Podia, Substack, or Medium, you typically have limited customization options. For Podia, look for a "code snippet" area in the platform's settings. For Substack and Medium, adding third-party scripts is not officially supported, but you might be able to add custom HTML blocks in certain contexts.

// The ability to add scripts may vary. Check the platform's custom code documentation.

โš™๏ธ Advanced Configuration

You can customize the widget's behavior by configuring its global window.AccessibilityWidget object before the script loads. This allows you to change its position, branding, and more.

Custom Position

Change widget position and appearance

White Label

Customize branding and colors

Analytics

Integrate with GA4 or Adobe Analytics

Multi-language

Support for 140+ languages

// Add this configuration object BEFORE the script tag loads. <script> window.AccessibilityWidget = { config: { position: 'bottom-left', iconColor: '#your-brand-color', iconSize: '60px', language: 'es', enableAnalytics: true, branding: { companyName: 'Your Company', logo: 'path/to/logo.png', colors: { primary: '#4F46E5', secondary: '#6366F1' } } } }; </script> // Then load the script <script src="https://barrierefreie-web.de/plugin.php" async defer></script>

๐ŸŽฎ Programmatic Control

Once the widget is loaded, you can control its features and panel using JavaScript. This is useful for custom buttons or site-specific interactions.

// Access the widget instance const widget = window.AccessibilityWidget; // Toggle specific features widget.toggleSetting('darkContrast'); widget.toggleSetting('textToSpeech'); widget.toggleSetting('readingGuide'); // Adjust numeric settings widget.adjustSetting('fontSize', 1); widget.adjustSetting('contentSize', -1); // Control panel widget.openPanel(); widget.closePanel(); widget.togglePanel(); // Settings management widget.resetSettings(); widget.saveSettings(); console.log(widget.state.settings);

๐Ÿงช Testing & Validation

A few examples of how to verify that the widget is loading and functioning correctly.

๐Ÿ’ก Pro Tip: Always test your accessibility features with real users and assistive technologies.

Screen Readers

Test with NVDA, JAWS, VoiceOver

Keyboard Navigation

Ensure all features work with Tab/Enter

Color Contrast

Verify WCAG AA compliance

Mobile Testing

Test on various devices and orientations

// Automated testing example with a tool like Jest or Cypress. describe('Accessibility Widget', () => { test('should initialize correctly', () => { expect(window.AccessibilityWidget).toBeDefined(); expect(document.getElementById('accessibility-launcher')).toBeInTheDocument(); }); test('should toggle panel on click', () => { const button = document.getElementById('accessibility-trigger'); button.click(); expect(document.getElementById('accessibility-panel')).toHaveClass('open'); }); });