[SOLVED] Create an auto action for popup message to a user to update his Avatar if none uploaded on his profile.

8 years 5 months ago - 8 years 4 months ago #274285 by pranaydhruv
Hello Team,

I am trying to create an auto action so that a user can be prompted to upload their avatar instead of leaving it to a default image.

what i have tried so far :-

Trigger - on after user profile display
type - can't find a suitable one ?
condition - [avatar] equalto
action - dependent on type selected above.

Thanks
Pranay
The topic has been locked.
8 years 5 months ago #274415 by nant

pranaydhruv wrote: Hello Team,

I am trying to create an auto action so that a user can be prompted to upload their avatar instead of leaving it to a default image.

what i have tried so far :-

Trigger - on after user profile display
type - can't find a suitable one ?
condition - [avatar] equalto
action - dependent on type selected above.

Thanks
Pranay


It would help to describe the workflow you are thinking about - this way I could at least (for starters) propose the trigger.
The topic has been locked.
8 years 5 months ago #274426 by pranaydhruv
Hello Nant,

the workflow is as follows :-

1) User logs in and at that time they get a Popup message only incase their avatar image is blank(no image has been uploaded by them).

2)This message tells them to upload an Avatar image.

3) If they upload their image the popup message should stop.

4) incase they dont upload the avatar the pop should come on every login (so basically oniy once after they login everytime till they upload an avatar)

The reason i chose the trigger on after profile display is because in my website the user gets re-directed to their profile first.

Thanks
Pranay
The topic has been locked.
8 years 4 months ago #274458 by nant

pranaydhruv wrote: Hello Nant,

the workflow is as follows :-

1) User logs in and at that time they get a Popup message only incase their avatar image is blank(no image has been uploaded by them).

2)This message tells them to upload an Avatar image.

3) If they upload their image the popup message should stop.

4) incase they dont upload the avatar the pop should come on every login (so basically oniy once after they login everytime till they upload an avatar)

The reason i chose the trigger on after profile display is because in my website the user gets re-directed to their profile first.

Thanks
Pranay


Well the most logical trigger then would be the onAfterLogin, but that one does not output any html code which means that you cannot use a js alert code action to do a pop-up.

My humble suggestion on your described use case is to create a Joomla article (and a Joomla menu item pointing to it) where you describe the benefits of having uploaded a profile avatar image etc.

Then create a redirect action as follows:

Global
Trigger: onAfterLogin
Description: This action redirects users with no avatar after login to a specific Joomla menu
Conditions
[avatar] is REGEX /nophoto_n.png/ Yes
Action
URL: PLACE_YOUR_NONSEF_URL_HERE
Message: You have not uploaded your profile image yet.
Type: Attention
The topic has been locked.
8 years 4 months ago - 8 years 4 months ago #274511 by pranaydhruv
Hello Nant,

I tred the following :-

Global
Trigger: onAfterLogin
type: code

Conditions
[avatar] is REGEX /nophoto_n.png/ Yes

Action
Method=html
code=
    alert("I am an alert box!");
The topic has been locked.
8 years 4 months ago #274529 by nant

pranaydhruv wrote: Hello Nant,

I tred the following :-

Global
Trigger: onAfterLogin
type: code

Conditions
[avatar] is REGEX /nophoto_n.png/ Yes

Action
Method=html
code=

    alert("I am an alert box!");


First of all you cannot put javascript code in an HTML code action.
You would need a JS (inline) code method.

Secondly, please reread what I wrote again.

Well the most logical trigger then would be the onAfterLogin, but that one does not output any html code which means that you cannot use a js alert code action to do a pop-up.


I mentioned that you cannot use a code action with the onAfterLogin trigger because it does not output HTML and you propose something that basically verifies what I wrote.

So my solution previously proposed (which I did test before I posted) does work. It is not a popup as you requested but it does address the use case concept you wanted.

To get a popup you might be able to chain actions, but I have not managed to get this working on my tests so I cannot really propose specific actions / code for you.
The topic has been locked.
Moderators: beatnantkrileon
Time to create page: 0.204 seconds

Facebook Twitter LinkedIn