Skip to Content Skip to Menu

js on first login

10 years 8 months ago - 10 years 8 months ago #241032 by thewebsurfer
Replied by thewebsurfer on topic js on first login

krileon wrote: First append your variable to the first time login redirect within CB > Configuration > Registration. Next you'll need to create a code action that acts on the profile display trigger with a conditional as follows.

Conditional: [get_firstlogin] Equal To 1

You can then use the JS or jQuery methods to add whatever code you like. Note when using either of those you provide raw JS/jQuery, you do not need script tags or anything (e.g. StartTour(); ).


i will try this,

but temporary now i want just a simply onAfterLogin alert.
type:code
trigger:onAfterLogin
method:html
code:<script>alert("dsa");</script>

i tried js inline too, what is wrong?
Last edit: 10 years 8 months ago by thewebsurfer.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48477
  • Thanks: 8281
  • Karma: 1443
10 years 8 months ago #241066 by krileon
Replied by krileon on topic js on first login
There is a redirect right after that trigger. Your JS never has time to append to the header and output. You need to add your JS at the endpoint (where you're redirecting to).


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 or Create an account to join the conversation.

10 years 8 months ago #241071 by thewebsurfer
Replied by thewebsurfer on topic js on first login

krileon wrote: There is a redirect right after that trigger. Your JS never has time to append to the header and output. You need to add your JS at the endpoint (where you're redirecting to).


at this time i have not implemented yet the first login stuff,
i just want an alert OnLogin, but obiouvsly i cant add the alert in profile page (i want 1 time alert not an extremely annoyng one :) who appears each profile page visit )

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48477
  • Thanks: 8281
  • Karma: 1443
10 years 8 months ago #241081 by krileon
Replied by krileon on topic js on first login

i just want an alert OnLogin, but obiouvsly i cant add the alert in profile page (i want 1 time alert not an extremely annoyng one :) who appears each profile page visit )

I've already explained how to do this. Please see my previous replies. You need to edit your first time login redirect URL within CB > Configuration > Registration with a variable you can check for in your action. Example as follows.

Redirect: index.php?option=com_comprofiler&first=1

Conditional: [get_first] Equal To 1

The first time login redirect is only used when it's the users first login. Your regular login can just exclude &first from the URL and your action won't do anything.


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 or Create an account to join the conversation.

10 years 8 months ago #241084 by thewebsurfer
Replied by thewebsurfer on topic js on first login

krileon wrote:

i just want an alert OnLogin, but obiouvsly i cant add the alert in profile page (i want 1 time alert not an extremely annoyng one :) who appears each profile page visit )

I've already explained how to do this. Please see my previous replies. You need to edit your first time login redirect URL within CB > Configuration > Registration with a variable you can check for in your action. Example as follows.

Redirect: index.php?option=com_comprofiler&first=1

Conditional: [get_first] Equal To 1

The first time login redirect is only used when it's the users first login. Your regular login can just exclude &first from the URL and your action won't do anything.



sorry maybe its a translation misunderstand,
i will implement the first time login with the guide tour, but since this will take a long time to be done,
NOW i want just an alert EACH user login.. thats why i tried this
the autoaction in post#241032

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48477
  • Thanks: 8281
  • Karma: 1443
10 years 8 months ago #241120 by krileon
Replied by krileon on topic js on first login
You can't alert on login. There is no HTML output during login. So there is no where for your JS to append to. JS is client side, not server side, so you can't do anything with it when there's no output.


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 or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum