Skip to content

Instantly share code, notes, and snippets.

@aertmann
Created July 20, 2015 18:52
Show Gist options
  • Save aertmann/bed34b9ce79e63fb15c9 to your computer and use it in GitHub Desktop.
Save aertmann/bed34b9ce79e63fb15c9 to your computer and use it in GitHub Desktop.
Neos – Inline last visited node script to avoid inline scripts
(function($) {
$(function() {
try {
sessionStorage.setItem(
'TYPO3.Neos.lastVisitedNode',
document.querySelector('meta[name="neos-last-visited-node"]').getAttribute('content')
);
} catch (e) {
throw e;
}
});
})(jQuery);
body {
# Include script directly in minified script
lastVisitedNodeScript {
tagName = 'meta'
attributes >
attributes {
name = 'neos-last-visited-node'
content = ${q(node).property('_identifier')}
}
@cache {
mode = 'cached'
entryIdentifier {
identifier = 'lastVisitedNodeScript'
node = ${node}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment