Is there a method or recommended way of grabbing URL hash parameters with Twig?
For example, if my URL is http://mysite.com/my-page#hash, is there a way to grab the hash?
Craft CMS Stack Exchange is a question and answer site for administrators, end users, developers and designers for Craft CMS. It only takes a minute to sign up.
Sign up to join this communityIs there a method or recommended way of grabbing URL hash parameters with Twig?
For example, if my URL is http://mysite.com/my-page#hash, is there a way to grab the hash?
This isn't possible because the #hash
-part isn't even send to the server. See this question on StackOverflow: Can PHP read the hash portion of the URL?
But if you use ?hash=something
instead, these functions will help you: getParam()
and getQuery()