I noticed that if I'm not logged in (an anonymous or unregistered user), then if I subscribe to a forum I'm only given the option to subscribe to "All Topics" or "New Topics". I'm not given the option for Digest or Individual mail. That seems like a bug.
Coleen |
I looked at this for a while and couldn't find a way to give them the option to subscribe via digest or Individual mail. Since the macro's are shared with the invitation to join the mailing list and the subscribe_by_code macro sets the subscription_type=INSTANT. Other than duplicating a number of macros and separating out the anonymous subscription request on the web.
So I decided in my situation I could instead just to tell them they needed to login to subscribe. So I updated the anonymouns_subscription_form macro to this: <override_macro name="anonymous_subscription_form"> <div style="margin:1em 0"> <t>Please <n.login_link.>log in</n.login_link.> first to subscribe via email</t> <script type="text/javascript"> if (Nabble.isEmbedded) { var $l = $('#login-link'); $l.attr('href', $l.attr('href') + '&nextUrl=/'); } </script> </div> </override_macro> It seems to work. |
How would I send them to the subscription page after they login?
Coleen |
I don't think it is a good idea, but you can do it:
<override_macro name="login_page" requires="servlet"> <n.set_var. name="error"><n.false/></n.set_var.> <n.if.is_submitted_form> <then> <n.do_login> <email><n.email_field.value/></email> <password><n.password_field.value/></password> <nextUrl><n.root_node.subscribe_path/></nextUrl> </n.do_login> <n.set_var. name="error"><n.true/></n.set_var.> </then> </n.if.is_submitted_form> <n.html> <head> <meta name="robots" content="noindex,nofollow"/> <n.title.><t>Login</t></n.title.> <n.email_field.focus/> <script type="text/javascript"> var loginNextUrl = '<n.default. to="/"><n.nextUrl_field.value/></n.default.>'; </script> </head> <body> <h1 class="weak-color"><t>Login</t></h1> <n.login_message/> <n.if.var name="error"> <then.format_error message="[t]Incorrect Login![/t]" prompt="[t]Please re-enter your email/password and click Login.[/t]" /> </n.if.var> <n.login_form/> <n.register_now_section/> </body> </n.html> </override_macro>
My test forum.
|
Maybe I didn't write this request very clearly. When they try to subscribe and they're not logged in, I want them to login and then go back to the subscribe page to complete their subscription. I do not want them to go to the subscription page every time they login (which is what I'm getting with this change).
This is how I modified the anonymous_subscription_form: Is there something that I can put in the anonymous subscription page that takes them to the subscription page after they logged in? It's not a big deal, would just be nice to leave them where they were instead of taking them to the main page. -Coleen |
Please, try this code:
<override_macro name="anonymous_subscription_form"> <n.comment.>Do not let them subscribe unless logged in</n.comment.> <div style="margin:1em 0"> <t>Please <n.login_link.>log in</n.login_link.> first to subscribe via email</t> <script type="text/javascript"> var $l = $('#login-link'); var subscribe = "/template/NamlServlet.jtp?macro=subscribe&node=<n.page_node.id/>"; $l.attr('href', $l.attr('href') + "&nextUrl="+ encodeURIComponent(subscribe)); </script> </div> </override_macro>
My test forum.
|
Works perfect! Thanks.
Coleen |
Free forum by Nabble | Edit this page |