[SOLVED] Switching to url after login based on language

7 years 4 months ago - 7 years 4 months ago #289424 by sentix
I have a question: I want to have the user redirected to a specific page after login. I could add a url to a plan. But what if I want to change the url depending on the user's language?

is there translatioin supported for the URL field? Or how can I retrieve the users language tag in the auto actions condition?`

Thanks for your help!

Versions: CB 2.7.2, J 3.10.6

Please Log in to join the conversation.

7 years 4 months ago #289426 by krileon
Login redirect is based off the module as you specify the login redirect directly in your login module. Login modules can be language specific using normal Joomla language functionality for modules. You'd create 2 modules 1 for each of your languages for example and with each having a different login redirect as needed.

As for CBSubs if the login redirect parameter supports substitutions you can use an IF substitution to condition for language. See the below substitutions tutorial as there's an example for this.

www.joomlapolis.com/documentation/279-community-builder/tutorials/18353-using-substitutions-throughout-cb


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

7 years 4 months ago #289596 by sentix
I tried in the "URL redirect on login" field in workflow/plans, but this field doesn't recognize substitutions. Right?

Versions: CB 2.7.2, J 3.10.6

Please Log in to join the conversation.

7 years 4 months ago #289604 by krileon
Doesn't look like it does so you won't be able to have language specific redirects based off CBSubs plan. You'd probably have to combine the usage with CB Auto Actions to redirect based off language and subscription on the after login trigger using the below conditions in a Redirect action.

Conditions
1: [cb:config param="lang_tag" /] Equal To LANGUAGE_TAG_HERE
2: [cbsubs:if plan="PLAN_ID_HERE" status="A"]PASS[/cbsubs:if] Equal To PASS


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

7 years 4 months ago - 7 years 4 months ago #289614 by sentix
Hi krileon,
the auto actions work not with the plan id! Only the language-tag alone works but as soon as I add the second condition, the Auto actions will not triggered anymore. Any Idea?

I have a further question regarding the language tag:

It looks like that this tag is not from the users profile, right? How can I manage that the language tag is equal to the users settings? And why is it, that CB does not automatically recognize the users language and changes the language code internally to the users preference?

Thanks again for your help.

Versions: CB 2.7.2, J 3.10.6

Please Log in to join the conversation.

7 years 4 months ago #289616 by krileon

It looks like that this tag is not from the users profile, right? How can I manage that the language tag is equal to the users settings?

Looks like it's just outputting the site language. You'll likely need to use the below then. Have added a feature ticket to improve the usage to use the user language if possible.

[cb:if language_tag="LANGUAGE_TAG_HERE"]PASS[/cb:if] Equal To PASS

forge.joomlapolis.com/issues/6408

And why is it, that CB does not automatically recognize the users language and changes the language code internally to the users preference?

Don't understand why it should. The language Joomla displays is based off either the the Joomla user language set in the user object or the sites language. Alternatively use Joomlas language switcher module.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.205 seconds

Facebook Twitter LinkedIn