This commit is contained in:
Michel 2018-06-24 16:53:19 +02:00
parent f78a4fd0b7
commit 67eb7144c8
3 changed files with 12 additions and 2 deletions

View File

@ -9,4 +9,4 @@ composer require pixelspin/silverstripe-progressivewebapp
## Usage
Install the module, run dev/build and fill in the settings in the siteconfig
Place the link to the manifest file (<link rel="manifest" href="{$BaseHref}manifest.json">) in the head of your pages
Place the link to the manifest file (<link rel="manifest" href="{$BaseHref}manifest.json">) in the head of your pages and add the color meta data as well (<meta name="theme-color" content="$SiteConfig.ManifestColor">)

View File

@ -78,6 +78,16 @@ class ProgressiveWebAppController extends Controller {
'src' => $logo->Fill(192,192)->Link(),
'sizes' => '192x192',
'type' => $mime
],
[
'src' => $logo->Fill(256,256)->Link(),
'sizes' => '256x256',
'type' => $mime
],
[
'src' => $logo->Fill(512,512)->Link(),
'sizes' => '512x512',
'type' => $mime
]
];
}

View File

@ -55,7 +55,7 @@ class ProgressiveWebAppSiteConfigExtension extends DataExtension {
public function updateCMSFields(FieldList $fields) {
$fields->addFieldToTab('Root.ProgressiveWebApp', TextField::create('ManifestName', 'Name')->setDescription('Application name'));
$fields->addFieldToTab('Root.ProgressiveWebApp', TextField::create('ManifestShortName', 'Short name')->setDescription('Short human-readable name for the application'));
$fields->addFieldToTab('Root.ProgressiveWebApp', TextField::create('ManifestShortName', 'Short name')->setDescription('Short human-readable name for the application try to keep it at a maximum of 12 characters'));
$fields->addFieldToTab('Root.ProgressiveWebApp', TextField::create('ManifestDescription', 'Description')->setDescription('Short description about the app'));
$fields->addFieldToTab('Root.ProgressiveWebApp', ColorField::create('ManifestColor', 'Color')->setDescription('Color used for the splash screen and/or icon'));
$fields->addFieldToTab('Root.ProgressiveWebApp', DropdownField::create('ManifestOrientation', 'Orientation', array_combine(self::$orientations, self::$orientations))->setDescription('App orientation'));