ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Dynamically generate the current URL

July 07, 2008 7:33pm

Subscribe [3]
  • #1 / Jul 07, 2008 7:33pm

    Michael C.

    29 posts

    This feels like a really stupid and obvious question, but… how do I dynamically generate the current URL in a template? I’ve got a members-only page that shows a hard-coded login form if the user isn’t logged in, and I want the form to return them to that page when they do login (using the <input type=“hidden” name=“RET” value=“http://www.example.com/members/only/” /> line, I believe).

  • #2 / Jul 07, 2008 9:32pm

    Danny T.

    426 posts

    Michael,

    I’m not sure if this is what you need, but check out this thread here, and also this wiki post.

  • #3 / Jul 07, 2008 11:41pm

    Michael C.

    29 posts

    The Wiki kinda addresses the issue, but the problem isn’t redirecting the user after login, it’s getting the URL of the current page so that I can redirect the user to the proper place to begin with. 😊

  • #4 / Jul 08, 2008 12:16am

    Danny T.

    426 posts

    Oh, forgive me.. I thought you wanted to redirect the user to the page they were originally on? Those two links should address that issue.

    If you’re looking for something to determine the current user’s URL, you can use this plugin made by Mark Bown, called Fetch URI. There’s been a lot of inquiries of late for what you want to do, so just dig a bit back maybe 1-2 days and you might find a bit more information.

    Hope this helps. If you don’t mind, please post your results and what you did so others can hopefully use this as a resource. 😊

  • #5 / Jul 11, 2008 4:29am

    Michael C.

    29 posts

    I think you might have linked to the wrong thread…

  • #6 / Jul 11, 2008 5:13am

    Danny T.

    426 posts

    The Fetch URI will get the current URL for you..

  • #7 / Jul 11, 2008 5:39am

    Danny T.

    426 posts

    Forgive me if I am misunderstanding.. Are you simply wondering how you can create the page that the link is referring to with templates or something?

  • #8 / Jul 22, 2008 10:52am

    Michael C. (KKCJ)

    100 posts

    EDIT: Dangit, I hate when I post from the wrong login.

    Nope. 😊 I simply want a {current_url} tag that, if I put it in this thread (and if the forums parsed EE tags), would output the current URL - in this thread’s case: http://ellislab.com/forums/viewthread/84431/

    I think you might have linked to the wrong thread…

    When I wrote that, I was referring to your first reply in this thread, sorry. 😊 In any case, yes, it looks like the Fetch URI will do the trick.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases