3

EE 2.7.2 Structure 3.3.13

I've got a site where I have a front end login form that is on all pages as a modal when clicking the login link in the header. Everything works fine, however for the redirect="" parameter I would like the form to redirect to the page it was filled out on.

using this code:

  {exp:member:login_form return="{page_url}"}
    <label>Username</label>
    <input type="text" name="username" value="" maxlength="32" size="25">

    <label>Password</label>
    <input type="password" name="password" value="" maxlength="32" size="25">

    <input type="submit" name="submit" value="Submit" class="button small">
  {/exp:member:login_form}

results in a broken url http://domain.com/%7Bpage_url%7D

and a white page with this message

The URI you submitted has disallowed characters.

I tried using low variables and preparsing the {page_url} (same as embedding a template) but that also did not work.

Is there a way to get the {page_url} to work in the login form?

2
  • Did you end up figuring this out, Sean?
    – Alex Kendrick
    Nov 21, 2013 at 16:38
  • Yes - when I can access that site, I'll look at the code and post it here as an answer. Forgot about this.
    – CreateSean
    Nov 21, 2013 at 17:08

3 Answers 3

4

Use the Structure global variable {structure:page:uri} which is the same as EE's native "page_url" variable.

1
  • 1
    tried that still getting the same error and broken url
    – CreateSean
    Nov 5, 2013 at 12:53
1

Sounds like it's just not parsing your {page_url} -- try parse="inward"?

{exp:member:login_form return="{page_url}" parse="inward"}
1
  • no change when adding parse="inward"
    – CreateSean
    Nov 5, 2013 at 12:54
0

Try using EE's {current_url} Standard Global Variable. I've successfully used this for the return parameter on the Member module login_form tag for exactly the same scenario you are describing.

{exp:member:login_form return="{current_url}"}
   ...
{/exp:member:login_form}
2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.