Help: How to grab the URL of the current displayed page
Posted: 10 March 2008 01:15 AM   [ Ignore ]  
Grad Student
Avatar
Rank
Total Posts:  34
Joined  09-28-2002

Hi Gang,

Just a quick little question. Is there a tag that grabs the full URL of the current displayed page and then prints it out in the footer of site?

I have looked through globals in the docs and it seems there isn’t…or, I am missing it somewhere…

Thanks guys.

 Signature 

Details: ExpressionEngine - 1.6.4.
Build: 20080808.

—————————————-
“Clutter and confusion are failures of design, not attributes of information. There’s no such thing as information overload.”
—————————————-

Profile
 
 
Posted: 10 March 2008 02:08 AM   [ Ignore ]   [ # 1 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6610
Joined  04-15-2006

Hiya,

There are a couple of ways you could do this. The first being you could use the {homepage} variable combined with {segment} variables to get what you need. That might be a bit messy in your template though but would probably work.

Another way would be using the fetch_current_uri() function from the functions class. You would need to make a simple plugin that would do this for you and it would just fetch the page URI and then spit it out to the page.

fetch_current_uri()

Returns uri for current page.
Class: Functions (FNS)
Description: Returns the full URI for the current page. Occassionally, used in forms when a return location is not set by default.

There is also the tracker array in the session class which would do what you need but only once the person has been to at least one page.

If you can wait until a little later today then I can create a plugin for you if you like unless you know how to create your own?

Hope some of that helps?

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 10 March 2008 02:29 AM   [ Ignore ]   [ # 2 ]  
Grad Student
Avatar
Rank
Total Posts:  34
Joined  09-28-2002

Hi Mark,

Thanks for your replay mate. Hmm, I cant program a rats tail so your offer to create a plugin is much appreciated!

 Signature 

Details: ExpressionEngine - 1.6.4.
Build: 20080808.

—————————————-
“Clutter and confusion are failures of design, not attributes of information. There’s no such thing as information overload.”
—————————————-

Profile
 
 
Posted: 10 March 2008 02:33 AM   [ Ignore ]   [ # 3 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6610
Joined  04-15-2006

Here you go! As promised a plugin that will simply retrieve the URI of the current page and then spit out the text for you.

Hope it’s what you need?

Usage :

Simply place the following plugin tag in to your template where you would like to display the URI :

{exp:fetch_current_uri}

This will then output the text showing the current page URI.

Hope that helps?

Best wishes,

Mark

File Attachments
pi.fetch_current_uri.php.zip  (File Size: 2KB - Downloads: 82)
 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 10 March 2008 02:42 AM   [ Ignore ]   [ # 4 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6610
Joined  04-15-2006

Just in case you need it - the plugin page in the forum is here.

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 10 March 2008 02:48 AM   [ Ignore ]   [ # 5 ]  
Grad Student
Avatar
Rank
Total Posts:  34
Joined  09-28-2002

You…have…got…to…be…kidding…me!  grin

Good lord I thought you would be flat out and may not have time to do this but its like 20 minutes and you have very kindly done it already. Thanks again Mark, it is very much appreciated! The site is almost complete now on my local machine and this is the icing on the cake. Works perfectly!

 Signature 

Details: ExpressionEngine - 1.6.4.
Build: 20080808.

—————————————-
“Clutter and confusion are failures of design, not attributes of information. There’s no such thing as information overload.”
—————————————-

Profile
 
 
Posted: 10 March 2008 02:53 AM   [ Ignore ]   [ # 6 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6610
Joined  04-15-2006
An Aussie - 10 March 2008 02:48 AM

You…have…got…to…be…kidding…me!  grin

We try out best to please around here wink

Actually it was a bit quicker than 20 minutes. The plugin was written in literally 3 minutes but I had to feed the cats and do a few other things etc wink

Let us all see your site when it is finished with if you are able to?

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 10 March 2008 03:03 AM   [ Ignore ]   [ # 7 ]  
Grad Student
Avatar
Rank
Total Posts:  34
Joined  09-28-2002

“We try our best o please around here grin”—heh, will you sure as done that mate. Will do re my site, it isn’t flash or anything, just a place to call home online. Will let you know when it goes live in a few days. Thanks again…

 Signature 

Details: ExpressionEngine - 1.6.4.
Build: 20080808.

—————————————-
“Clutter and confusion are failures of design, not attributes of information. There’s no such thing as information overload.”
—————————————-

Profile
 
 
Posted: 10 March 2008 03:19 AM   [ Ignore ]   [ # 8 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6610
Joined  04-15-2006

No problems. I might add in a few more features to the plugin when I get a chance so maybe keep an eye on the plugin thread referenced above.

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 10 March 2008 03:41 AM   [ Ignore ]   [ # 9 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6610
Joined  04-15-2006

Well I have fed the cats now and got everything else pretty much out of the way for the day so thought I would go ahead and add in the extra features as promised wink

If you check out the Fetch Current URI plugin page then you should see what I have done wink

Hope it helps.

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 65087 Total Logged-in Users: 39
Total Topics: 82229 Total Anonymous Users: 22
Total Replies: 441930 Total Guests: 211
Total Posts: 524159    
Members ( View Memberlist )