Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {strip}
- {*
- * Template name: Bootstrap4 AppManifest
- * -------------------------------------
- *
- * This section of the template is designed to output a valid web app manifest file.
- * The values here are automatically calculated based on the settings specified in
- * the "Bootstrap4 Settings" template and this file should need no manual adjustments.
- *
- * Part of the CMSMS Bootstrap4 template by stom | stom66.co.uk
- *}
- {process_pagedata}
- {content_type type="application/manifest+json"}
- {include file="cms_template:Bootstrap4 Settings"}
- {$content = "{content}"}
- {$sizes = [48, 72, 96, 144, 168, 192]}
- {$icons = []}
- {foreach from=$sizes item=size}
- {$file_ext = $manifest_icon|pathinfo:$smarty.const.PATHINFO_EXTENSION|lower}
- {if ($file_ext=="png")}
- {$icon.type = "image/png"}
- {elseif ($file_ext=="jpg" || $file_ext=="jpeg")}
- {$icon.type = "image/jpeg"}
- {elseif ($file_ext=="svg")}
- {$icon.type = "image/svg+xml"}
- {elseif $file_ext=="webp"}
- {$icon.type = "image/webp"}
- {/if}
- {if $file_ext == "svg"}
- {$icon.src = $manifest_icon}
- {else}
- {CGSmartImage assign=foo src=$manifest_icon notag=1 noembed=1 filter_resizetofit="{$size},{$size},#ff000,126"}
- {$icon.src = $foo}
- {/if}
- {$icon.sizes = "{$size}x{$size}"}
- {append var="icons" value=$icon}
- {/foreach}
- {$output.lang = $page_lang}
- {$output.background_color = $background_color}
- {$output.description = $manifest_desc}
- {$output.display = $manifest_display_style}
- {$output.name = "{sitename}"}
- {$output.short_name = "{sitename}"}
- {$output.start_url = "{root_url}"}
- {$output.theme_color = $theme_color}
- {$output.orientation = $manifest_orientation}
- {$output.orientation = $manifest_orientation}
- {$output.icons = $icons}
- {$output|@json_encode nofilter}
- {/strip}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement