Page 1 of 1

[solved] Self Registration: no message after registration?

Posted: Wed Jul 23, 2014 9:53 am
by 10010110
I have Frontend Users, Self Registration and Custom Content installed. I’m providing a page with a login form and a registration form. If someone fills out the registration form and clicks the submit button the page just reloads and shows an empty form again instead of showing the confirmation message.

The page template looks basically like this (stripped down to the actually relevant code):

Code: Select all

<div class="section s1">
{if ccUser::loggedin()}
  {content}
{else}
	<h2>Not registeted yet? Sign up here.</h2>
	{cms_module module="SelfRegistration" group="Geologists" nocaptcha="1"}
{/if}
</div>
<div class="section s2">
{if ccUser::loggedin()}
	{FrontEndUsers}
{else}
	<h2>Already registered? log in here.</h2>
	{FrontEndUsers nocaptcha="1"}
{/if}
</div>
So, what I suppose is happening is that once the registration form is submitted, the template logic strikes back and because the user is still not logged in at this point it shows the login and registration forms again. Changing the “inline” setting for the form doesn’t change anything in the output.
And I seem to remember when I first set this up it used to work but in the meantime some module upgrades might have corrupted that? I’m not 100% sure, though.

Now, I know in the SelfReg module settings I can set a page to redirect after registration and that works (i. e. I set it to redirect to “Test Page” previously and it showed the confirmation message there) but it feels pretty redundant to create an empty page just for that. Also this will change the current menu status etc.
Is there any better solution that lets me use the same page/template and it will just show the confirmation message in place of the registration form?

Re: Self Registration form: no message after registration?

Posted: Wed Jul 23, 2014 8:26 pm
by 10010110
OK, turns out that this only works if the Smarty logic is put right in the content field of the page, not in the template (and it also doesn’t work if the content is assigned to a variable beforehand because it has something to do with parse order).

Thanks johnbeatrice, once again.