Skip to content
webmanifest for SilverStripe per YML and/or SiteConfig
PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
_config add meta if CMS exists Sep 30, 2019
src/Webmanifest
.editorconfig
.gitignore initial commit (WIP) Sep 25, 2019
LICENSE.md
README.md
composer.json

README.md

SilverStripe site.webmanifest

This module provides site.webmanifest for SilverStripe. Values are configurable per YML or within SiteConfig in the CMS. Yml-config (static) and values from SiteConfig (dynamic) can be used to glue stuff from build tools and strings maintained per SiteConfig.

Installation

Composer is the recommended way of installing SilverStripe modules.

composer require lerni/silverstripe-webmanifest

Requirements

  • silverstripe/framework ^4
  • silverstripe/siteconfig ^4

Suggested

  • jonom/silverstripe-text-target-length ^2
  • tractorcow/silverstripe-colorpicker ^4

Configuration

You can set per yml-config whats in the manifests json. With 'SiteConfig' as value, properties are editable per SiteConfig in CMS (dev/build needed). Alternatively they can be set to other SiteConfig values like 'SiteConfig.Title'. If lang isn't specifically set, i18n::get_locale() 'll be used. With the default config (bellow) name is set to the value from SiteConfig.Title, for short_name a field is automatically added to SiteConfig. Further webmanifest values can be added like background_color or icons as strings or arrays. See the full list of settings W3C. If Page (CMS-Module) exist, the manifest 'll be linked with a Header-Tag (<link rel="manifest" href="/site.webmanifest">).

Kraftausdruck\Webmanifest\Webmanifest:
  fields:
    name: 'SiteConfig.Title'
    short_name: 'SiteConfig'
    description: 'SiteConfig.Tagline'
    start_url: '/home'
    background_color: '#fff'
    icons:
      - src: '/android-chrome-192x192.png'
        sizes: '192x192'
        type: 'image/png'
      - src: '/android-chrome-384x384.png'
        sizes: '384x384'
        type: 'image/png'
You can’t perform that action at this time.