Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Two `<meta/>` tags and a `<script/>` tag to allow iOS users to use the "Add to Home Screen" function in Mobile Safari. This is convenient in maximizing screen real estate when composing in `/admin`. This is a modification to `/admin/themes/ascent/layouts/default.php`
$current_user = Auth::getCurrentMember();
$name = $current_user->get('name');
?><!doctype html>
<html lang="<?php echo Config::getCurrentLanguage(); ?>">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0">
<title>Statamic Control Panel</title>
<link rel="stylesheet" href="<?php echo Path::tidy(Config::getSiteRoot().'/'.$app->config['theme_path']) ?>css/ascent.min.css">
<link rel="shortcut icon" href="<?php print Path::tidy(Config::getSiteRoot().'/'.$app->config['theme_path'])?>img/favicon.ico" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
var transliterate = <?php echo json_encode(Config::get('custom_transliteration', array())); ?>;
var content_type = "<?php echo Config::getContentType(); ?>";
<script type="text/javascript" src="<?php echo Path::tidy(Config::getSiteRoot().'/'.$app->config['theme_path'])?>js/ascent.min.js?v=1.8.2"></script>
<?php echo Hook::run('control_panel', 'add_to_head', 'cumulative') ?>
if(("standalone" in window.navigator) && window.navigator.standalone){
var noddy, remotes = false;
document.addEventListener('click', function(event) {
noddy =;
while(noddy.nodeName !== "A" && noddy.nodeName !== "HTML") {
noddy = noddy.parentNode;
if('href' in noddy && noddy.href.indexOf('http') !== -1 && (noddy.href.indexOf( !== -1 || remotes)) {
document.location.href = noddy.href;
<body id="<?php echo $route; ?>">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment