Created
July 20, 2015 18:52
-
-
Save aertmann/bed34b9ce79e63fb15c9 to your computer and use it in GitHub Desktop.
Neos – Inline last visited node script to avoid inline scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
$(function() { | |
try { | |
sessionStorage.setItem( | |
'TYPO3.Neos.lastVisitedNode', | |
document.querySelector('meta[name="neos-last-visited-node"]').getAttribute('content') | |
); | |
} catch (e) { | |
throw e; | |
} | |
}); | |
})(jQuery); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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