1

This may sound a little odd so let me explain what's going on.

In my current setup I have allowed new users to sign up. I want these users to follow this flow:

  1. Fill up sign up form and submit
  2. Gets redirected to page that warns them of activation email
  3. User opens email, clicks on link and is forwarded to his/her profile page

So far I've been able to do this without any problems. However, I would like to be able to welcome the user when the account is activated without using a new template.

In this moment 'activateAccountSuccessPath' is set to the profile page, let's call it 'members/profile' I would like to pass a parameter so that I can detect if the account is being activated for the first time and therefore should display a message, e.g.: 'members/profile?activated=true'. As of now, this isn't possible because it looks for the template with that name, not recognizing that it has parameters.

I would like to use this same feature for other variables such as 'setPasswordSuccessPath', which would take you back to the login page, but displaying a message.

If it's impossible to pass arguments this way, how would you recommend going about it?

3

I think I figured out how to do it but I'd like to get any opinions on this matter.

Right now I've setup a dummy template which contains a redirect to the URL with the parameter I need. So:

'activateAccountSuccessPath' => 'members/activated

And then that template contains:

{% redirect 'members/profile?activated=true' %}

This is working great. And I guess it's a clean way to do it from the point of view that each variable in the config file has a different target. But is it "cool" to do a redirect just for that?

|improve this answer|||||
  • This is how I'd do it for sure :) – Alec Ritson Dec 9 '14 at 9:42
1

Another possiblity is to have a members/activated template which does nothing but include the members/profile template:

{% include 'members/profile.html' with {'activated': true} %}

That avoids the html redirect.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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