Hiya,
Just another exceptionally quick plugin in case anyone needs the functionality.
I was asked over in this thread how to fetch the current page URI and I had said that you could either use the {homepage} variable mixed in with {segment} variables or you could use the fetch_current_uri function or the tracker array session although this last one would only work once a person had been to one page first.
I’m hoping there isn’t an easier way that I have just overlooked. There might be as I didn’t really get any sleep last night due to the 54Kt winds we experienced here!!
Anyway, plugin attached to do just what it says on the tin and nothing more!!
Usage : V1.0
Simply place the following plugin tag in to your template where you would like to display the current page URI.
{exp:fetch_current_uri}
That’s it!
Usage: V1.0.2
Fetch the current page URI and render it to the template.
Just place the following plugin tag on the page where you would like the page URI to be displayed.
{exp:fetch_current_uri text="Link Text" title="My Title" class="css-class" id="my-id" rel="internal" uri-only="yes"}
uri-only="yes" or uri-only="no" - If this parameter isn’t supplied then the plugin will create links along with the other parameters shown below.
If supplied however then there are two values, yes and no which can be used. Using no is the same as omitting the parameter whereas yes will allow
you to just return the current uri without turning it into a link.text="Link Text” - text that displays on the page instead of the URI
If you leave the text="” parameter blank then it will instead place the URI in place of any text that you would have wanted!
title="My Title” - text that gets set in the link title (check source code on page)
class="css-class" - sets the class of the link
id="my-id" - sets the id of the link
rel="internal" - sets the rel for the link
Hope it helps some people out somewhere.
Best wishes,
Mark
