Hi Adam,
It looks like Current URL will do exactly what you are looking for.
Let me know what you think!
Cheers!
Ok,
I tested this with PHP enabled in the template:
echo $this->EE->input->server('REQUEST_URI');Which gets the request URI from the server. It seems that the “#value” is not returned as part of the request. It is handled at the DOM level in the browser, so you are left with looking for a JavaScript solution.
Cheers,
I’ve been dealing with this issue also. My goal is to create a single user session environment that can be linked to each page, with dynamic meta data, social sharing and Google SEO crawls. What I found is that hash tag urls don’t allow this, no server side detection of the hash tag url. Noted above.
What I found was a html5 technique, that so far, is doing exactly what i needed. Rather than reading the url with jquery address, change the url using pushState.
var section_state = new Object();
var new_url = "/"+_url.data.url;
var new_title = "Site Name - "+_url.data.title;
history.pushState(section_state,new_title,new_url);
var page_pathname = window . location . pathname;
section_url = page_pathname.split("/")[1];
subsection_url = page_pathname.split("/")[2];Granted, this solution has issues with older browsers. But, I foresee this as the way to go moving forward.
Reference: https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history http://blog.new-bamboo.co.uk/2011/2/2/degradable-javascript-applications-using-html5-pushstate http://badassjs.com/post/840846392/location-hash-is-dead-long-live-html5-pushstate
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.